Package com.projity.field

Examples of com.projity.field.Field


      invokeFieldAction(ACTION_DOCUMENTS,getCurrentFrame().getProject());
    }
  }

  private boolean isEnabledFieldAction(String action, Object obj) {
    Field f = FieldDictionary.getInstance().getActionField(ACTION_DOCUMENTS);
    return (obj != null && f != null && f.getValue(obj,null) != null);

  }
View Full Code Here


    Field f = FieldDictionary.getInstance().getActionField(ACTION_DOCUMENTS);
    return (obj != null && f != null && f.getValue(obj,null) != null);

  }
  private void invokeFieldAction(String action, Object obj) {
    Field f = FieldDictionary.getInstance().getActionField(ACTION_DOCUMENTS);
    if (f != null)
      f.invokeAction(obj);

  }
View Full Code Here

    getMenuManager().setActionEnabled(ACTION_PRINT,printable);
    getMenuManager().setActionEnabled(ACTION_PRINT_PREVIEW,printable);

    setZoomButtons();

    Field f = FieldDictionary.getInstance().getActionField(ACTION_DOCUMENTS);
    getMenuManager().setActionVisible(ACTION_DOCUMENTS,currentFrame != null && f != null);
    getMenuManager().setActionEnabled(ACTION_DOCUMENTS,currentFrame != null && isEnabledFieldAction(ACTION_DOCUMENTS,  currentFrame.getProject()));


  }
View Full Code Here

    public void setRedefinitionCallBack(Closure callback){}
 
   
    //used by label formula
    protected String getFieldName(String fieldId){
    Field field=FieldDictionary.getInstance().getFieldFromId(fieldId);
    return field.getName();
    }
View Full Code Here

   
    protected String toString(Object value){
        return FieldConverter.toString(value,value.getClass(),null);
    }
    protected String toString(String fieldId,Object value){
    Field field=FieldDictionary.getInstance().getFieldFromId(fieldId);
    if (field.hasOptions()) {
      return field.convertValueToStringUsingOptions(value);
    } //test, use getValue instead
    else return toString(value);
    }
View Full Code Here

  public Object getFieldValue(JRField jrField) throws JRException {
    // check if asked field must be converted to a String (field name begins whith Text_)
    cleanField = new DecoratedField(jrField);
   
    // get Projity equiv. field
    Field field = cleanField.fieldForReportField();
    if(cleanField.isTimeBased()) {
      setInterval(cleanField.getStart(), cleanField.getEnd());
    }
    Object result;
    if(cleanField.isTextField()) {
      result = field.getText(this, context);
    } else {
      // convert Projity type into jasper accepted types 
      result = DataSourceProvider.fieldValueConverterToPrimitiveType(field,field.getValue(this,context));
    }
    return result;
  }
View Full Code Here

  }
 
  public JComponent getComponent(String fieldId, int flag) {
    JComponent component = (JComponent) map.get(fieldId);
    if (component == null) {
      Field field = Configuration.getFieldFromId(fieldId);
      component = ComponentFactory.componentFor(field,this, flag);
      map.put(fieldId,component);
    }
    return component;
  }
View Full Code Here

      map.put(fieldId,component);
    }
    return component;
  }
  public String getLabel(String fieldId) {
    Field field = Configuration.getFieldFromId(fieldId);
    return field.getName();
  }
View Full Code Here

 
  // updates all components
  public void updateAll() {
    Iterator i = map.keySet().iterator();
    String fieldId;
    Field field;
    JComponent component;
    while (i.hasNext()) {
      fieldId = (String)i.next();
      field = Configuration.getFieldFromId(fieldId);
      component = getComponent(fieldId, 0); // argument 0 shouldn't matter because exists already
View Full Code Here

  public JComponent appendSometimesReadOnly(DefaultFormBuilder builder, String fieldId) {
    return appendField(builder,fieldId,ComponentFactory.SOMETIMES_READ_ONLY);
  }

  public JComponent appendField(DefaultFormBuilder builder, String fieldId, int flag) {
    Field field = Configuration.getFieldFromId(fieldId);
    if (field == null)
      return null;
    JComponent component = getComponent(fieldId, flag);
    if (component instanceof JCheckBox) // checkboxes already have a label to the right
      builder.append(component);
    else
      builder.append(getLabel(fieldId)+":",component);
    String fieldDoc = field.getHelp();
    if (fieldDoc != null)
      HelpUtil.addDocHelp(component,fieldDoc);
    return component;
  }
View Full Code Here

TOP

Related Classes of com.projity.field.Field

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.