public PropertyEditor getPropertyEditor() { if (propertyEditorClass != null) { try { return propertyEditorClass.newInstance(); } catch (InstantiationException ex) { Exceptions.printStackTrace(ex); } catch (IllegalAccessException iex) { Exceptions.printStackTrace(iex); } } return super.getPropertyEditor(); }
/** Implements <code>PropertyModel</code> interface. */ public Class getPropertyEditorClass() { Object ed = prop.getPropertyEditor(); if (ed != null) { return ed.getClass(); } return null; }
/** Implements <code>PropertyModel</code> interface. */ public Class getPropertyEditorClass() { Object ed = prop.getPropertyEditor(); if (ed != null) { return ed.getClass(); } return null; }
detailsButton.setVisible( (prop != null) && (prop.getPropertyEditor() != null) && (prop.getPropertyEditor().supportsCustomEditor()) ); if (detailsButton.isVisible()) {
detailsButton.setVisible( (prop != null) && (prop.getPropertyEditor() != null) && (prop.getPropertyEditor().supportsCustomEditor()) ); if (detailsButton.isVisible()) {
private void updateButtonState() { // refresh the lookup selectedLookup.lookup(Object.class); if (showingDetails) { detailsButton.setText(NbBundle.getMessage(IndexedEditorPanel.class, "CTL_HideDetails")); } else { detailsButton.setText(NbBundle.getMessage(IndexedEditorPanel.class, "CTL_ShowDetails")); } upButton.setEnabled((moveUp != null) && (moveUp.isEnabled())); downButton.setEnabled((moveDown != null) && (moveDown.isEnabled())); Node[] sn = getExplorerManager().getSelectedNodes(); deleteButton.setEnabled((sn != null) && (sn.length == 1) && (sn[0] != rootNode)); detailsButton.setVisible( (prop != null) && (prop.getPropertyEditor() != null) && (prop.getPropertyEditor().supportsCustomEditor()) ); if (detailsButton.isVisible()) { if (showingDetails) { Mnemonics.setLocalizedText(detailsButton, NbBundle.getMessage(IndexedEditorPanel.class, "CTL_HideDetails")); detailsButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(IndexedEditorPanel.class, "ACSD_HideDetails") ); } else { Mnemonics.setLocalizedText(detailsButton, NbBundle.getMessage(IndexedEditorPanel.class, "CTL_ShowDetails")); detailsButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(IndexedEditorPanel.class, "ACSD_ShowDetails") ); } detailsButton.setEnabled((sn != null) && (sn.length == 1) && (sn[0] != rootNode)); } }
private PropertyEditor getPropertyEditor() { PropertyEditor result = null; if (editor != null) { result = (PropertyEditor)editor.get(); } if (result == null) { Property prop = getProperty(); if (prop != null) { result = prop.getPropertyEditor(); editor = new WeakReference(result); } } if (result == null) { PropertyModel mdl = getModel(); if (mdl != null) { Property p = ModelProperty.toProperty(mdl); result = p.getPropertyEditor(); editor = new WeakReference(result); } } return result; }
private PropertyEditor getPropertyEditor() { PropertyEditor result = null; if (editor != null) { result = (PropertyEditor)editor.get(); } if (result == null) { Property prop = getProperty(); if (prop != null) { result = prop.getPropertyEditor(); editor = new WeakReference(result); } } if (result == null) { PropertyModel mdl = getModel(); if (mdl != null) { Property p = ModelProperty.toProperty(mdl); result = p.getPropertyEditor(); editor = new WeakReference(result); } } return result; }
private JComponent getNumberRenderer(Property<?> property, Node n, boolean hasFocus) throws IllegalAccessException, InvocationTargetException { Object value = property.getValue(); PropertyEditor propEd = property.getPropertyEditor(); if (propEd != null) { try { propEd.setValue(value); value = propEd.getAsText(); } catch (Exception ex) { // no problem here - just leave null tooltip } } JLabel result = new JLabel(value+ "", SwingConstants.RIGHT); if (hasFocus){ result.setBorder(new LineBorder(UIManager.getColor("Tree.selectionBorderColor"), 1));//NOI18N, } return result; }
public PropertyEditor getPropertyEditor() { if (mdl.getPropertyEditorClass() != null) { try { //System.err.println("ModelProperty creating a " //+ mdl.getPropertyEditorClass()); Constructor c = mdl.getPropertyEditorClass().getConstructor(null); c.setAccessible(true); return (PropertyEditor) c.newInstance(new Object[0]); } catch (Exception e) { ErrorManager.getDefault().notify(e); return new PropUtils.NoPropertyEditorEditor(); } } return super.getPropertyEditor(); }
public PropertyEditor getPropertyEditor() { if (mdl.getPropertyEditorClass() != null) { try { //System.err.println("ModelProperty creating a " //+ mdl.getPropertyEditorClass()); Constructor c = mdl.getPropertyEditorClass().getConstructor(null); c.setAccessible(true); return (PropertyEditor) c.newInstance(new Object[0]); } catch (Exception e) { ErrorManager.getDefault().notify(e); return new PropUtils.NoPropertyEditorEditor(); } } return super.getPropertyEditor(); }
public PropertyEditor getPropertyEditor() { return del.getPropertyEditor(); }
public PropertyEditor getPropertyEditor() { if (mdl.getPropertyEditorClass() != null) { try { //System.err.println("ModelProperty creating a " //+ mdl.getPropertyEditorClass()); Constructor c = mdl.getPropertyEditorClass().getConstructor(); c.setAccessible(true); return (PropertyEditor) c.newInstance(new Object[0]); } catch (Exception e) { Exceptions.printStackTrace(e); return new PropUtils.NoPropertyEditorEditor(); } } return super.getPropertyEditor(); }
@Override public PropertyEditor getPropertyEditor() { return original.getPropertyEditor(); }
/** Implements <code>PropertyModel</code> interface. */ public Class getPropertyEditorClass() { Object ed = prop.getPropertyEditor(); if (ed != null) { return ed.getClass(); } return null; }
public PropertyEditor getPropertyEditor () { if (propertyEditorClass != null) try { return (PropertyEditor) propertyEditorClass.newInstance (); } catch (InstantiationException ex) { ErrorManager.getDefault().notify(ex); } catch (IllegalAccessException iex) { ErrorManager.getDefault().notify(iex); } return super.getPropertyEditor (); }
/** * @returns property editor from the first delegate */ public java.beans.PropertyEditor getPropertyEditor () { return original[0].getPropertyEditor(); }
public PropertyEditor getPropertyEditor () { if (propertyEditorClass != null) try { return (PropertyEditor) propertyEditorClass.newInstance (); } catch (InstantiationException ex) { ErrorManager.getDefault().notify(ex); } catch (IllegalAccessException iex) { ErrorManager.getDefault().notify(iex); } return super.getPropertyEditor (); }
/** * @returns property editor from the first delegate */ public java.beans.PropertyEditor getPropertyEditor() { return original[0].getPropertyEditor(); }
/** * @returns property editor from the first delegate */ public java.beans.PropertyEditor getPropertyEditor () { return original[0].getPropertyEditor(); }