Package java.beans

Examples of java.beans.PropertyVetoException


            } else {
              propertiesFile.createNewFile();
            }

          } catch (IOException ioe) {
            PropertyVetoException e = new PropertyVetoException(
                "Error property file=" + fn + ", " + ioe.toString(),
                event);

            e.initCause(ioe);

            throw e;

          }
        }
View Full Code Here


      if ("beanContext".equals(propertyName) &&
          containsKey(source)                 &&
          !getBeanContextPeer().equals(pce.getNewValue())
      ) {
          if (!validatePendingRemove(source)) {
        throw new PropertyVetoException("current BeanContext vetoes setBeanContext()", pce);
          } else ((BCSChild)children.get(source)).setRemovePending(true);
      }
  }
    }
View Full Code Here

  BeanContext oldValue = beanContext;
  BeanContext newValue = bc;

  if (!rejectedSetBCOnce) {
      if (rejectedSetBCOnce = !validatePendingSetBeanContext(bc)) {
    throw new PropertyVetoException(
        "setBeanContext() change rejected:",
        new PropertyChangeEvent(beanContextChildPeer, "beanContext", oldValue, newValue)
    );
      }
View Full Code Here

        {
            //e.printStackTrace();
            if ( logger.isLoggable( MLevel.WARNING ) )
          logger.log( MLevel.WARNING, "Failed to create ConnectionTester of class " + val, e );
           
            throw new PropertyVetoException("Could not instantiate connection tester class with name '" + val + "'.", evt);
        }
      }
        else if ("userOverridesAsString".equals( propName ))
      {
          try
        { WrapperConnectionPoolDataSource.this.userOverrides = C3P0ImplUtils.parseUserOverridesAsString( (String) val ); }
          catch (Exception e)
        {
            if ( logger.isLoggable( MLevel.WARNING ) )
          logger.log( MLevel.WARNING, "Failed to parse stringified userOverrides. " + val, e );
           
            throw new PropertyVetoException("Failed to parse stringified userOverrides. " + val, evt);
        }
      }
    }
      };
  this.addVetoableChangeListener( setConnectionTesterListener );
View Full Code Here

    {
        Object val = evt.getNewValue();
        if ( "jndiName".equals( evt.getPropertyName() ) )
      {
          if (! (val instanceof Name || val instanceof String) )
        throw new PropertyVetoException("jndiName must be a String or a javax.naming.Name", evt);
      }
    }
      };
  this.addVetoableChangeListener( l );
View Full Code Here

* @author Yvonne Wang
*/
public class JInternalFrameDriver_failIfVetoed_Test extends JInternalFrameDriver_TestCase {
  @Test
  public void should_throw_error_if_setProperty_is_vetoed() {
    final PropertyVetoException vetoed = new PropertyVetoException("Test", null);
    JInternalFrameAction action = MAXIMIZE;
    try {
      driver.failIfVetoed(internalFrame, action, new UnexpectedException(vetoed));
      failWhenExpectingException();
    } catch (ActionFailedException e) {
View Full Code Here

  }

  @VisibleForTesting
  void failIfVetoed(@Nonnull JInternalFrame internalFrame, @Nonnull JInternalFrameAction action,
      @Nonnull UnexpectedException unexpected) {
    PropertyVetoException vetoError = vetoFrom(unexpected);
    if (vetoError == null) {
      return;
    }
    String msg = String.format("%s of %s was vetoed: <%s>", action.name, format(internalFrame), vetoError.getMessage());
    throw actionFailure(msg);
  }
View Full Code Here

            this.name = name;
        }

        public void vetoableChange(final PropertyChangeEvent evt) throws PropertyVetoException {
            if (evt.getPropertyName() == name) {
                throw new PropertyVetoException("", evt);
            }
        }
View Full Code Here

    public Date getSelectableDate(Date date) throws PropertyVetoException {
        Date cleaned = date == null ? null :
            datePicker.getMonthView().getSelectionModel().getNormalizedDate(date);
        if (CalendarUtils.areEqual(cleaned, datePicker.getDate())) {
            // one place to interrupt the update spiral
            throw new PropertyVetoException("date not selectable", null);
        }
        if (cleaned == null) return cleaned;
        if (datePicker.getMonthView().isUnselectableDate(cleaned)) {
            throw new PropertyVetoException("date not selectable", null);
         }
        return cleaned;
    }
View Full Code Here

        changed.remove(changeNotification);
      }
    }
    if (!remoteChange) {
      propertyChangeSupportRemote.firePropertyChange(evt);
      throw new PropertyVetoException("remote change", evt);
    }
  }
View Full Code Here

TOP

Related Classes of java.beans.PropertyVetoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.