コード例 #1
0
 /** {@inheritDoc} */
 @Override
 protected void installDefaults() {
   // Installs the text cursor on the component
   super.installDefaults();
   updateStyle(getComponent());
   getComponent().addFocusListener(handler);
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
  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();
      }
    }
  }