/** * Writes the edited value to the property. * @return <code>true</code> when the value was successfully written, <code>false</code> otherwise. */ private boolean commit() { if (displayer instanceof PropertyDisplayer_Editable) { try { return ((PropertyDisplayer_Editable) displayer).commit(); } catch (IllegalArgumentException iae) { PropertyDialogManager.notify(iae); return false; } } else { return false; } }
public boolean commit() throws IllegalArgumentException { boolean result; try { result =_commit(); } catch (IllegalArgumentException iae) { result = false; if (getUpdatePolicy() != UPDATE_ON_EXPLICIT_REQUEST) { PropertyDialogManager.notify(iae); } else { throw iae; } } return result; }
public boolean commit() throws IllegalArgumentException { boolean result; try { result = _commit(); } catch (IllegalArgumentException iae) { result = false; if (getUpdatePolicy() != UPDATE_ON_EXPLICIT_REQUEST) { PropertyDialogManager.notify(iae); } else { throw iae; } } return result; }
private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newButtonActionPerformed try { getExplorerManager().setSelectedNodes(new Node[] { rootNode }); } catch (PropertyVetoException pve) { // this should be always possible --> if not, notify problem PropertyDialogManager.notify(pve); } if ((newAction != null) && (newAction.isEnabled())) { newAction.actionPerformed(evt); } }//GEN-LAST:event_newButtonActionPerformed
private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newButtonActionPerformed try { getExplorerManager().setSelectedNodes(new Node[] { rootNode }); } catch (PropertyVetoException pve) { // this should be always possible --> if not, notify problem PropertyDialogManager.notify(pve); } if ((newAction != null) && (newAction.isEnabled())) { newAction.actionPerformed(evt); } } //GEN-LAST:event_newButtonActionPerformed
public boolean commit() throws IllegalArgumentException { boolean result; try { result =_commit(); } catch (IllegalArgumentException iae) { result = false; if (getUpdatePolicy() != UPDATE_ON_EXPLICIT_REQUEST) { PropertyDialogManager.notify(iae); } else { throw iae; } } return result; }
private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newButtonActionPerformed try { getExplorerManager().setSelectedNodes(new Node[] { rootNode }); } catch (PropertyVetoException pve) { // this should be always possible --> if not, notify problem PropertyDialogManager.notify(pve); } if ((newAction != null) && (newAction.isEnabled())) { newAction.actionPerformed(evt); } }//GEN-LAST:event_newButtonActionPerformed
/** * 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); } }
/** If the editor is <link>ExPropertyEditor</link> it tries to change the * <code>getState</code> property to <code>PropertyEnv.STATE_VALID</code> * state. This may be vetoed, in such case a warning is presented to the user * and the <code>getState</code> will still return the original value * (different from STATE_VALID). * <P> * Also updates the value if * <code>org.openide.explorer.propertysheet.editors.EnhancedCustomPropertyEditor</code> * is used. */ public void updateValue() { if (displayer != null && displayer instanceof PropertyDisplayer_Editable) { PropertyEnv env = ((PropertyDisplayer_Editable) displayer).getPropertyEnv(); if (PropertyEnv.STATE_NEEDS_VALIDATION.equals(env.getState())) { env.setState(PropertyEnv.STATE_VALID); } if (!changeImmediate) { try { ((PropertyDisplayer_Editable) displayer).commit(); } catch (IllegalArgumentException iae) { PropertyDialogManager.notify(iae); } } } }
/** If the editor is <link>ExPropertyEditor</link> it tries to change the * <code>getState</code> property to <code>PropertyEnv.STATE_VALID</code> * state. This may be vetoed, in such case a warning is presented to the user * and the <code>getState</code> will still return the original value * (different from STATE_VALID). * <P> * Also updates the value if * <code>org.openide.explorer.propertysheet.editors.EnhancedCustomPropertyEditor</code> * is used. */ public void updateValue() { if (displayer != null && displayer instanceof PropertyDisplayer_Editable) { PropertyEnv env = ((PropertyDisplayer_Editable) displayer).getPropertyEnv(); if (PropertyEnv.STATE_NEEDS_VALIDATION.equals(env.getState())) { env.setState(PropertyEnv.STATE_VALID); } if (!changeImmediate) { try { ((PropertyDisplayer_Editable) displayer).commit(); } catch (IllegalArgumentException iae) { PropertyDialogManager.notify(iae); } } } }
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed Node[] sn = getExplorerManager().getSelectedNodes(); if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) { return; } try { sn[0].destroy(); } catch (java.io.IOException ioe) { PropertyDialogManager.notify(ioe); } rootNode = getExplorerManager().getRootContext(); }//GEN-LAST:event_deleteButtonActionPerformed
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed Node[] sn = getExplorerManager().getSelectedNodes(); if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) { return; } try { sn[0].destroy(); } catch (java.io.IOException ioe) { PropertyDialogManager.notify(ioe); } rootNode = getExplorerManager().getRootContext(); } //GEN-LAST:event_deleteButtonActionPerformed
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed Node[] sn = getExplorerManager().getSelectedNodes(); if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) { return; } try { sn[0].destroy(); } catch (java.io.IOException ioe) { PropertyDialogManager.notify(ioe); } rootNode = getExplorerManager().getRootContext(); }//GEN-LAST:event_deleteButtonActionPerformed
/** * 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); } } }
PropertyDialogManager.notify(ex); res instanceof IllegalAccessException) { PropertyDialogManager.notify((Exception)res); throw (IllegalArgumentException) exception; } else { PropertyDialogManager.notify(exception); IllegalArgumentException iae = new IllegalArgumentException("Error setting value"); //NOI18N
PropertyDialogManager.notify(ex); res instanceof IllegalAccessException) { PropertyDialogManager.notify((Exception)res); throw (IllegalArgumentException) exception; } else { PropertyDialogManager.notify(exception); IllegalArgumentException iae = new IllegalArgumentException("Error setting value"); //NOI18N