/** * Vetoable change listener: listenning here you will be notified * when the state of the environment is being changed (when the setState * method is being called). You can veto the change and provide * a displayable information in the thrown exception. Use * the ErrorManager annotaion feature for the your exception to modify * the message and severity. */ public void addVetoableChangeListener(VetoableChangeListener l) { getSupport().addVetoableChangeListener(l); }
/** * Vetoable change listener: listenning here you will be notified * when the state of the environment is being changed (when the setState * method is being called). You can veto the change and provide * a displayable information in the thrown exception. Use * the ErrorManager annotaion feature for the your exception to modify * the message and severity. */ public void addVetoableChangeListener(VetoableChangeListener l) { getSupport().addVetoableChangeListener(l); }
/** * Vetoable change listener removal. */ public void removeVetoableChangeListener(VetoableChangeListener l) { getSupport().removeVetoableChangeListener(l); }
/** * Vetoable change listener: listenning here you will be notified * when the state of the environment is being changed (when the setState * method is being called). You can veto the change and provide * a displayable information in the thrown exception. Use * the ErrorManager annotaion feature for the your exception to modify * the message and severity. */ public void addVetoableChangeListener(VetoableChangeListener l) { getSupport().addVetoableChangeListener(l); }
/** * Vetoable change listener removal. */ public void removeVetoableChangeListener(VetoableChangeListener l) { getSupport().removeVetoableChangeListener(l); }
/** * Vetoable change listener removal. */ public void removeVetoableChangeListener(VetoableChangeListener l) { getSupport().removeVetoableChangeListener(l); }
/** * A setter that should be used by the property editor * to change the state of the environment. * Even the state property is bound, changes made from the editor itself * are allowed without restrictions. */ public void setState (Object newState) { if (getState ().equals (newState)) // no change, no fire vetoable and property change return ; 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 PropertyDialogManager.notify(pve); } }
/** * A setter that should be used by the property editor * to change the state of the environment. * Even the state property is bound, changes made from the editor itself * are allowed without restrictions. */ public void setState (Object newState) { if (getState ().equals (newState)) // no change, no fire vetoable and property change return ; 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 PropertyDialogManager.notify(pve); } }
/** 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; }
/** 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; }
/** * A setter that should be used by the property editor * to change the state of the environment. * Even the state property is bound, changes made from the editor itself * are allowed without restrictions. */ public void setState(Object newState) { if (getState().equals(newState)) { // no change, no fire vetoable and property change return; } 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 String msg = Exceptions.findLocalizedMessage(pve); if (msg == null) { msg = pve.getLocalizedMessage(); } if (msg != null) { DialogDisplayer.getDefault().notify( new NotifyDescriptor.Message(msg, NotifyDescriptor.WARNING_MESSAGE)); } else { // no message for the user, log the exception the standard way PropertyDialogManager.notify(pve); } } }