/** * This method gets called when a bound property is changed on the associated JTextComponent. This * is a hook which UI implementations may change to reflect how the UI displays bound properties * of JTextComponent subclasses. This is implemented to do nothing (i.e. the response to * properties in JTextComponent itself are handled prior to calling this method). * * @param evt the property change event */ protected void propertyChange(PropertyChangeEvent evt) { if (SeaGlassLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent) evt.getSource()); } super.propertyChange(evt); }
/** * DOCUMENT ME! * * @param c DOCUMENT ME! */ private void updateStyle(JTextComponent c) { SeaGlassContext context = getContext(c, ENABLED); SynthStyle oldStyle = style; style = SeaGlassLookAndFeel.updateStyle(context, this); updateSearchStyle(c, context, getPropertyPrefix()); if (style != oldStyle) { updateStyle(c, context, getPropertyPrefix()); if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } context.dispose(); context = getContext(c, SeaGlassRegion.SEARCH_FIELD_FIND_BUTTON, ENABLED); findStyle = SeaGlassLookAndFeel.updateStyle(context, this); context.dispose(); context = getContext(c, SeaGlassRegion.SEARCH_FIELD_CANCEL_BUTTON, ENABLED); cancelStyle = SeaGlassLookAndFeel.updateStyle(context, this); context.dispose(); }
/** @see javax.swing.plaf.basic.BasicTextUI#installDefaults() */ protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); JTextComponent c = getComponent(); updateStyle(c); c.addFocusListener(this); }
private void updateStyle(JTextComponent comp) { SeaGlassContext context = getContext(comp, ENABLED); SynthStyle oldStyle = style; style = SeaGlassLookAndFeel.updateStyle(context, this); if (style != oldStyle) { SeaGlassTextFieldUI.updateStyle(comp, context, getPropertyPrefix()); if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } context.dispose(); }
/** @see javax.swing.plaf.basic.BasicTextUI#installUI(javax.swing.JComponent) */ public void installUI(JComponent c) { super.installUI(c); updateStyle((JTextComponent) c); }