SubProcessElement.java :  » Workflow-Engines » OpenWFE » org » openwfe » gpe » model » Java Open Source

Java Open Source » Workflow Engines » OpenWFE 
OpenWFE » org » openwfe » gpe » model » SubProcessElement.java
/*
 * Created on 3 mai 2005
 *
 */
package org.openwfe.gpe.model;

import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;

/**
 * @author Christelle
 *
 */
public class SubProcessElement extends NoChild{
  public static String name = "Subprocess";
  private String ref = "";
  private String forget = "";
  private String fields = "";
  private String variableRef = "";
  private String fieldRef = "";

  
  protected static IPropertyDescriptor[] descriptors;
  
  public static final String REF = "ref";
  public static final String FORGET = "forget";
  public static final String FIELDS = "fields";
  public static final String VARIABLEREF = "variable-ref";
  public static final String FIELDREF = "field-ref";
  static {
    descriptors = new IPropertyDescriptor[] {
        new TextPropertyDescriptor(REF,"ref"),
        new TextPropertyDescriptor(FORGET,"forget"),
        new TextPropertyDescriptor(FIELDS, "fields"),
        new TextPropertyDescriptor(VARIABLEREF,"variable-ref"),
        new TextPropertyDescriptor(FIELDREF, "field-ref"),
        };
  }
  public String getName(){
    if (!(ref.equalsIgnoreCase("")))
      return name +": " + ref;
    return name;
  }
  
  public void setName(String s) {
    name = s;
  }
  public String getRef(){
    return ref;
  }
  public void setRef(String s){
    ref = s;
    firePropertyChange(REF, null, s);
  }
  
  public String getForget(){
    return forget;
  }
  public void setForget(String s){
    forget = s;
    firePropertyChange(FORGET, null, s);
  }
  
  public String getFields(){
    return fields;
  }
  public void setFields(String s){
    fields = s;
    firePropertyChange(FIELDS, null, s);
  }
  public String getVariableRef(){
    return variableRef;
  }
  public void setVariableRef(String s){
    variableRef = s;
    firePropertyChange(VARIABLEREF, null, s);
  }
  
  public String getFieldRef(){
    return fieldRef;
  }
  public void setFieldRef(String s){
    fieldRef = s;
    firePropertyChange(FIELDREF, null, s);
  }
  
  
  public IPropertyDescriptor[] getPropertyDescriptors() {
    return descriptors;
  }
  
  public Object getPropertyValue(Object propName) {
    if(REF.equals(propName))
      return getRef();
    if(FORGET.equals(propName))
      return getForget();
    if(VARIABLEREF.equals(propName))
      return getVariableRef();
    if(FIELDS.equals(propName))
      return getFields();
    if(FIELDREF.equals(propName))
      return getFieldRef();
    return super.getPropertyValue(propName);
  }
  
  public void setPropertyValue(Object id, Object value){
    if(id == REF)
      setRef((String)value);
    if(id == FORGET)
      setForget((String)value);
    if(id == VARIABLEREF)
      setVariableRef((String)value);
    if(id == FIELDS)
      setFields((String)value);
    if(id == FIELDREF)
      setFieldRef((String)value);
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.