public boolean isCellEditable(int rowIndex, int columnIndex) { //if column is 0, it's the property name - can't edit that if (columnIndex == 0) return false; if (columnIndex == 1) { FeatureDescriptor fd = model.getFeatureDescriptor(rowIndex); //no worries, editCellAt() will expand it and return before //this method is called if (fd instanceof PropertySet) return false; return ((Property) fd).canWrite(); } throw new IllegalArgumentException("Illegal row/column: " + Integer.toString(rowIndex) + Integer.toString(columnIndex)); //NOI18N }
public boolean isCellEditable(int rowIndex, int columnIndex) { //if column is 0, it's the property name - can't edit that if (columnIndex == 0) return false; if (columnIndex == 1) { FeatureDescriptor fd = model.getFeatureDescriptor(rowIndex); //no worries, editCellAt() will expand it and return before //this method is called if (fd instanceof PropertySet) return false; return ((Property) fd).canWrite(); } throw new IllegalArgumentException("Illegal row/column: " + Integer.toString(rowIndex) + Integer.toString(columnIndex)); //NOI18N }
@Override public boolean isCellEditable(Object node, int column) { Node n = Visualizer.findNode(node); if (n == null) { throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + node + " of class " + node.getClass().getName()); } Node.Property theRealProperty = getPropertyFor(n, prop[column]); if (theRealProperty != null) { return theRealProperty.canWrite(); } else { return false; } }
@Override @SuppressWarnings("unchecked") public boolean editCellAt(int row, int column, EventObject e) { Object o = getValueAt(row, column); if (o instanceof Node.Property) { // && (e == null || e instanceof KeyEvent)) { //Toggle booleans without instantiating an editor Node.Property p = (Node.Property)o; if (!p.canWrite()) { return false; } if (p.getValueType() == Boolean.class || p.getValueType() == Boolean.TYPE) { PropertiesRowModel.toggleBooleanProperty(p); Rectangle r = getCellRect(row, column, true); repaint (r.x, r.y, r.width, r.height); return false; } } return super.editCellAt(row, column, e); }
protected void prepareComponent (InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
public boolean canWrite() { return original.canWrite(); }
@Override public boolean isCellEditable(int row, int column) { if (column == 0) { return true; } Object o = getValueAt(row, column); if (o == null) { return false; } if (o instanceof Node.Property) { return ((Node.Property) o).canWrite(); } return false; }
final void readEnv (FeatureDescriptor d) { if (d instanceof Node.Property) { editable = ((Node.Property)d).canWrite(); } else if (d instanceof PropertyDescriptor) { editable = ((PropertyDescriptor)d).getWriteMethod() != null; } else { editable = true; } Object v = d.getValue ("item.separator"); // NOI18N if (v instanceof String) { separator = (String)v; } } }
public boolean canWrite() { return del.canWrite (); }
/** Test whether the property is writable.Calls all delegates. * If any of them returns false returns false, otherwise return true. */ public boolean canWrite() { for (int i = 0; i < original.length; i++) { if (!original[i].canWrite()) { return false; } } return true; }
public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Component result = super.prepareRenderer(renderer, row, col); if (row < 0 || row >= getRowCount()) { return result; } Object value = getValueAt(row, col); if (result != null && value instanceof Property && col == 1) { result.setEnabled (((Property) value).canWrite()); } return result; }
public boolean isCellEditable(int row, int column) { if (column == 0) return true; Object o = getValueAt (row, column); if (o == null) { return false; } if (o instanceof Node.Property) { return ((Node.Property) o).canWrite(); } return false; }
/** Test whether the property is writable.Calls all delegates. * If any of them returns false returns false, otherwise return true. */ public boolean canWrite() { for (int i = 0; i < original.length; i++) { if (!original[i].canWrite()) { return false; } } return true; }
public boolean isCellEditable(int row, int column) { if (column == 0) return true; Object o = getValueAt (row, column); if (o == null) { return false; } if (o instanceof Node.Property) { return ((Node.Property) o).canWrite(); } return false; }
public boolean isEditable () { boolean result; if (mdl.getProperty() != null) { result = mdl.getProperty().canWrite(); } else { result = true; } return result; }
public boolean isEditable () { boolean result; if (mdl.getProperty() != null) { result = mdl.getProperty().canWrite(); } else { result = true; } return result; }
public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Component result = super.prepareRenderer(renderer, row, col); if (row < 0 || row >= getRowCount()) { return result; } Object value = getValueAt(row, col); if (result != null && value instanceof Property && col == 1) { result.setEnabled (((Property) value).canWrite()); } return result; }
/** Test whether the property is writable.Calls all delegates. * If any of them returns false returns false, otherwise return true. */ public boolean canWrite() { for (int i = 0; i < original.length; i++) { if (!original[i].canWrite()) { return false; } } return true; }
public boolean isEditable() { boolean result; if (mdl.getProperty() != null) { result = mdl.getProperty().canWrite(); } else { result = true; } return result; }
@Override public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Component result = super.prepareRenderer(renderer, row, col); if ((row < 0) || (row >= getRowCount())) { return result; } Object value = getValueAt(row, col); if ((result != null) && value instanceof Property && (col == 1)) { result.setEnabled(((Property) value).canWrite()); } return result; }