Пример #1
0
 /** Implementation */
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt == null) return;
   String id = evt.getPropertyName();
   if (EditorUI.COMPONENT_PROPERTY.equals(id)) { // NOI18N
     if (evt.getNewValue() == null) {
       // component deinstalled, lets uninstall all isteners
       release();
     }
   }
 }
Пример #2
0
    public synchronized void propertyChange(PropertyChangeEvent evt) {
      String propName = evt.getPropertyName();

      if (EditorUI.COMPONENT_PROPERTY.equals(propName)) {
        JTextComponent component = (JTextComponent) evt.getNewValue();

        if (component != null) { // just installed
          component.addPropertyChangeListener(this);
          attachSystemActionPerformer(component);
        } else { // just deinstalled
          component = (JTextComponent) evt.getOldValue();
          component.removePropertyChangeListener(this);
          detachSystemActionPerformer(component);
        }
      }
    }
Пример #3
0
    public synchronized void propertyChange(PropertyChangeEvent evt) {
      String propName = evt.getPropertyName();

      if (TopComponent.Registry.PROP_ACTIVATED.equals(propName)) {
        TopComponent activated = (TopComponent) evt.getNewValue();

        if (activated instanceof CloneableEditorSupport.Pane) editorActivated();
        else editorDeactivated();
      } else if (EditorUI.COMPONENT_PROPERTY.equals(propName)) {
        JTextComponent component = (JTextComponent) evt.getNewValue();

        if (component != null) { // just installed
          component.addPropertyChangeListener(this);
          if (component.isDisplayable()) {
            startTCRegistryListening();
          }

        } else { // just deinstalled
          component = (JTextComponent) evt.getOldValue();
          component.removePropertyChangeListener(this);
          stopTCRegistryListening();
        }

        reset();

      } else if ("editorKit".equals(propName)) { // NOI18N
        reset();

      } else if ("ancestor".equals(propName)) { // NOI18N
        if (((Component) evt.getSource()).isDisplayable()) { // now displayable
          startTCRegistryListening();
        } else { // not displayable
          stopTCRegistryListening();
        }
      }
    }