public EventViewerWindow() {
    super();

    setTitle(AppMessages.EVENT_VIEWER_LABEL);
    setShortcutIcon(AppImages.EVENT_DETAIL_SHORTCUT);
    setHeaderIcon(AppImages.EVENT_DETAIL_ICON);

    stack = new SectionStack();
    stack.setVisibilityMode(VisibilityMode.MULTIPLE);

    SectionStackSection findSection = new SectionStackSection("Find");
    findSection.setExpanded(true);

    final DynamicForm form = new SearchForm();
    form.setNumCols(7);
    form.setHeight(35);
    form.setTop(15);
    form.setCellPadding(10);

    TextItem actIdItem = new TextItem();
    actIdItem.setTitle("Activity ID");
    TextItem contextItem = new TextItem();
    contextItem.setTitle("Context");
    ButtonItem findBtn = new ButtonItem("Search");
    findBtn.setStartRow(false);
    findBtn.setIcon(AppImages.SEARCH_ICON);
    findBtn.setWidth("125px");

    form.setFields(actIdItem, contextItem, findBtn);
    findSection.addItem(form);

    SectionStackSection resultSection = new SectionStackSection("Activities");
    resultSection.setExpanded(true);

    grid = new ListGrid();
    grid.setShowAllRecords(true);
    grid.setHeight(300);

    ListGridField actId = new ListGridField("activityId", "ID", 40);
    ListGridField actDate = new ListGridField("activityDate", "Date", 150);
    ListGridField actCtx = new ListGridField("activityContext", "Context", 220);
    ListGridField actDesc = new ListGridField("activityDescription", "Description");

    grid.setFields(actId, actCtx, actDesc, actDate);
    grid.setData(getData());

    resultSection.addItem(grid);

    SectionStackSection detailSection = new SectionStackSection("Activity Detail");
    detailSection.setExpanded(true);

    stack.addSection(findSection);
    stack.addSection(resultSection);
    stack.addSection(detailSection);

    this.addItem(stack);
  }
示例#2
0
  private Layout() {

    vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();

    messageWindow = new MessageWindow(vLayout);

    vLayout.addMember(MainToolStrip.getInstance());

    mainSectionStack = new SectionStack();
    mainSectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    mainSectionStack.setAnimateSections(true);
    mainSectionStack.setCanResizeSections(true);

    SectionStackSection mainTabSection = new SectionStackSection();
    mainTabSection.setCanCollapse(false);
    mainTabSection.setShowHeader(false);

    centerTabSet = CenterTabSet.getInstance();
    mainTabSection.addItem(centerTabSet);

    mainSectionStack.setSections(mainTabSection);

    vLayout.addMember(mainSectionStack);

    modal = new ModalWindow(vLayout);

    vLayout.draw();
  }
示例#3
0
  /** This is the entry point method. */
  public void onModuleLoad() {

    final HelpCanvas help1 = new HelpCanvas("help1");
    final HelpCanvas help2 = new HelpCanvas("help2");

    HLayout layout = new HLayout();
    layout.setMembersMargin(20);

    final SectionStack sectionStack = new SectionStack();
    sectionStack.setVisibilityMode(VisibilityMode.MUTEX);
    sectionStack.setWidth(800);
    sectionStack.setHeight(600);

    SectionStackSection section1 = new SectionStackSection("Settings for Stream Recorder");
    section1.setExpanded(true);
    section1.setResizeable(false);

    // VLayout layout = new VLayout(25);

    layout.setAlign(Alignment.CENTER);
    layout.setMargin(23);
    layout.setWidth("93%");

    final DataSource dataSource = SettingsDS.getInstance();

    final DynamicForm form = new DynamicForm();
    form.setIsGroup(true);
    form.setGroupTitle("Update");
    form.setNumCols(4);
    form.setDataSource(dataSource);
    form.setMargin(1);

    final ListGrid listGrid = new ListGrid();
    listGrid.setWidth100();
    listGrid.setHeight(130);
    listGrid.setDataSource(dataSource);
    listGrid.setAutoFetchData(true);
    listGrid.addRecordClickHandler(
        new RecordClickHandler() {
          public void onRecordClick(RecordClickEvent event) {
            form.reset();
            form.editSelectedData(listGrid);
          }
        });

    section1.addItem(listGrid);
    section1.addItem(form);

    IButton butt = new IButton("Save");
    butt.setMargin(2);

    butt.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            form.saveData();
          }
        });
    section1.addItem(butt);

    Button button = new Button("Hello from Admin");
    button.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Services.getHelloService()
                .hello(
                    "Admin",
                    new AsyncCallback<Void>() {

                      @Override
                      public void onFailure(Throwable caught) {
                        // TODO Auto-generated method stub

                      }

                      @Override
                      public void onSuccess(Void result) {
                        // TODO Auto-generated method stub

                      }
                    });
          }
        });

    sectionStack.addSection(section1);

    SectionStackSection section2 = new SectionStackSection("Help 1");
    section2.setExpanded(true);
    section2.setCanCollapse(true);

    section2.addItem(help1);
    sectionStack.addSection(section2);
    // SectionStackSection section3 = new SectionStackSection("Help 2");
    // section3.setExpanded(true);
    // section3.setCanCollapse(true);
    // section3.addItem(help2);
    // sectionStack.addSection(section3);

    // IButton resizeButton = new IButton("Resize Help 1");
    // resizeButton.setWidth(150);
    // resizeButton.addClickHandler(new ClickHandler() {
    // public void onClick(ClickEvent event) {
    // help1.setHeight(200);
    // }
    // });

    layout.addMember(sectionStack);

    // VLayout buttons = new VLayout(25);
    // buttons.setMembersMargin(10);
    // buttons.addMember(resizeButton);

    // layout.addMember(buttons);

    layout.addMember(button);
    layout.draw();

    // RootPanel.get().add(topTabSet);
  }