/** {@inheritDoc} */ @Override protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); updateStyle(getComponent()); getComponent().addFocusListener(handler); }
/** * 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 */ @Override protected void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent) evt.getSource()); } super.propertyChange(evt); }
private void updateStyle(JTextComponent comp) { SynthContext context = getContext(comp, ENABLED); SynthStyle oldStyle = style; style = SynthLookAndFeel.updateStyle(context, this); if (style != oldStyle) { SynthTextFieldUI.updateStyle(comp, context, getPropertyPrefix()); if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } }