public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor rootDirStr =
          new PropertyDescriptor("rootDirStr", getBeanDescriptor().getBeanClass());
      rootDirStr.setBound(true);
      rootDirStr.setPropertyEditorClass(JTextFieldEditor.class);
      rootDirStr.setDisplayName("<html><font color='green'>root dir:");
      rootDirStr.setShortDescription("The directory root to search for change sets. ");

      PropertyDescriptor validateChangeSets =
          new PropertyDescriptor("validateChangeSets", getBeanDescriptor().getBeanClass());
      validateChangeSets.setBound(true);
      validateChangeSets.setPropertyEditorClass(CheckboxEditor.class);
      validateChangeSets.setDisplayName("<html><font color='green'>validate:");
      validateChangeSets.setShortDescription("Select if you want to validate change sets. ");

      PropertyDescriptor validators =
          new PropertyDescriptor("validators", getBeanDescriptor().getBeanClass());
      validators.setBound(true);
      validators.setPropertyEditorClass(JTextFieldEditor.class);
      validators.setDisplayName("<html><font color='green'>validators:");
      validators.setShortDescription("The validators used on the change sets. ");

      PropertyDescriptor rv[] = {rootDirStr, validateChangeSets, validators};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
 public PropertyDescriptor[] getPropertyDescriptors() {
   try {
     PropertyDescriptor _domainId =
         new PropertyDescriptor("domainId", beanClass, "getDomainId", "setDomainId");
     PropertyDescriptor _leftMargin =
         new PropertyDescriptor("leftMargin", beanClass, "getLeftMargin", "setLeftMargin");
     PropertyDescriptor _rightMargin =
         new PropertyDescriptor("rightMargin", beanClass, "getRightMargin", "setRightMargin");
     PropertyDescriptor _topMargin =
         new PropertyDescriptor("topMargin", beanClass, "getTopMargin", "setTopMargin");
     PropertyDescriptor _bottomMargin =
         new PropertyDescriptor("bottomMargin", beanClass, "getBottomMargin", "setBottomMargin");
     PropertyDescriptor _columnName =
         new PropertyDescriptor("columnName", beanClass, "getColumnName", "setColumnName");
     _columnName.setPropertyEditorClass(AttributeNameEditor.class);
     PropertyDescriptor[] pds =
         new PropertyDescriptor[] {
           _bottomMargin, _columnName, _domainId, _leftMargin, _rightMargin, _topMargin
         };
     return pds;
   } catch (IntrospectionException ex) {
     ex.printStackTrace();
     return null;
   }
 }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor _toolTipText =
          new PropertyDescriptor("toolTipText", beanClass, "getToolTipText", "setToolTipText");
      _toolTipText.setDisplayName("toolTipText");
      _toolTipText.setShortDescription("toolTipText");
      PropertyDescriptor _fillColor =
          new PropertyDescriptor("fillColor", beanClass, "getFillColor", "setFillColor");
      _fillColor.setDisplayName("fillColor");
      _fillColor.setShortDescription("fillColor");
      _fillColor.setPropertyEditorClass(GeColorEditor.class);
      PropertyDescriptor _borderColor =
          new PropertyDescriptor("borderColor", beanClass, "getBorderColor", "setBorderColor");
      _borderColor.setDisplayName("borderColor");
      _borderColor.setShortDescription("borderColor");
      _borderColor.setPropertyEditorClass(GeColorEditor.class);
      PropertyDescriptor _colorTone =
          new PropertyDescriptor("colorTone", beanClass, "getColorTone", "setColorTone");
      _colorTone.setDisplayName("colorTone");
      _colorTone.setShortDescription("colorTone");
      _colorTone.setPropertyEditorClass(GeColorToneEditor.class);
      PropertyDescriptor _colorShift =
          new PropertyDescriptor("colorShift", beanClass, "getColorShift", "setColorShift");
      _colorShift.setDisplayName("colorShift");
      _colorShift.setShortDescription("colorShift");
      _colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
      PropertyDescriptor _colorBrightness =
          new PropertyDescriptor(
              "colorBrightness", beanClass, "getColorBrightness", "setColorBrightness");
      _colorBrightness.setDisplayName("colorBrightness");
      _colorBrightness.setShortDescription("colorBrightness");
      _colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
      PropertyDescriptor _colorIntensity =
          new PropertyDescriptor(
              "colorIntensity", beanClass, "getColorIntensity", "setColorIntensity");
      _colorIntensity.setDisplayName("colorIntensity");
      _colorIntensity.setShortDescription("colorIntensity");
      _colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
      PropertyDescriptor _rotate =
          new PropertyDescriptor("rotate", beanClass, "getRotate", "setRotate");
      _rotate.setDisplayName("rotate");
      _rotate.setShortDescription("rotate");
      PropertyDescriptor[] pds =
          new PropertyDescriptor[] {
            _toolTipText,
            _fillColor,
            _borderColor,
            _colorTone,
            _colorShift,
            _colorBrightness,
            _colorIntensity,
            _rotate
          };
      return pds;

    } catch (IntrospectionException ex) {
      ex.printStackTrace();
      return null;
    }
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor listName =
          new PropertyDescriptor("listName", TakeFirstItemInAttachmentList.class);
      listName.setBound(true);
      listName.setPropertyEditorClass(PropertyNameLabelEditor.class);
      listName.setDisplayName("<html><font color='green'>Name of temporary list:");
      listName.setShortDescription("Name of the temporary list.");

      PropertyDescriptor conceptKey =
          new PropertyDescriptor("conceptKey", TakeFirstItemInAttachmentList.class);
      conceptKey.setBound(true);
      conceptKey.setPropertyEditorClass(PropertyNameLabelEditor.class);
      conceptKey.setDisplayName("<html><font color='green'>Concept key:");
      conceptKey.setShortDescription("Concept key.");

      PropertyDescriptor rv[] = {listName, conceptKey};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor profilePropName =
          new PropertyDescriptor("profilePropName", getBeanDescriptor().getBeanClass());
      profilePropName.setBound(true);
      profilePropName.setPropertyEditorClass(PropertyNameLabelEditor.class);
      profilePropName.setDisplayName("<html><font color='green'>profile property:");
      profilePropName.setShortDescription("The property containing the profile to change.");

      PropertyDescriptor editPathEntry =
          new PropertyDescriptor("editPathEntry", getBeanDescriptor().getBeanClass());
      editPathEntry.setBound(true);
      editPathEntry.setPropertyEditorClass(ConceptLabelPropEditor.class);
      editPathEntry.setDisplayName("<html><font color='green'>editing path:");
      editPathEntry.setShortDescription("The property that contains the editing path.");

      PropertyDescriptor rv[] = {profilePropName, editPathEntry};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor queueType = new PropertyDescriptor("queueType", ToQueue.class);
      queueType.setBound(true);
      queueType.setPropertyEditorClass(ConceptLabelEditor.class);
      queueType.setDisplayName("Queue type:");
      queueType.setShortDescription("The type of queue to place this process into.");

      PropertyDescriptor rv[] = {queueType};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor profilePropName =
          new PropertyDescriptor("profilePropName", getBeanDescriptor().getBeanClass());
      profilePropName.setBound(true);
      profilePropName.setPropertyEditorClass(PropertyNameLabelEditor.class);
      profilePropName.setDisplayName("<html><font color='green'>profile prop:");
      profilePropName.setShortDescription("The property that contains the working profile.");

      PropertyDescriptor rv[] = {profilePropName};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {

      PropertyDescriptor inputPropName =
          new PropertyDescriptor("inputPropName", getBeanDescriptor().getBeanClass());
      inputPropName.setBound(true);
      inputPropName.setPropertyEditorClass(PropertyNameLabelEditor.class);
      inputPropName.setDisplayName("<html><font color='green'>input set property");
      inputPropName.setShortDescription("");

      PropertyDescriptor rv[] = {inputPropName};
      return rv;
    } catch (IntrospectionException e) {
      throw new Error(e.toString());
    }
  }
  /*
   * see java.beans.FeatureDescriptor#FeatureDescriptor(FeatureDescriptor)
   */
  public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target)
      throws IntrospectionException {

    target.setExpert(source.isExpert());
    target.setHidden(source.isHidden());
    target.setPreferred(source.isPreferred());
    target.setName(source.getName());
    target.setShortDescription(source.getShortDescription());
    target.setDisplayName(source.getDisplayName());

    // copy all attributes (emulating behavior of private FeatureDescriptor#addTable)
    Enumeration<String> keys = source.attributeNames();
    while (keys.hasMoreElements()) {
      String key = keys.nextElement();
      target.setValue(key, source.getValue(key));
    }

    // see java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor)
    target.setPropertyEditorClass(source.getPropertyEditorClass());
    target.setBound(source.isBound());
    target.setConstrained(source.isConstrained());
  }
Beispiel #10
0
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor _borderColor =
          new PropertyDescriptor("borderColor", beanClass, "getBorderColor", "setBorderColor");
      _borderColor.setDisplayName("borderColor");
      _borderColor.setShortDescription("borderColor");
      _borderColor.setPropertyEditorClass(GeColorEditor.class);
      PropertyDescriptor _lineWidth =
          new PropertyDescriptor("lineWidth", beanClass, "getLineWidth", "setLineWidth");
      _lineWidth.setDisplayName("lineWidth");
      _lineWidth.setShortDescription("lineWidth");
      PropertyDescriptor _rotate =
          new PropertyDescriptor("rotate", beanClass, "getRotate", "setRotate");
      _rotate.setDisplayName("rotate");
      _rotate.setShortDescription("rotate");
      PropertyDescriptor[] pds = new PropertyDescriptor[] {_borderColor, _lineWidth, _rotate};
      return pds;

    } catch (IntrospectionException ex) {
      ex.printStackTrace();
      return null;
    }
  }
  /**
   * Get an array of PropertyDescriptors for the InputMappedClassifier's public properties.
   *
   * @return an array of PropertyDescriptors
   */
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor p1;
      ArrayList<PropertyDescriptor> pds = new ArrayList<PropertyDescriptor>();

      p1 = new PropertyDescriptor("modelPath", InputMappedClassifier.class);
      p1.setPropertyEditorClass(weka.gui.beans.FileEnvironmentField.class);
      pds.add(p1);

      pds.add(new PropertyDescriptor("ignoreCaseForNames", InputMappedClassifier.class));
      pds.add(new PropertyDescriptor("suppressMappingReport", InputMappedClassifier.class));
      pds.add(new PropertyDescriptor("trim", InputMappedClassifier.class));
      pds.add(new PropertyDescriptor("classifier", InputMappedClassifier.class));

      // this one is only really needed for XMLSerialization
      pds.add(new PropertyDescriptor("options", InputMappedClassifier.class));

      return pds.toArray(new PropertyDescriptor[1]);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
  /**
   * Package-private constructor. Merge two property descriptors. Where they conflict, give the
   * second argument (y) priority over the first argument (x).
   *
   * @param x The first (lower priority) PropertyDescriptor
   * @param y The second (higher priority) PropertyDescriptor
   */
  PropertyDescriptor(PropertyDescriptor x, PropertyDescriptor y) {
    super(x, y);

    if (y.baseName != null) {
      baseName = y.baseName;
    } else {
      baseName = x.baseName;
    }

    if (y.readMethodName != null) {
      readMethodName = y.readMethodName;
    } else {
      readMethodName = x.readMethodName;
    }

    if (y.writeMethodName != null) {
      writeMethodName = y.writeMethodName;
    } else {
      writeMethodName = x.writeMethodName;
    }

    if (y.propertyTypeRef != null) {
      propertyTypeRef = y.propertyTypeRef;
    } else {
      propertyTypeRef = x.propertyTypeRef;
    }

    // Figure out the merged read method.
    Method xr = x.getReadMethod();
    Method yr = y.getReadMethod();

    // Normally give priority to y's readMethod.
    try {
      if (yr != null && yr.getDeclaringClass() == getClass0()) {
        setReadMethod(yr);
      } else {
        setReadMethod(xr);
      }
    } catch (IntrospectionException ex) {
      // fall through
    }

    // However, if both x and y reference read methods in the same class,
    // give priority to a boolean "is" method over a boolean "get" method.
    if (xr != null
        && yr != null
        && xr.getDeclaringClass() == yr.getDeclaringClass()
        && xr.getReturnType() == boolean.class
        && yr.getReturnType() == boolean.class
        && xr.getName().indexOf("is") == 0
        && yr.getName().indexOf("get") == 0) {
      try {
        setReadMethod(xr);
      } catch (IntrospectionException ex) {
        // fall through
      }
    }

    Method xw = x.getWriteMethod();
    Method yw = y.getWriteMethod();

    try {
      if (yw != null && yw.getDeclaringClass() == getClass0()) {
        setWriteMethod(yw);
      } else {
        setWriteMethod(xw);
      }
    } catch (IntrospectionException ex) {
      // Fall through
    }

    if (y.getPropertyEditorClass() != null) {
      setPropertyEditorClass(y.getPropertyEditorClass());
    } else {
      setPropertyEditorClass(x.getPropertyEditorClass());
    }

    bound = x.bound | y.bound;
    constrained = x.constrained | y.constrained;
  }
  public JDBCTestElementBeanInfoSupport(Class<?> beanClass) {
    super(beanClass);

    createPropertyGroup(
        "varName", // $NON-NLS-1$
        new String[] {"dataSource"}); // $NON-NLS-1$

    createPropertyGroup(
        "sql", // $NON-NLS-1$
        new String[] {
          "queryType", // $NON-NLS-1$
          "query", // $NON-NLS-1$
          "queryArguments", // $NON-NLS-1$
          "queryArgumentsTypes", // $NON-NLS-1$
          "variableNames", // $NON-NLS-1$
          "resultVariable", // $NON-NLS-1$
        });

    PropertyDescriptor p = property("dataSource"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");

    p = property("queryArguments"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");

    p = property("queryArgumentsTypes"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");

    p = property("variableNames"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");

    p = property("resultVariable"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");

    p = property("queryType"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, AbstractJDBCTestElement.SELECT);
    p.setValue(NOT_OTHER, Boolean.TRUE);
    // TODO ADD new SQL Statement tags
    p.setValue(
        TAGS,
        new String[] {
          AbstractJDBCTestElement.SELECT,
          AbstractJDBCTestElement.INSERT,
          AbstractJDBCTestElement.DELETE,
          AbstractJDBCTestElement.UPDATE,
          AbstractJDBCTestElement.CREATE,
          AbstractJDBCTestElement.CALLABLE,
          AbstractJDBCTestElement.PREPARED_SELECT,
          AbstractJDBCTestElement.PREPARED_UPDATE,
          AbstractJDBCTestElement.COMMIT,
          AbstractJDBCTestElement.ROLLBACK,
          AbstractJDBCTestElement.AUTOCOMMIT_FALSE,
          AbstractJDBCTestElement.AUTOCOMMIT_TRUE,
        });

    p = property("query"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, "");
    p.setPropertyEditorClass(TextAreaEditor.class);
  }
  public PropertyDescriptor[] getPropertyDescriptors() {
    try {
      PropertyDescriptor _toolTipText =
          new PropertyDescriptor("toolTipText", beanClass, "getToolTipText", "setToolTipText");
      _toolTipText.setDisplayName("toolTipText");
      _toolTipText.setShortDescription("toolTipText");
      PropertyDescriptor _fillColor =
          new PropertyDescriptor("fillColor", beanClass, "getFillColor", "setFillColor");
      _fillColor.setDisplayName("fillColor");
      _fillColor.setShortDescription("fillColor");
      _fillColor.setPropertyEditorClass(GeColorEditor.class);
      PropertyDescriptor _borderColor =
          new PropertyDescriptor("borderColor", beanClass, "getBorderColor", "setBorderColor");
      _borderColor.setDisplayName("borderColor");
      _borderColor.setShortDescription("borderColor");
      _borderColor.setPropertyEditorClass(GeColorEditor.class);
      PropertyDescriptor _colorTone =
          new PropertyDescriptor("colorTone", beanClass, "getColorTone", "setColorTone");
      _colorTone.setDisplayName("colorTone");
      _colorTone.setShortDescription("colorTone");
      _colorTone.setPropertyEditorClass(GeColorToneEditor.class);
      PropertyDescriptor _colorShift =
          new PropertyDescriptor("colorShift", beanClass, "getColorShift", "setColorShift");
      _colorShift.setDisplayName("colorShift");
      _colorShift.setShortDescription("colorShift");
      _colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
      PropertyDescriptor _colorBrightness =
          new PropertyDescriptor(
              "colorBrightness", beanClass, "getColorBrightness", "setColorBrightness");
      _colorBrightness.setDisplayName("colorBrightness");
      _colorBrightness.setShortDescription("colorBrightness");
      _colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
      PropertyDescriptor _colorIntensity =
          new PropertyDescriptor(
              "colorIntensity", beanClass, "getColorIntensity", "setColorIntensity");
      _colorIntensity.setDisplayName("colorIntensity");
      _colorIntensity.setShortDescription("colorIntensity");
      _colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
      PropertyDescriptor _rotate =
          new PropertyDescriptor("rotate", beanClass, "getRotate", "setRotate");
      _rotate.setDisplayName("rotate");
      _rotate.setShortDescription("rotate");
      PropertyDescriptor _clickAction =
          new PropertyDescriptor("clickAction", beanClass, "getClickAction", "setClickAction");
      _clickAction.setDisplayName("clickAction");
      _clickAction.setShortDescription("clickAction");
      _clickAction.setPropertyEditorClass(ClickActionEditor.class);
      PropertyDescriptor _command =
          new PropertyDescriptor("command", beanClass, "getCommand", "setCommand");
      _command.setDisplayName("command");
      _command.setShortDescription("command");
      PropertyDescriptor _lowTone =
          new PropertyDescriptor("lowTone", beanClass, "getLowTone", "setLowTone");
      _lowTone.setDisplayName("lowTone");
      _lowTone.setShortDescription("lowTone");
      _lowTone.setPropertyEditorClass(GeColorToneEditor.class);
      PropertyDescriptor _pwrAttribute =
          new PropertyDescriptor("pwrAttribute", beanClass, "getPwrAttribute", "setPwrAttribute");
      _pwrAttribute.setDisplayName("pwrAttribute");
      _pwrAttribute.setShortDescription("pwrAttribute");
      PropertyDescriptor _pwrAttrColor =
          new PropertyDescriptor("pwrAttrColor", beanClass, "getPwrAttrColor", "setPwrAttrColor");
      _pwrAttrColor.setDisplayName("pwrAttrColor");
      _pwrAttrColor.setShortDescription("pwrAttColor");
      PropertyDescriptor _pwrAttrText =
          new PropertyDescriptor("pwrAttrText", beanClass, "getPwrAttrText", "setPwrAttrText");
      _pwrAttrText.setDisplayName("pwrAttrText");
      _pwrAttrText.setShortDescription("pwrAttText");
      PropertyDescriptor _textLow =
          new PropertyDescriptor("textLow", beanClass, "getTextLow", "setTextLow");
      _textLow.setDisplayName("textLow");
      _textLow.setShortDescription("textLow");
      PropertyDescriptor _textHigh =
          new PropertyDescriptor("textHigh", beanClass, "getTextHigh", "setTextHigh");
      _textHigh.setDisplayName("textHigh");
      _textHigh.setShortDescription("textHigh");
      PropertyDescriptor _access =
          new PropertyDescriptor("access", beanClass, "getAccess", "setAccess");
      _access.setDisplayName("access");
      _access.setShortDescription("access");
      PropertyDescriptor _confirm =
          new PropertyDescriptor("confirm", beanClass, "getConfirm", "setConfirm");
      _confirm.setDisplayName("confirm");
      _confirm.setShortDescription("confirm");
      PropertyDescriptor _confirmText =
          new PropertyDescriptor("confirmText", beanClass, "getConfirmText", "setConfirmText");
      _confirmText.setDisplayName("confirmText");
      _confirmText.setShortDescription("confirmText");
      PropertyDescriptor _annot1 =
          new PropertyDescriptor("annot1", beanClass, "getAnnot1", "setAnnot1");
      _annot1.setDisplayName("annot1");
      _annot1.setShortDescription("annot1");
      PropertyDescriptor _annot1Font =
          new PropertyDescriptor("annot1Font", beanClass, "getAnnot1Font", "setAnnot1Font");
      _annot1Font.setDisplayName("annot1Font");
      _annot1Font.setShortDescription("annot1Font");
      PropertyDescriptor[] pds =
          new PropertyDescriptor[] {
            _toolTipText,
            _fillColor,
            _borderColor,
            _colorTone,
            _colorShift,
            _colorBrightness,
            _colorIntensity,
            _rotate,
            _clickAction,
            _command,
            _lowTone,
            _pwrAttribute,
            _pwrAttrColor,
            _pwrAttrText,
            _textLow,
            _textHigh,
            _access,
            _confirm,
            _confirmText,
            _annot1,
            _annot1Font
          };
      return pds;

    } catch (IntrospectionException ex) {
      ex.printStackTrace();
      return null;
    }
  }
  protected ScriptingBeanInfoSupport(
      Class<? extends TestBean> beanClass, String[] LANGUAGE_TAGS, ResourceBundle rb) {
    super(beanClass);
    PropertyDescriptor p;

    p = property("scriptLanguage"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, ""); // $NON-NLS-1$
    if (rb != null) {
      p.setValue(RESOURCE_BUNDLE, rb);
    }
    p.setValue(TAGS, LANGUAGE_TAGS);

    createPropertyGroup(
        "scriptingLanguage", // $NON-NLS-1$
        new String[] {"scriptLanguage"}); // $NON-NLS-1$

    p = property("parameters"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, ""); // $NON-NLS-1$

    createPropertyGroup(
        "parameterGroup", // $NON-NLS-1$
        new String[] {"parameters"}); // $NON-NLS-1$

    p = property("filename"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, ""); // $NON-NLS-1$
    p.setPropertyEditorClass(FileEditor.class);

    createPropertyGroup(
        "filenameGroup", // $NON-NLS-1$
        new String[] {"filename"}); // $NON-NLS-1$

    /*
     * If we are creating a JSR223 element, add the cache key property.
     *
     * Note that this cannot be done in the JSR223BeanInfoSupport class
     * because that causes problems with the group; its properties are
     * not always set up before they are needed. This cause various
     * issues with the GUI:
     * - wrong field attributes (should not allow null)
     * - sometimes GUI is completely mangled
     * - field appears at start rather than at end.
     * - the following warning is logged:
     * jmeter.testbeans.gui.GenericTestBeanCustomizer:
     * org.apache.jmeter.util.JSR223TestElement#cacheKey does not appear to have been configured
     *
     * Adding the group here solves these issues, and it's also
     * possible to add the key just before the script panel
     * to which it relates.
     *
     * It's not yet clear why this should be, but it looks as though
     * createPropertyGroup does not work properly if it is called from
     * any subclasses of this class.
     *
     */
    if (JSR223TestElement.class.isAssignableFrom(beanClass)) {
      p = property("cacheKey"); // $NON-NLS-1$
      p.setValue(NOT_UNDEFINED, Boolean.TRUE);
      p.setValue(DEFAULT, ""); // $NON-NLS-1$

      createPropertyGroup(
          "cacheKey_group", // $NON-NLS-1$
          new String[] {"cacheKey"}); // $NON-NLS-1$
    }

    p = property("script"); // $NON-NLS-1$
    p.setValue(NOT_UNDEFINED, Boolean.TRUE);
    p.setValue(DEFAULT, ""); // $NON-NLS-1$
    p.setPropertyEditorClass(TextAreaEditor.class);

    createPropertyGroup(
        "scripting", // $NON-NLS-1$
        new String[] {"script"}); // $NON-NLS-1$
  }
Beispiel #16
0
 public void property(String propertyName, PropertyDescriptor desc) {
   if ("cellHorizontalAlignment".equals(propertyName))
     desc.setPropertyEditorClass(SwingConstantsHAlignment.class);
   else if ("cellVerticalAlignment".equals(propertyName))
     desc.setPropertyEditorClass(SwingConstantsVAlignment.class);
 }