Package com.projity.field

Examples of com.projity.field.FieldParseException


          else {
            ((JTextField)c).setText(""); // put in empty text
            newValue = null;
          }
        } catch (ParseException e1) {
          exception = new FieldParseException(field.syntaxErrorForField());
          component.setForeground(Color.RED);
          c.setForeground(Color.RED);
          if (parentFieldDialog != null)
            parentFieldDialog.setDirtyComponent(c);
View Full Code Here


  public AssociationList setAssociations(String associations, AssociationFormat associationFormat) throws FieldParseException {
    AssociationListFormat format = AssociationListFormat.getInstance(associationFormat);
    AssociationList result = (AssociationList)format.parseObject(associations,new ParsePosition(0));
    if (result == null) {
      System.out.println(associationFormat.getParameters().getError());
      throw new FieldParseException(associationFormat.getParameters().getError());
    }
    LinkedList oldList = list; // (LinkedList) list.clone(); // make a copy of original list since we'll be modifying real list
    LinkedList newList = result.list;
   
    // validate each element in new list
    try {
      result.testValid(true);
    } catch (InvalidAssociationException e) {
//      newList = oldList;
     
          System.out.println(e.getMessage());
      throw new FieldParseException(e.getMessage());       
       

    Association association;
    Iterator i;
   
    // check for duplicates
        for (i = newList.iterator(); i.hasNext();) {
          association = (Association)i.next();
          // if duplicate
          if (AssociationList.findAssociation(newList,association.getLeft(),association.getRight(),association) != null) {
//            newList = oldList;
            throw new FieldParseException("Duplicate association"); //TODO better message
          }
        }   
   
    // At this point, the newList is valid, so now merge
       
View Full Code Here

   * @param constraintType The constraintType to set.
   */
  public void setConstraintType(int constraintType) throws FieldParseException {
    int newConstraintType = makeValidConstraintType(constraintType); // limit to valid options
    if (newConstraintType != constraintType)
      throw new FieldParseException(Messages.getString("Message.parentConstraintType"));
    setRawConstraintType(constraintType);
    long d = getConstraintDate(); // save off old date, it will be reused
    if (!isDatelessConstraintType() && d < 5* WorkCalendar.MILLIS_IN_DAY) // if the constraint requires a date and there is none, set a date to today. added a bit of margin 5/5/08
      setConstraintDate(getEffectiveWorkCalendar().adjustInsideCalendar(DateTime.midnightToday(),false));

View Full Code Here

TOP

Related Classes of com.projity.field.FieldParseException

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.