public Object run () { //synchronized (allEditors) { synchronized (getLock()) { // user canceled the action if (ask && !canClose ()) { return Boolean.FALSE; } java.util.Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { TopComponent c = (TopComponent)en.nextElement (); if (!c.close ()) { return Boolean.FALSE; } } } return Boolean.TRUE; } });
public Object run () { //synchronized (allEditors) { synchronized (getLock()) { // user canceled the action if (ask && !canClose ()) { return Boolean.FALSE; } java.util.Enumeration en = allEditors.getComponents (); while (en.hasMoreElements ()) { TopComponent c = (TopComponent)en.nextElement (); if (!c.close ()) { return Boolean.FALSE; } } } return Boolean.TRUE; } });
/** Forbids setValid (false) on data object when there is an * opened editor. * * @param ev PropertyChangeEvent */ public void vetoableChange (PropertyChangeEvent ev) throws PropertyVetoException { if (Env.PROP_VALID.equals (ev.getPropertyName ())) { // do not check it if old value is not true if (Boolean.FALSE.equals (ev.getOldValue ())) return; if (env.isModified ()) { // if the object is modified CloneableOpenSupport os = support (); if (os != null && !os.canClose ()) { // is modified and has not been sucessfully closed throw new PropertyVetoException ( // [PENDING] this is not a very good detail message! "", ev // NOI18N ); } } } }
/** Forbids setValid (false) on data object when there is an * opened editor. * * @param ev PropertyChangeEvent */ public void vetoableChange (PropertyChangeEvent ev) throws PropertyVetoException { if (Env.PROP_VALID.equals (ev.getPropertyName ())) { // do not check it if old value is not true if (Boolean.FALSE.equals (ev.getOldValue ())) return; if (env.isModified ()) { // if the object is modified CloneableOpenSupport os = support (); if (os != null && !os.canClose ()) { // is modified and has not been sucessfully closed throw new PropertyVetoException ( // [PENDING] this is not a very good detail message! "", ev // NOI18N ); } } } }