public ListBoxItem(String name, String title) {
    super(name, title);

    listBox = new ListBox();
    listBox.setName(name);
    listBox.setTitle(title);
    listBox.setVisibleItemCount(5);
    listBox.setTabIndex(0);
    listBox.setHeight("50px");

    valueChangeHandler =
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {}
        };
    listBox.addChangeHandler(valueChangeHandler);

    wrapper = new HorizontalPanel();
    wrapper.add(listBox);
  }
  public DualListBoxDevelopper(final Long idProject) {
    final HorizontalPanel horizontalPanel = new HorizontalPanel();
    listbox1.setTitle("Développeur disponible");
    listbox1.setMultipleSelect(true);
    listbox2.setMultipleSelect(true);
    listbox2.setTitle("Développeur affecté au projet");
    // récupération des informations du projet
    projetClient.getProject(
        idProject,
        new MethodCallback<Project>() {

          @Override
          public void onSuccess(final Method method, final Project project) {
            // récupération des développeurs qui ne sont pas dans le projet
            developperClient.getDeveloppeurAvailable(
                idProject,
                new MethodCallback<List<Developper>>() {

                  @Override
                  public void onFailure(final Method method, final Throwable exception) {}

                  @Override
                  public void onSuccess(final Method method, final List<Developper> notInProject) {
                    listbox1.clear();
                    listbox2.clear();

                    developpersInProject = project.getDeveloppers();
                    developpersAvailable = notInProject;
                    for (final Developper developper : notInProject) {
                      listbox1.addItem(developper.getFirstName() + " " + developper.getLastName());
                    }
                    for (final Developper developper : developpersInProject) {
                      listbox2.addItem(developper.getFirstName() + " " + developper.getLastName());
                    }

                    final Button change = new Button("changer");
                    change.addClickHandler(
                        new ClickHandler() {

                          @Override
                          public void onClick(final ClickEvent event) {
                            final List<Integer> selectedItems1 = getSelectedItems(listbox1);
                            final List<Integer> selectedItems2 = getSelectedItems(listbox2);
                            for (final Integer i : selectedItems1) {
                              final Developper dev = developpersAvailable.get(i);
                              developpersInProject.add(dev);
                              listbox2.addItem(dev.getFirstName() + " " + dev.getLastName());
                            }
                            for (final Integer i : selectedItems2) {
                              final Developper dev = developpersInProject.get(i);
                              developpersAvailable.add(dev);
                              listbox1.addItem(dev.getFirstName() + " " + dev.getLastName());
                            }
                            for (final Integer i : selectedItems2) {
                              developpersAvailable.remove(i);
                              listbox2.removeItem(i);
                            }
                            for (final Integer i : selectedItems1) {
                              developpersInProject.remove(i);
                              listbox1.removeItem(i);
                            }
                          }
                        });
                    final VerticalPanel v1 = new VerticalPanel();
                    final VerticalPanel v2 = new VerticalPanel();
                    final Label label1 = new Label("Développeur disponible :");
                    final Label label2 = new Label("Développeur affecté au projet :");
                    v1.add(label1);
                    v2.add(label2);
                    v1.add(listbox1);
                    v2.add(listbox2);
                    horizontalPanel.add(v1);
                    horizontalPanel.add(change);
                    horizontalPanel.add(v2);
                  }
                });
          }

          @Override
          public void onFailure(final Method method, final Throwable exception) {}
        });
    initWidget(horizontalPanel);
  }
Example #3
0
 @Test
 public void checkTitle() {
   ListBox listBox = new ListBox(false);
   listBox.setTitle("title");
   Assert.assertEquals("title", listBox.getTitle());
 }
  public PCAPanel(DatasetInformation datasetInfo) {
    this.setWidth("400px");
    this.setHeight("150px");
    this.setTitle("Principal component analysis");
    this.setShowMinimizeButton(false);
    this.setIsModal(false);
    this.centerInPage();
    this.addCloseClickHandler(
        new CloseClickHandler() {
          @Override
          public void onCloseClick(CloseClickEvent event) {
            hide();
            destroy();
          }
        });

    VLayout vp = new VLayout();
    vp.setWidth100();
    vp.setHeight100();
    this.addItem(vp);

    HLayout hp1 = new HLayout();
    hp1.setWidth100();
    hp1.setHeight("20px");
    Label l1 = new Label("X AXES ");
    l1.setHeight("20px");
    l1.setWidth("100px");
    pcaI = new ListBox();
    pcaI.setWidth("200px");
    pcaI.setHeight("20px");
    pcaI.setTitle("X AXES");

    hp1.addMember(l1);
    hp1.addMember(pcaI);
    hp1.setMargin(5);

    vp.addMember(hp1);
    hp1.setAlign(Alignment.LEFT);

    HLayout hp2 = new HLayout();
    hp2.setWidth100();
    hp2.setHeight("20px");
    Label l2 = new Label("Y AXES ");
    l2.setHeight("20px");
    l2.setWidth("100px");

    pcaII = new ListBox();
    pcaII.setWidth("200px");
    pcaII.setHeight("20px");
    pcaII.setTitle("Y AXES");

    hp2.addMember(l2);
    hp2.addMember(pcaII);
    hp2.setMargin(5);

    vp.addMember(hp2);
    hp2.setAlign(Alignment.LEFT);

    if (datasetInfo != null) {
      for (String str : datasetInfo.getColsNames()) {
        pcaI.addItem(str);
        pcaII.addItem(str);
      }
      pcaI.setSelectedIndex(0);
      pcaII.setSelectedIndex(1);
    }
    okBtn = new IButton("Start Process");
    okBtn.setWidth("200px");
    okBtn.setAlign(Alignment.CENTER);
    okBtn.setShowRollOver(true);
    okBtn.setShowDown(true);
    okBtn.setTitleStyle("stretchTitle");

    HLayout btnLayout = new HLayout();
    btnLayout.setWidth100();
    btnLayout.setHeight("20px");
    btnLayout.addMember(okBtn);
    btnLayout.setAlign(Alignment.CENTER);

    vp.addMember(btnLayout);
    vp.setTop(20);
    vp.setMembersMargin(15);

    this.show();
  }
Example #5
0
  public PackageBuilderWidget(final PackageConfigData conf, ClientFactory clientFactory) {

    this.conf = conf;
    this.clientFactory = clientFactory;

    // UI above the results table
    FormStyleLayout layout = new FormStyleLayout();
    final VerticalPanel container = new VerticalPanel();
    final VerticalPanel buildResults = new VerticalPanel();

    RadioButton wholePackageRadioButton = new RadioButton("action", constants.BuildWholePackage());
    RadioButton builtInSelectorRadioButton =
        new RadioButton("action", constants.BuildPackageUsingBuiltInSelector());
    RadioButton customSelectorRadioButton =
        new RadioButton("action", constants.BuildPackageUsingCustomSelector());
    wholePackageRadioButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            buildWholePackageLayout.setVisible(true);
            builtInSelectorLayout.setVisible(false);
            customSelectorLayout.setVisible(false);
            buildMode = "buildWholePackage";
          }
        });
    builtInSelectorRadioButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            buildWholePackageLayout.setVisible(false);
            builtInSelectorLayout.setVisible(true);
            customSelectorLayout.setVisible(false);
            buildMode = "BuiltInSelector";
          }
        });
    customSelectorRadioButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            buildWholePackageLayout.setVisible(false);
            builtInSelectorLayout.setVisible(false);
            customSelectorLayout.setVisible(true);
            buildMode = "customSelector";
          }
        });

    VerticalPanel verticalPanel = new VerticalPanel();

    HorizontalPanel wholePackageRadioButtonPanel = new HorizontalPanel();
    wholePackageRadioButtonPanel.add(wholePackageRadioButton);
    wholePackageRadioButtonPanel.add(
        new InfoPopup(constants.BuildWholePackage(), constants.BuildWholePackageTip()));
    verticalPanel.add(wholePackageRadioButtonPanel);

    HorizontalPanel builtInSelectorRadioButtonPanel = new HorizontalPanel();
    builtInSelectorRadioButtonPanel.add(builtInSelectorRadioButton);
    builtInSelectorRadioButtonPanel.add(
        new InfoPopup(constants.BuiltInSelector(), constants.BuiltInSelectorTip()));
    verticalPanel.add(builtInSelectorRadioButtonPanel);

    HorizontalPanel customSelectorRadioButtonPanel = new HorizontalPanel();
    customSelectorRadioButtonPanel.add(customSelectorRadioButton);
    customSelectorRadioButtonPanel.add(
        new InfoPopup(constants.CustomSelector(), constants.SelectorTip()));
    verticalPanel.add(customSelectorRadioButtonPanel);

    layout.addAttribute("", verticalPanel);
    wholePackageRadioButton.setValue(true);

    buildWholePackageLayout.setVisible(true);
    builtInSelectorLayout.setVisible(false);
    customSelectorLayout.setVisible(false);

    // Build whole package layout
    layout.addRow(buildWholePackageLayout);

    // Built-in selector layout
    builtInSelectorLayout.addRow(
        new HTML("&nbsp;&nbsp;<i>" + constants.BuildPackageUsingFollowingAssets() + "</i>"));

    HorizontalPanel builtInSelectorStatusPanel = new HorizontalPanel();
    final CheckBox enableStatusCheckBox = new CheckBox();
    enableStatusCheckBox.setValue(false);
    builtInSelectorStatusPanel.add(enableStatusCheckBox);
    builtInSelectorStatusPanel.add(
        new HTML("&nbsp;&nbsp;<i>" + constants.BuildPackageUsingBuiltInSelectorStatus() + " </i>"));
    final ListBox statusOperator = new ListBox();
    String[] vals = new String[] {"=", "!="};
    for (int i = 0; i < vals.length; i++) {
      statusOperator.addItem(vals[i], vals[i]);
    }
    builtInSelectorStatusPanel.add(statusOperator);

    final TextBox statusValue = new TextBox();
    statusValue.setTitle(constants.WildCardsSearchTip());
    builtInSelectorStatusPanel.add(statusValue);

    builtInSelectorLayout.addRow(builtInSelectorStatusPanel);

    HorizontalPanel builtInSelectorCatPanel = new HorizontalPanel();
    final CheckBox enableCategoryCheckBox = new CheckBox();
    enableCategoryCheckBox.setValue(false);
    builtInSelectorCatPanel.add(enableCategoryCheckBox);
    builtInSelectorCatPanel.add(
        new HTML("&nbsp;&nbsp;<i>" + constants.BuildPackageUsingBuiltInSelectorCat() + " </i>"));
    final ListBox catOperator = new ListBox();
    String[] catVals = new String[] {"=", "!="};
    for (int i = 0; i < catVals.length; i++) {
      catOperator.addItem(catVals[i], catVals[i]);
    }
    builtInSelectorCatPanel.add(catOperator);
    final CategoryExplorerWidget catChooser =
        new CategoryExplorerWidget(
            new CategorySelectHandler() {
              public void selected(String selectedPath) {}
            });
    ScrollPanel catScroll = new ScrollPanel(catChooser);
    catScroll.setAlwaysShowScrollBars(true);
    catScroll.setSize("300px", "130px");

    builtInSelectorCatPanel.add(catScroll);
    builtInSelectorLayout.addRow(builtInSelectorCatPanel);

    layout.addRow(builtInSelectorLayout);

    // Custom selector layout
    customSelectorLayout.setVisible(false);
    HorizontalPanel customSelectorPanel = new HorizontalPanel();
    customSelectorPanel.add(
        new HTML(
            "&nbsp;&nbsp;<i>"
                + constants.BuildPackageUsingCustomSelectorSelector()
                + " </i>")); // NON-NLS

    final ListBox customSelector = new ListBox();
    customSelector.setTitle(constants.WildCardsSearchTip());
    customSelectorPanel.add(customSelector);
    loadCustomSelectorList(customSelector);

    customSelectorLayout.addRow(customSelectorPanel);
    layout.addRow(customSelectorLayout);

    final Button b = new Button(constants.BuildPackage());
    b.setTitle(constants.ThisWillValidateAndCompileAllTheAssetsInAPackage());
    b.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            doBuild(
                buildResults,
                statusOperator.getValue(statusOperator.getSelectedIndex()),
                statusValue.getText(),
                enableStatusCheckBox.getValue(),
                catOperator.getValue(catOperator.getSelectedIndex()),
                catChooser.getSelectedPath(),
                enableCategoryCheckBox.getValue(),
                customSelector.getSelectedIndex() != -1
                    ? customSelector.getValue(customSelector.getSelectedIndex())
                    : null);
          }
        });
    HorizontalPanel buildStuff = new HorizontalPanel();
    buildStuff.add(b);

    layout.addAttribute(constants.BuildBinaryPackage(), buildStuff);
    layout.addRow(
        new HTML("<i><small>" + constants.BuildingPackageNote() + "</small></i>")); // NON-NLS
    container.add(layout);

    // The build results
    container.add(buildResults);

    // UI below the results table
    layout = new FormStyleLayout();
    Button snap = new Button(constants.CreateSnapshotForDeployment());
    snap.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            showSnapshotDialog(conf.getName(), null);
          }
        });
    layout.addAttribute(constants.TakeSnapshot(), snap);
    container.add(layout);

    initWidget(container);
  }