private Component getCustomEditor() { if (customEditor == null) { customEditor = getPropertyEditor().getCustomEditor(); } return customEditor; }
public Object getEnteredValue() { PropertyEditor editor = getPropertyEditor(); Object result; if (customEditor instanceof EnhancedCustomPropertyEditor) { result = ((EnhancedCustomPropertyEditor) customEditor ).getPropertyValue(); } else { result = editor.getValue(); //editor.getAsText(); //XXX getValue? } return result; }
public Object getEnteredValue() { PropertyEditor editor = getPropertyEditor(); Object result; if (editor instanceof EnhancedCustomPropertyEditor) { result = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); } else { result = editor.getValue();//editor.getAsText(); //XXX getValue? } return result; }
private Component getCustomEditor() { if (customEditor == null) { customEditor = getPropertyEditor().getCustomEditor(); } return customEditor; }
private Component getCustomEditor() { if (customEditor == null) { customEditor = getPropertyEditor().getCustomEditor(); } return customEditor; }
public Object getEnteredValue() { PropertyEditor editor = getPropertyEditor(); Object result; if (editor instanceof EnhancedCustomPropertyEditor) { result = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); } else { result = editor.getValue();//editor.getAsText(); //XXX getValue? } return result; }
public void setEnteredValue(Object o) { PropUtils.updatePropertyEditor(getPropertyEditor(), o); }
public boolean isValueModified() { PropertyEditor editor = getPropertyEditor(); boolean result = editor.getValue() != originalValue; if (!result && editor instanceof EnhancedCustomPropertyEditor) { Object entered = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); if (entered != null) { result = entered.equals(originalValue); } else { result = originalValue == null; } } return result; }
public boolean isValueModified() { PropertyEditor editor = getPropertyEditor(); boolean result = editor.getValue() != originalValue; if (!result && editor instanceof EnhancedCustomPropertyEditor) { Object entered = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); if (entered != null) { result = entered.equals(originalValue); } else { result = originalValue == null; } } return result; }
public boolean isValueModified() { PropertyEditor editor = getPropertyEditor(); boolean result = editor.getValue() != originalValue; if (!result && editor instanceof EnhancedCustomPropertyEditor) { Object entered = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); if (entered != null) { result = entered.equals(originalValue); } else { result = originalValue == null; } } return result; }
public void setEnteredValue(Object o) { PropUtils.updatePropertyEditor(getPropertyEditor(), o); }
public void setEnteredValue(Object o) { PropUtils.updatePropertyEditor(getPropertyEditor(), o); }
public void reset() { try { originalValue = getProperty().getValue(); getPropertyEditor().setValue(originalValue); } catch (Exception e) { //should not happen - the value came from the property Logger.getLogger(CustomEditorDisplayer.class.getName()).log(Level.WARNING, null, e); } }
/** Internal implementation of getPropertyEditor(). */ private PropertyEditor propertyEditor() { PropertyEditor result = null; if (displayer != null) { //Use the package private methods to fetch the same editor //being used by the displayer, so the state will be appropriate if (displayer instanceof CustomEditorDisplayer) { result = ((CustomEditorDisplayer) displayer).getPropertyEditor(); } else if (displayer instanceof EditablePropertyDisplayer) { result = ((EditablePropertyDisplayer) displayer).getPropertyEditor(); } } if (result == null) { //Fetch the property editor using the utility method (which will //handle no-property editor and multiple selection states //appropriately) result = PropUtils.getPropertyEditor(getProperty()); } return result; }
/** Internal implementation of getPropertyEditor(). */ private PropertyEditor propertyEditor() { PropertyEditor result = null; if (displayer != null) { //Use the package private methods to fetch the same editor //being used by the displayer, so the state will be appropriate if (displayer instanceof CustomEditorDisplayer) { result = ((CustomEditorDisplayer) displayer).getPropertyEditor(); } else if (displayer instanceof EditablePropertyDisplayer) { result = ((EditablePropertyDisplayer) displayer).getPropertyEditor(); } } if (result == null) { //Fetch the property editor using the utility method (which will //handle no-property editor and multiple selection states //appropriately) result = PropUtils.getPropertyEditor(getProperty()); } return result; }
/** Internal implementation of getPropertyEditor(). */ private PropertyEditor propertyEditor() { PropertyEditor result = null; if (displayer != null) { //Use the package private methods to fetch the same editor //being used by the displayer, so the state will be appropriate if (displayer instanceof CustomEditorDisplayer) { result = ((CustomEditorDisplayer) displayer).getPropertyEditor(); } else if (displayer instanceof EditablePropertyDisplayer) { result = ((EditablePropertyDisplayer) displayer).getPropertyEditor(); } } if (result == null) { //Fetch the property editor using the utility method (which will //handle no-property editor and multiple selection states //appropriately) result = PropUtils.getPropertyEditor(getProperty()); } return result; }
public void reset() { try { originalValue = getProperty().getValue(); getPropertyEditor().setValue(originalValue); } catch (Exception e) { //should not happen - the value came from the property ErrorManager.getDefault().notify(ErrorManager.WARNING, e); } }
public void reset() { try { originalValue = getProperty().getValue(); getPropertyEditor().setValue(originalValue); } catch (Exception e) { //should not happen - the value came from the property ErrorManager.getDefault().notify(ErrorManager.WARNING, e); } }
public String isModifiedValueLegal() { boolean legal=true; String msg=null; PropertyEditor editor = getPropertyEditor();
public String isModifiedValueLegal() { boolean legal = true; String msg = null; PropertyEditor editor = getPropertyEditor(); // System.err.println("IS MODIFIED VALUE LEGAL"); if (env != null) { legal = env.getState() != env.STATE_INVALID; System.err.println(" Attempting to validate env"); if (legal && env.STATE_NEEDS_VALIDATION.equals(env.getState())) { msg = env.silentlySetState(env.STATE_VALID, getEnteredValue()); // System.err.println(" silentlySetState returned: " + msg); legal = msg == null; } } else if (editor instanceof EnhancedCustomPropertyEditor) { Object entered = ((EnhancedCustomPropertyEditor) editor).getPropertyValue(); try { editor.setValue(entered); } catch (IllegalStateException ise) { legal = false; msg = PropUtils.findLocalizedMessage(ise, entered, getProperty().getDisplayName()); } } if (!legal && (msg == null)) { // System.err.println(" not legal, constructing message"); msg = NbBundle.getMessage( CustomEditorDisplayer.class, "FMT_CannotUpdateProperty",editor.getValue(), getProperty().getDisplayName()); //NOI18N } return msg; }