コード例 #1
0
  @Override
  protected void setValue(Object element, Object value) {
    if (element instanceof SimpleSelectField) {
      SimpleSelectField selectField = ((SimpleSelectField) element);
      if (((Integer) value) == 0) {
        selectField.setOrderType("NONE");
      } else if (((Integer) value) == 1) {
        selectField.setOrderType("ASC");
      } else if (((Integer) value) == 2) {
        selectField.setOrderType("DESC");
      }
    } else if (element instanceof InLineCalculatedSelectField) {
      InLineCalculatedSelectField selectField = ((InLineCalculatedSelectField) element);
      if (((Integer) value) == 0) {
        selectField.setOrderType("NONE");
      } else if (((Integer) value) == 1) {
        selectField.setOrderType("ASC");
      } else if (((Integer) value) == 2) {
        selectField.setOrderType("DESC");
      }
    }

    viewer.refresh();

    queryBuilder.setDirtyEditor();
  }
コード例 #2
0
  @Override
  protected Object getValue(Object element) {
    if (element instanceof SimpleSelectField) {
      SimpleSelectField selectField = ((SimpleSelectField) element);
      if (selectField.getOrderType().equals("NONE")) {
        return 0;
      } else if (selectField.getOrderType().equals("ASC")) {
        return 1;
      } else if (selectField.getOrderType().equals("DESC")) {
        return 2;
      }
    } else if (element instanceof InLineCalculatedSelectField) {
      InLineCalculatedSelectField selectField = ((InLineCalculatedSelectField) element);
      if (selectField.getOrderType().equals("NONE")) {
        return 0;
      } else if (selectField.getOrderType().equals("ASC")) {
        return 1;
      } else if (selectField.getOrderType().equals("DESC")) {
        return 2;
      }
    }

    return 0;
  }