private void initComponents() {
    HLayout formsHLayout = new HLayout();
    formsHLayout.setWidth100();
    formsHLayout.setHeight("*");
    formsHLayout.setMembersMargin(5);

    DynamicForm jobNamesForm = new DynamicForm();
    jobNamesForm.setWidth100();
    jobNamesForm.setHeight100();
    jobNamesForm.setGroupTitle("Filter Jobs");
    jobNamesForm.setIsGroup(true);
    jobNamesForm.setTitleOrientation(TitleOrientation.TOP);
    jobNamesForm.setNumCols(2);
    jobNamesForm.setValuesManager(valuesManager);

    jobNamesForm.setDataFetchMode(FetchMode.BASIC);

    CheckboxItem selectAllJobNamesChkItem = new CheckboxItem();
    selectAllJobNamesChkItem.setValue(true);
    selectAllJobNamesChkItem.setTitle("Select All Jobs");
    selectAllJobNamesChkItem.setWidth("*");
    selectAllJobNamesChkItem.setName("selectAllJobNames");
    selectAllJobNamesChkItem.addChangedHandler(
        new ChangedHandler() {

          @Override
          public void onChanged(ChangedEvent event) {
            if ((Boolean) event.getValue()) {
              selectJobNameGrid.setDisabled(true);
              selectJobNameGrid.setCriterion(null);
            } else {
              selectJobNameGrid.setDisabled(false);
              // selectJobNameGrid.setCriterion(new Criterion().seta);
            }
          }
        });

    selectJobNameGrid.setTitle("Select Jobs");
    selectJobNameGrid.setWidth(280);
    selectJobNameGrid.setMultiple(true);
    selectJobNameGrid.setMultipleAppearance(MultipleAppearance.GRID);
    selectJobNameGrid.setValueMap("job", "job1", "job2", "Goat", "Marmoset", "Mouse");
    selectJobNameGrid.setName("selectedJobNames");
    selectJobNameGrid.setCriteriaField("selectedJobNames");
    /*selectJobNameGrid.addClickHandler(new ClickHandler() {
    	@Override
    	public void onClick(ClickEvent event) {
    		if(event.getSource().equals(selectJobNameGrid)){
    			String[] values = selectJobNameGrid.getValues();
    			valuesManager.setAttribute("selectedJobNames", values, true);
    		}
    	}
    });*/

    executionStartDate.setName("executionStartDate");
    executionStartDate.setTitle("Exceution Start Date");
    executionStartDate.setRequired(true);

    executionEndDate.setName("executionEndDate");
    executionEndDate.setTitle("Exceution End Date");
    executionEndDate.setRequired(true);

    executionStartTime.setName("executionStartTime");
    executionStartTime.setTitle("Exceution Start Time");
    executionStartTime.setRequired(true);

    executionEndTime.setName("executionEndTime");
    executionEndTime.setTitle("Exceution End Time");
    executionEndTime.setRequired(true);

    FormItem[] formItems =
        new FormItem[] {
          selectAllJobNamesChkItem,
          selectJobNameGrid,
          executionStartDate,
          executionStartTime,
          executionEndDate,
          executionEndTime
        };
    jobNamesForm.setDataSource(HistoricalJobMonitorDataSource.getInstance(), formItems);
    jobNamesForm.setFields(formItems);
    formsHLayout.addMember(jobNamesForm);

    addMember(formsHLayout);

    addMember(searchButton);
  }
示例#2
0
  /**
   * Creates this property editor.
   *
   * @param contents Contents view form.
   */
  public MixinValueEditor(Contents contents) {
    super(TITLE);
    this.contents = contents;

    setWidth(WIDTH);
    setHeight(HEIGHT);

    Columns h1 = new Columns(Align.CENTER, Align.CENTER);
    h1.setHeight(15);

    Label l1 = new Label();
    l1.setWidth(150);
    l1.setContents("Mixin Types");

    Label l2 = new Label();
    l2.setWidth(100);
    l2.setContents("");

    Label l3 = new Label();
    l3.setWidth(150);
    l3.setContents("Node's types");

    h1.addMember(l1);
    h1.addMember(l2);
    h1.addMember(l3);

    addMember(h1);

    Columns layout = new Columns(Align.CENTER, Align.CENTER);
    layout.setWidth100();

    mixTypes.setMultiple(true);
    mixTypes.setMultipleAppearance(MultipleAppearance.GRID);
    mixTypes.setWidth(150);
    mixTypes.setHeight(200);

    selectedTypes.setMultiple(true);
    selectedTypes.setMultipleAppearance(MultipleAppearance.GRID);
    selectedTypes.setWidth(150);
    selectedTypes.setHeight(200);

    DynamicForm f1 = new DynamicForm();
    f1.setItems(mixTypes);
    f1.setWidth(150);
    f1.setHeight(200);

    DynamicForm f2 = new DynamicForm();
    f2.setItems(selectedTypes);
    f2.setWidth(150);
    f2.setHeight(200);

    VLayout buttons = new VLayout();
    buttons.setLayoutAlign(Alignment.CENTER);
    buttons.setDefaultLayoutAlign(Alignment.CENTER);
    buttons.setAlign(Alignment.CENTER);
    buttons.setLayoutAlign(VerticalAlignment.CENTER);
    buttons.setWidth(50);

    layout.addMember(f1);
    layout.addMember(buttons);
    layout.addMember(f2);

    Button b1 = new Button(">>");
    b1.setWidth(30);
    b1.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
            allTypes = remove(allTypes, mixTypes.getValueAsString());
            nodeTypes = add(nodeTypes, mixTypes.getValueAsString());
            updateLists();
          }
        });

    Button b2 = new Button("<<");
    b2.setWidth(30);
    b2.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
            nodeTypes = remove(nodeTypes, selectedTypes.getValueAsString());
            allTypes = add(allTypes, selectedTypes.getValueAsString());
            updateLists();
          }
        });

    buttons.addMember(b1);
    buttons.addMember(b2);

    addMember(layout);

    Columns h3 = new Columns(Align.RIGHT, Align.CENTER);
    h3.setHeight(50);

    Button okButton = new Button("OK");
    okButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
            onConfirm(null);
            hide();
          }
        });

    Button cancelButton = new Button("Cancel");
    cancelButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
            hide();
          }
        });

    h3.addMember(okButton);
    h3.addMember(cancelButton);

    addMember(h3);
  }