/** * Fire accessible property change events when the state of the toggle button changes. */ public void itemStateChanged(ItemEvent e) { JideToggleButton button = (JideToggleButton) e.getSource(); if (JideToggleButton.this.accessibleContext != null) { if (button.isSelected()) { JideToggleButton.this.accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.CHECKED); } else { JideToggleButton.this.accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.CHECKED, null); } } }
/** * Fire accessible property change events when the state of the toggle button changes. */ public void itemStateChanged(ItemEvent e) { JideToggleSplitButton tb = (JideToggleSplitButton) e.getSource(); if (JideToggleSplitButton.this.accessibleContext != null) { if (tb.isSelected()) { JideToggleSplitButton.this.accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.CHECKED); } else { JideToggleSplitButton.this.accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.CHECKED, null); } } }
/** * Sets the extra text for this button. Fires an <code>extraText</code> * property change event. * * @param extraText * Extra text for this button. * @see #getExtraText() */ public void setExtraText(String extraText) { String oldValue = this.extraText; this.extraText = extraText; firePropertyChange("extraText", oldValue, extraText); if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, oldValue, extraText); } if (extraText == null || oldValue == null || !extraText.equals(oldValue)) { revalidate(); repaint(); } }
/** * Sets the new text for this button. Fires a <code>text</code> property * change event. * * @param text * The new text for this button. * @see #getText() */ public void setText(String text) { String oldValue = this.text; this.text = text; firePropertyChange("text", oldValue, text); if (accessibleContext != null) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, oldValue, text); } if (text == null || oldValue == null || !text.equals(oldValue)) { revalidate(); repaint(); } }
public void setText(String text) { String oldAccessibleName = null; if (accessibleContext != null) { oldAccessibleName = accessibleContext.getAccessibleName(); } String oldValue = this.text; this.text = text; firePropertyChange("text", oldValue, text); // setDisplayedMnemonicIndex( // SwingUtilities.findDisplayedMnemonicIndex( // text, getDisplayedMnemonic())); if ((accessibleContext != null) && (accessibleContext.getAccessibleName() != oldAccessibleName)) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, oldAccessibleName, accessibleContext.getAccessibleName()); } if (text == null || oldValue == null || !text.equals(oldValue)) { revalidate(); repaint(); } }