Beispiel #1
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();
  }
  public MailfolderCanvas() {

    super();
    setShowResizeBar(true);

    SectionStackSection section = new SectionStackSection();
    section.setCanCollapse(false);
    section.setExpanded(true);
    section.setResizeable(true);

    createTree();
    section.setItems(this.tree);

    createToolbar(section);
    createContextMenu();

    setSections(section);

    EventBroker.get().addFoldersReloadListener(this);
    EventBroker.get().addMessagesChangedListener(this);

    addDrawHandler(
        new DrawHandler() {

          public void onDraw(DrawEvent event) {

            EventBroker.get().fireFoldersReload();
          }
        });
  }
Beispiel #3
0
  public AddressbookTree() {
    super();
    SectionStackSection section = new SectionStackSection();
    section.setCanCollapse(false);
    section.setExpanded(true);
    section.setResizeable(true);

    TreeGrid tree = new TreeGrid();
    tree.setWidth100();
    tree.setHeight100();
    tree.setAnimateFolderTime(100);
    tree.setAnimateFolders(true);
    tree.setAnimateFolderSpeed(1000);
    tree.setShowSortArrow(SortArrow.CORNER);
    tree.setShowAllRecords(true);
    tree.setLoadDataOnDemand(false);
    tree.setCanSort(false);
    tree.setCellHeight(17);
    tree.setShowHeader(false);

    TreeGridField field = new TreeGridField();
    field.setCanFilter(true);
    field.setName("name");
    field.setTitle("<b>SmartGWT Showcase</b>");
    tree.setFields(field);

    Tree treeData = new Tree();
    treeData.setModelType(TreeModelType.PARENT);
    treeData.setNameProperty("name");
    treeData.setOpenProperty("isOpen");
    treeData.setIdField("nodeID");
    treeData.setParentIdField("parentNodeID");
    treeData.setRootValue("root");
    treeData.setData(DemoData.getAddressBookTreeData());

    tree.setData(treeData);
    section.setItems(tree);

    setSections(section);
  }
Beispiel #4
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);
  }