예제 #1
0
  protected void layoutCalendar() {
    calendarGrid.clear();
    calendarGrid.setCellSpacing(0);
    for (int i = 0, row = -2, col = 0; i < simpleDatePickers.size(); i++) {
      if ((i % monthColumns) == 0) {
        col = 0;
        row += 2;
      } else if (i > 0) {
        calendarGrid.setHTML(row, col, "&nbsp;");
        calendarGrid.setHTML(row + 1, col, "&nbsp;");
        calendarGrid.getCellFormatter().addStyleName(row, col, StyleMonthSeparator);
        calendarGrid.getCellFormatter().addStyleName(row + 1, col, StyleMonthSeparator);
        col += 1;
      }

      if (monthSelectorHeader.getParent() == null || simpleDatePickers.size() > 1) {
        if (i == 0 || (i % monthColumns) == 0) {
          calendarGrid.getRowFormatter().addStyleName(row, StyleMonthLabels);
          calendarGrid.getRowFormatter().addStyleName(row + 1, StyleMonthCell);
        }
        Widget w = null;
        if (i == 0 && monthSelectorHeader.getElement().getParentElement() == null)
          w = monthSelectorHeader;
        // calendarGrid.setWidget(row, col, monthSelectorHeader);
        else w = monthHeaders.get(i);
        // calendarGrid.setWidget(row, col, monthHeaders.get(i));

        DockPanel p = null;
        if (leftButtons.iterator().hasNext() && leftButtons.getParent() == null && col == 0) {
          p = leftButtons;
          p.add(w, DockPanel.WEST);
          p.setCellWidth(w, "100%");
          w = p;
          if (simpleDatePickers.size() == 1) {
            Iterator<Widget> it = p.iterator();
            while (it.hasNext()) {
              p.add(it.next(), DockPanel.WEST);
            }
          }
        }
        if (rightButtons.iterator().hasNext()
            && rightButtons.getParent() == null
            && ((i + 1) % monthColumns) == 0) {
          p = rightButtons;
          p.add(w, DockPanel.WEST);
          p.setCellWidth(w, "100%");
          w = p;
        }
        calendarGrid.setWidget(row, col, w);
      }

      calendarGrid.setWidget(row + 1, col, simpleDatePickers.get(i));
      calendarGrid.getColumnFormatter().addStyleName(i, "Month-" + i);
      simpleDatePickers.get(i).addValueChangeHandler(onDaySelected);
      col++;
    }
  }
  public VerticalPanel buildUsersListPanel() {
    DockPanel headerDockPanel = new DockPanel();
    headerDockPanel.add(deleteUserBtn, DockPanel.EAST);
    VerticalPanel spacer = new VerticalPanel();
    spacer.setWidth("2"); // $NON-NLS-1$
    headerDockPanel.add(spacer, DockPanel.EAST);
    headerDockPanel.add(addUserBtn, DockPanel.EAST);
    Label label = new Label("Users"); // $NON-NLS-1$
    headerDockPanel.add(label, DockPanel.WEST);
    headerDockPanel.setCellWidth(label, "100%"); // $NON-NLS-1$
    VerticalPanel userListPanel = new VerticalPanel();
    userListPanel.add(headerDockPanel);
    userListPanel.add(usersList);
    userListPanel.add(new Label(Messages.getString("filter"))); // $NON-NLS-1$
    userListPanel.add(filterTextBox);

    userListPanel.setCellHeight(usersList, "100%"); // $NON-NLS-1$
    userListPanel.setCellWidth(usersList, "100%"); // $NON-NLS-1$
    userListPanel.setHeight("100%"); // $NON-NLS-1$
    userListPanel.setWidth("100%"); // $NON-NLS-1$
    usersList.setHeight("100%"); // $NON-NLS-1$
    usersList.setWidth("100%"); // $NON-NLS-1$
    filterTextBox.setWidth("100%"); // $NON-NLS-1$
    deleteUserBtn.setEnabled(false);

    filterTextBox.addKeyboardListener(this);
    usersList.addChangeListener(this);
    addUserBtn.addClickListener(this);
    deleteUserBtn.addClickListener(this);
    return userListPanel;
  }
  public VerticalPanel buildAssignedRolesPanel() {
    DockPanel headerDockPanel = new DockPanel();

    VerticalPanel fieldsetPanel = new VerticalPanel();

    Label label = new Label(Messages.getString("assignedRoles")); // $NON-NLS-1$
    Label spacer = new Label(""); // $NON-NLS-1$

    headerDockPanel.add(label, DockPanel.WEST);
    headerDockPanel.setCellWidth(label, "100%"); // $NON-NLS-1$
    headerDockPanel.add(deleteRoleAssignmentBtn, DockPanel.EAST);
    VerticalPanel spacer2 = new VerticalPanel();
    spacer2.setWidth("2"); // $NON-NLS-1$
    headerDockPanel.add(spacer2, DockPanel.EAST);
    headerDockPanel.add(addRoleAssignmentBtn, DockPanel.EAST);

    headerDockPanel.add(spacer, DockPanel.WEST);
    headerDockPanel.setCellWidth(spacer, "100%"); // $NON-NLS-1$

    DockPanel assignedRolesPanel = new DockPanel();
    assignedRolesPanel.add(headerDockPanel, DockPanel.NORTH);
    assignedRolesPanel.add(assignedRolesList, DockPanel.CENTER);
    assignedRolesPanel.setCellHeight(assignedRolesList, "100%"); // $NON-NLS-1$
    assignedRolesPanel.setCellWidth(assignedRolesList, "100%"); // $NON-NLS-1$
    assignedRolesList.setHeight("100%"); // $NON-NLS-1$
    assignedRolesList.setWidth("100%"); // $NON-NLS-1$

    assignedRolesList.addChangeListener(this);
    deleteRoleAssignmentBtn.addClickListener(this);
    addRoleAssignmentBtn.addClickListener(this);

    fieldsetPanel.add(assignedRolesPanel);
    assignedRolesPanel.setWidth("100%"); // $NON-NLS-1$
    assignedRolesPanel.setHeight("100%"); // $NON-NLS-1$
    return fieldsetPanel;
  }
 public EmailAdminPanel() {
   dockPanel = new DockPanel();
   actionBar = new ActionBar();
   FlexTable mainPanel = new FlexTable();
   HorizontalPanel hPanel = new HorizontalPanel();
   SimplePanel hSpacer = new SimplePanel();
   hSpacer.setWidth("10px");
   hPanel.add(hSpacer);
   hPanel.add(new Label(Messages.getString("emailSmtpServer")));
   mainPanel.setWidget(0, 0, hPanel);
   hPanel = new HorizontalPanel();
   hSpacer = new SimplePanel();
   hSpacer.setWidth("10px");
   hPanel.add(hSpacer);
   hPanel.add(createEmailPanel());
   mainPanel.setWidget(1, 0, hPanel);
   dockPanel.add(mainPanel, DockPanel.CENTER);
   dockPanel.setCellWidth(mainPanel, "100%");
   saveButton = new Button(Messages.getString("save"));
   progressIndicator = new ProgressIndicatorWidget(saveButton);
   actionBar.addWidget(progressIndicator, HorizontalPanel.ALIGN_RIGHT);
   dockPanel.add(actionBar, DockPanel.SOUTH);
   dockPanel.setCellVerticalAlignment(actionBar, HorizontalPanel.ALIGN_BOTTOM);
   dockPanel.setCellWidth(actionBar, "100%");
   dockPanel.setCellHeight(actionBar, "100%");
   setWidget(dockPanel);
   dockPanel.setHeight("100%");
   dockPanel.setWidth("100%");
   this.setWidth("100%");
   this.setHeight("100%");
   if (isIE()) {
     saveButton.setEnabled(false);
   } else {
     actionBar.collapse(1);
   }
 }
예제 #5
0
  protected void layoutButtons(String distribution) {
    navButtonsBottom.clear();
    navButtonsTop.clear();
    DockPanel[] panels = {
      topButtonsRow0,
      topButtonsRow1,
      topButtonsRow2,
      bottomButtonsRow0,
      bottomButtonsRow1,
      bottomButtonsRow2,
      leftButtons,
      rightButtons
    };
    String s[] = distribution.split("[;:,]");

    Widget w = null, m = null;
    for (int i = 0; i < panels.length && i < s.length; i++) {
      DockPanel p = panels[i];
      p.clear();

      if (s[i].length() == 0) continue;

      for (int j = 0; j < s[i].length(); j++) {
        if ((w = getButton(s[i], j)) != null) {
          p.add(w, p != rightButtons ? DockPanel.WEST : DockPanel.EAST);
        }
        if (j == s[i].length() / 2) m = w;
      }

      if (!p.iterator().hasNext()) continue;

      p.setWidth("100%");
      if (p != leftButtons && p != rightButtons) {
        if (m != null) {
          p.setCellWidth(m, "100%");
          m.setWidth("100%");
        }
      }
      if (i < 3) navButtonsTop.add(p, DockPanel.NORTH);
      else if (i < 6) navButtonsBottom.add(p, DockPanel.NORTH);

      if (i < 6) p.addStyleName(StyleCButtonsRow + (i % 3));
    }
  }
예제 #6
0
  public TitlePanel() {
    text = new HTML(hardCodedText);
    text.setStyleName("title-text");

    // initialize the DockPanel
    dockPanel = new DockPanel();
    // horizontalPanel = new HorizontalPanel();
    if (dockPanel != null) {
      // indentation/border between text and frame
      dockPanel.setSpacing(3);

      dockPanel.add(text, DockPanel.CENTER);
      dockPanel.setCellHorizontalAlignment(text, DockPanel.ALIGN_CENTER);
      dockPanel.setCellVerticalAlignment(text, DockPanel.ALIGN_MIDDLE);
      dockPanel.setWidth("100%");
      dockPanel.setCellWidth(text, "100%");

      dockPanel.setStyleName("title-panel");
    } else {
      System.out.println("Unable to create dockPanel panels");
      throw new NullPointerException("Unable to initialize the dockPanel panel");
    }
  }
예제 #7
0
 private void collapsePanel() {
   formPanel.setVisible(false);
   eastPanel.setVisible(false);
   DockPanel dock = (DockPanel) getWidget();
   dock.setCellWidth(eastPanel, "0");
 }
예제 #8
0
 private void expandPanel() {
   formPanel.setVisible(true);
   eastPanel.setVisible(true);
   DockPanel dock = (DockPanel) getWidget();
   dock.setCellWidth(eastPanel, "300px");
 }