/** Allow setting of state without triggering a dialog. */ String silentlySetState(Object newState, Object newValue) { if (getState().equals(newState)) { // no change, no fire vetoable and property change return null; } try { getSupport().fireVetoableChange(PROP_STATE, getState(), newState); state = newState; // always notify state change getChange().firePropertyChange(PROP_STATE, null, newState); } catch (PropertyVetoException pve) { // and notify the user that the change cannot happen LOG.log(Level.INFO, "Cannot change property: " + pve.getPropertyChangeEvent().getPropertyName(), pve); String name = (getFeatureDescriptor() == null) ? null : getFeatureDescriptor().getDisplayName(); return PropUtils.findLocalizedMessage(pve, newValue, name); } return null; }
/** Allow setting of state without triggering a dialog. */ String silentlySetState (Object newState, Object newValue) { if (getState ().equals (newState)) // no change, no fire vetoable and property change return null; try { getSupport().fireVetoableChange(PROP_STATE, getState (), newState); state = newState; // always notify state change getChange ().firePropertyChange (PROP_STATE, null, newState); } catch (PropertyVetoException pve) { // and notify the user that the change cannot happen pve.printStackTrace(); String name = getFeatureDescriptor() == null ? null : getFeatureDescriptor().getDisplayName(); return PropUtils.findLocalizedMessage (pve, newValue, name); } return null; }
} catch (IllegalStateException ise) { legal = false; msg = PropUtils.findLocalizedMessage(ise, entered, getProperty().getDisplayName());
/** Allow setting of state without triggering a dialog. */ String silentlySetState (Object newState, Object newValue) { if (getState ().equals (newState)) // no change, no fire vetoable and property change return null; try { getSupport().fireVetoableChange(PROP_STATE, getState (), newState); state = newState; // always notify state change getChange ().firePropertyChange (PROP_STATE, null, newState); } catch (PropertyVetoException pve) { // and notify the user that the change cannot happen pve.printStackTrace(); String name = getFeatureDescriptor() == null ? null : getFeatureDescriptor().getDisplayName(); return PropUtils.findLocalizedMessage (pve, newValue, name); } return null; }
} catch (IllegalStateException ise) { legal = false; msg = PropUtils.findLocalizedMessage(ise, entered, getProperty().getDisplayName());
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; }
PropUtils.findLocalizedMessage(exception, entered, getProperty().getDisplayName()));
result = PropUtils.findLocalizedMessage(exception, getEnteredValue(), getProperty().getDisplayName()); } else if (PropertyEnv.STATE_INVALID.equals(envState)) {
ErrorManager.getDefault().annotate( iae, ErrorManager.USER, null, PropUtils.findLocalizedMessage(exception, entered, getProperty().getDisplayName()), exception, null);
ErrorManager.getDefault().annotate( iae, ErrorManager.USER, null, PropUtils.findLocalizedMessage(exception, entered, getProperty().getDisplayName()), exception, null);
result = PropUtils.findLocalizedMessage(exception, getEnteredValue(), getProperty().getDisplayName());
result = PropUtils.findLocalizedMessage(exception, getEnteredValue(), getProperty().getDisplayName());
ErrorManager.getDefault().annotate( iae, ErrorManager.USER, null, PropUtils.findLocalizedMessage(exception, entered, getProperty().getDisplayName()), exception, null);
ErrorManager.getDefault().annotate( iae, ErrorManager.USER, null, PropUtils.findLocalizedMessage(exception, entered, getProperty().getDisplayName()), exception, null);
String msg =PropUtils.findLocalizedMessage(e, getEnteredValue(), getProperty().getDisplayName());
String msg = PropUtils.findLocalizedMessage(e, getEnteredValue(), getProperty().getDisplayName());
String msg =PropUtils.findLocalizedMessage(e, getEnteredValue(), getProperty().getDisplayName());