/** Disposes current preview {@link #commands}. */ @Override public void dispose() { super.dispose(); tree.getModel().removeTreeModelListener(treeModelListener); if (!commands.isDisposed()) { EditorFactory.getInstance().releaseEditor(commands); } } }
@Override public void removeTreeModelListener(TreeModelListener l) { treeModelListeners.remove(l); delegateModel.removeTreeModelListener(l); }
@Override public void removeTreeModelListener(TreeModelListener l) { delegateModel.removeTreeModelListener(l); treeModelListeners.remove(l); } }
@Override public void removeTreeModelListener(TreeModelListener l) { delegateModel.removeTreeModelListener(l); treeModelListeners.remove(l); } }
/** * Remove a structure changes listener from the object tree. * * @param lis The <TT>TreeModelListener</TT> you want removed. * * @throws IllegalArgumentException * Thrown if <TT>null</TT> <TT>TreeModelListener</TT> passed. */ public void removeTreeModelListener(TreeModelListener lis) { if (lis == null) { throw new IllegalArgumentException("TreeModelListener == null"); } _tree.getModel().removeTreeModelListener(lis); }
/** * Remove a structure changes listener from the object tree. * * @param lis The <TT>TreeModelListener</TT> you want removed. * * @throws IllegalArgumentException * Thrown if <TT>null</TT> <TT>TreeModelListener</TT> passed. */ public void removeTreeModelListener(TreeModelListener lis) { if (lis == null) { throw new IllegalArgumentException("TreeModelListener == null"); } _tree.getModel().removeTreeModelListener(lis); }
@Override public void uninstallListeners() { super.uninstallListeners(); if (_component instanceof JTree) { if (((JTree) _component).getModel() != null) { ((JTree) _component).getModel().removeTreeModelListener(this); } } _component.removePropertyChangeListener(JTree.TREE_MODEL_PROPERTY, this); }
public void propertyChange(PropertyChangeEvent evt) { if (JTree.TREE_MODEL_PROPERTY.equals(evt.getPropertyName())) { hidePopup(); if (evt.getOldValue() instanceof TreeModel) { ((TreeModel) evt.getOldValue()).removeTreeModelListener(this); } if (evt.getNewValue() instanceof TreeModel) { ((TreeModel) evt.getNewValue()).addTreeModelListener(this); } resetTreePathes(); } } }
public void setModel(TreeModel model) { if (_model != model) { clearSelection(); if (_model != null) { _model.removeTreeModelListener(this); } _model = model; if (_model != null) { _model.addTreeModelListener(this); } } }
public void setModel(TreeModel m) { TreeModel oldVal = this.model; if (model != null && treeModelListener != null) model.removeTreeModelListener(treeModelListener); model = m; treeState.setModel(m); if (model != null) { if (treeModelListener == null) treeModelListener = createTreeModelListener(); if (treeModelListener != null) model.addTreeModelListener(treeModelListener); // Mark the root as expanded, if it isn't a leaf. if (!model.isLeaf(model.getRoot())) treeState.setExpandedState(new TreePath(model.getRoot()), true); fireViewportChanged(false); reload(); } propertyChangeSupport.firePropertyChange("model", oldVal, this.model); }
/** * Checks whether the model has been changed, and if so unregister and register listeners. */ private void checkModel() { // find out whether the model object (the TreeModel) has been changed TreeModel model = getModelObject(); if (model != previousModel) { if (previousModel != null) { previousModel.removeTreeModelListener(this); } previousModel = model; if (model != null) { model.addTreeModelListener(this); } // model has been changed, redraw whole tree invalidateAll(); } }
/** * Checks whether the model has been changed, and if so unregister and register listeners. */ private void checkModel() { // find out whether the model object (the TreeModel) has been changed TreeModel model = getModelObject(); if (model != previousModel) { if (previousModel != null) { previousModel.removeTreeModelListener(this); } previousModel = model; if (model != null) { model.addTreeModelListener(this); } // model has been changed, redraw whole tree invalidateAll(); } }
/** * Checks whether the model has been changed, and if so unregister and register listeners. */ private final void checkModel() { // find out whether the model object (the TreeModel) has been changed TreeModel model = (TreeModel)getModelObject(); if (model != previousModel) { if (previousModel != null) { previousModel.removeTreeModelListener(this); } previousModel = model; if (model != null) { model.addTreeModelListener(this); } // model has been changed, redraw whole tree invalidateAll(); } }
private void detach() { KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener(this); if (tree != null) { tree.getSelectionModel().removeTreeSelectionListener(this); tree.getModel().removeTreeModelListener(this); tree.removeHierarchyBoundsListener(this); tree.removeHierarchyListener(this); tree.removeComponentListener(this); } else { list.getSelectionModel().removeListSelectionListener(this); list.getModel().removeListDataListener(this); list.removeHierarchyBoundsListener(this); list.removeHierarchyListener(this); list.removeComponentListener(this); } pane.getHorizontalScrollBar().getModel().removeChangeListener(this); pane.getVerticalScrollBar().getModel().removeChangeListener(this); detached = true; }
private void detach() { KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener(this); if (tree != null) { tree.getSelectionModel().removeTreeSelectionListener(this); tree.getModel().removeTreeModelListener(this); tree.removeHierarchyBoundsListener(this); tree.removeHierarchyListener(this); tree.removeComponentListener(this); } else { list.getSelectionModel().removeListSelectionListener(this); list.getModel().removeListDataListener(this); list.removeHierarchyBoundsListener(this); list.removeHierarchyListener(this); list.removeComponentListener(this); } if(null!=pane.getHorizontalScrollBar()) { pane.getHorizontalScrollBar().getModel().removeChangeListener(this); } if(null!=pane.getVerticalScrollBar()) { pane.getVerticalScrollBar().getModel().removeChangeListener(this); } detached = true; }