Exemple #1
0
  public MainView() {
    listStore1 = initListStore();
    listStore2 = initListStore();
    listStore3 = initListStore();
    columnModel1 = initColumnModel();
    columnModel2 = initColumnModel();
    columnModel3 = initColumnModel();
    vlc_grid1 = new Grid<Video>(listStore1, columnModel1);
    vlc_grid2 = new Grid<Video>(listStore2, columnModel2);
    vlc_grid3 = new Grid<Video>(listStore3, columnModel3);

    initWidget(uiBinder.createAndBindUi(this));
    progInputGroup = new ToggleGroup();
    progInputGroup.add(prog_input_black);
    progInputGroup.add(prog_input_bars);
    progInputGroup.add(prog_input_1);
    progInputGroup.add(prog_input_2);
    progInputGroup.add(prog_input_3);
    progInputGroup.add(prog_input_4);
    progInputGroup.add(prog_input_5);
    progInputGroup.add(prog_input_6);

    prevInputGroup = new ToggleGroup();
    prevInputGroup.add(prev_input_black);
    prevInputGroup.add(prev_input_bars);
    prevInputGroup.add(prev_input_1);
    prevInputGroup.add(prev_input_2);
    prevInputGroup.add(prev_input_3);
    prevInputGroup.add(prev_input_4);
    prevInputGroup.add(prev_input_5);
    prevInputGroup.add(prev_input_6);
  }
Exemple #2
0
  @Override
  public Widget asWidget() {
    if (cp == null) {
      ExampleResources bundle = GWT.create(ExampleResources.class);

      this.style = bundle.style();
      this.style.ensureInjected();

      cp = new ContentPanel(GWT.<ContentPanelAppearance>create(FramedPanelAppearance.class));
      cp.addStyleName("margin-10");
      cp.setPixelSize(500, 400);
      cp.getBody().getStyle().setBackgroundColor("white");
      cp.getBody().addClassName(ThemeStyles.getStyle().border());

      con = new CardLayoutContainer();
      cp.add(con);

      ToggleGroup group = new ToggleGroup();

      for (Category cat : Category.values()) {
        final ToggleButton btn = new ToggleButton(cat.desc);
        btn.setData("cat", cat);
        btn.addValueChangeHandler(
            new ValueChangeHandler<Boolean>() {

              @Override
              public void onValueChange(ValueChangeEvent<Boolean> event) {
                if (event.getValue() == true) {
                  onClick((Category) btn.getData("cat"));
                }
              }
            });

        group.add(btn);
        cp.addButton(btn);
      }

      ToggleButton normal = (ToggleButton) cp.getButtonBar().getWidget(0);
      normal.setValue(true, true);
    }
    return cp;
  }