protected void prepareForEditing() { super.prepareForEditing(); if (editingComponent instanceof javax.swing.JTextField) ((javax.swing.JTextField) editingComponent).selectAll(); } });
@Override public boolean isCellEditable(EventObject e) { return delegate.isCellEditable(e); }
public Component getTreeCellEditorComponent( JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) { if (value instanceof MondrianGuiDef.RelationOrJoin) { String valueClass = value.getClass().getName(); String simpleName[] = valueClass.split("[$.]", 0); return super.getTreeCellEditorComponent( tree, simpleName[simpleName.length - 1], isSelected, expanded, leaf, row); } else { return null; } }
public boolean stopCellEditing() { boolean retValue; setValueAt(super.tree); retValue = super.stopCellEditing(); return retValue; } }
@Override protected void startEditingTimer() { tree.addMouseMotionListener(this); super.startEditingTimer(); }
/** Overrides superclass method. If the source is a <code>JTextField</code>, * i.e. cell editor, it cancels editing, otherwise it calls superclass method. */ @Override public void actionPerformed(ActionEvent evt) { if (evt.getSource() instanceof JTextField) { cancelled = true; cancelCellEditing(); } else { super.actionPerformed(evt); } }
protected void setTree (JTree newTree) { if (newTree != tree && timer != null && timer.isRunning ()) { tree.removeMouseMotionListener (this); } super.setTree (newTree); }
@Override public boolean stopCellEditing() { if (fileAlreadyExists()) { return false; } return delegate.stopCellEditing(); }
protected void startEditingTimer () { tree.addMouseMotionListener (this); super.startEditingTimer (); }
/** Overrides superclass method. If the source is a <code>JTextField</code>, * i.e. cell editor, it cancels editing, otherwise it calls superclass method. */ public void actionPerformed(ActionEvent evt) { if(evt.getSource() instanceof JTextField) { cancelled = true; cancelCellEditing(); } else { super.actionPerformed(evt); } }
protected void setTree (JTree newTree) { if (newTree != tree && timer != null && timer.isRunning ()) { tree.removeMouseMotionListener (this); } super.setTree (newTree); }
@Override protected void prepareForEditing() { super.prepareForEditing(); applyComponentOrientation(); }
@Override public boolean isCellEditable(final EventObject event) { // check if chosen node is not the root node final Object node = tree.getLastSelectedPathComponent(); return super.isCellEditable(event) && node instanceof TreeNode && ((TreeNode) node).getParent().getParent() != null; } }
/** * {@inheritDoc} */ @Override public Component getTreeCellEditorComponent( JTree aTree, Object aValue, boolean aIsSelected, boolean aExpanded, boolean aLeaf, int aRow ) { ElementTreeNode treeNode = ( ElementTreeNode )aValue; return super.getTreeCellEditorComponent( aTree, treeNode.getText(), aIsSelected, aExpanded, aLeaf, aRow ); } }
public boolean stopCellEditing() if (super.stopCellEditing())
protected void startEditingTimer () { tree.addMouseMotionListener (this); super.startEditingTimer (); }
/** Overrides superclass method. If the source is a <code>JTextField</code>, * i.e. cell editor, it cancels editing, otherwise it calls superclass method. */ public void actionPerformed(ActionEvent evt) { if(evt.getSource() instanceof JTextField) { cancelled = true; cancelCellEditing(); } else { super.actionPerformed(evt); } }
@Override protected void setTree(JTree newTree) { if ((newTree != tree) && (timer != null) && timer.isRunning()) { tree.removeMouseMotionListener(this); } if (newTree != tree) { if (tree != null) { tree.removeMouseListener(this); tree.removeFocusListener(this); } if (newTree != null) { newTree.addMouseListener(this); newTree.addFocusListener(this); } } super.setTree(newTree); }
@Override protected void prepareForEditing() { super.prepareForEditing(); applyComponentOrientation(); }
public boolean isCellEditable(EventObject event) { if ((event != null) && (event instanceof MouseEvent)) { if (!SwingUtilities.isLeftMouseButton((MouseEvent)event) || ((MouseEvent)event).isPopupTrigger()) { return false; } } if (lastPath != null) { Node n = Visualizer.findNode (lastPath.getLastPathComponent()); if (n == null || !n.canRename ()) { return false; } } else { // Disallow rename when multiple nodes are selected return false; } // disallow editing if we are in DnD operation if (dndActive) { return false; } return super.isCellEditable(event); }