protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    setId("settings-tabs-wrapper");
    setLayout(new FitLayout());

    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    m_tabsPanel.setBodyBorder(false);
    m_tabsPanel.setStyleAttribute("padding-top", "5px");

    m_snapshotsConfig = new TabItem(MSGS.settingsSnapshots());
    m_snapshotsConfig.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.snapshots()));
    m_snapshotsConfig.setBorders(true);
    m_snapshotsConfig.setLayout(new FitLayout());
    m_snapshotsConfig.add(m_snapshotsTab);
    m_tabsPanel.add(m_snapshotsConfig);

    m_certificatesConfig = new TabItem(MSGS.settingsAddSSLCertificates());
    m_certificatesConfig.setBorders(true);
    m_certificatesConfig.setLayout(new FitLayout());
    m_certificatesConfig.add(m_certificatesTab);
    m_tabsPanel.add(m_certificatesConfig);

    m_permissionsConfig = new TabItem(MSGS.permissions());
    m_permissionsConfig.setBorders(true);
    m_permissionsConfig.setLayout(new FitLayout());
    m_permissionsConfig.add(m_permissionsTab);
    m_tabsPanel.add(m_permissionsConfig);

    add(m_tabsPanel);
  }
Пример #2
0
  private TabItem createFaceTabItem() {
    Viewport viewport = new Viewport();
    viewport.setLayout(new VBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH));

    headerHtml.setStyleName("studentAccount");
    viewport.add(headerHtml);

    VBoxLayoutData flex = new VBoxLayoutData(10, 0, 0, 0);
    flex.setFlex(1);
    studentDataForm.setScrollMode(Style.Scroll.AUTOY);
    viewport.add(studentDataForm, flex);

    TabItem faceTabItem = new TabItem("Учетная карточка студента");
    faceTabItem.setLayout(new FitLayout());
    faceTabItem.add(viewport);

    return faceTabItem;
  }
Пример #3
0
  public TabItem getNewPortletTab(Portlet portlet, int index, int column) {
    TabItem tab = new TabItem(getTabLabel(portlet, index, column));
    tab.setLayout(new FitLayout());
    tab.setClosable(true);
    tab.setScrollMode(Scroll.NONE);
    tab.add(portlet);

    if (portlet instanceof AppPortlet) {
      final AppPortlet appPortlet = (AppPortlet) portlet;
      tab.addListener(
          Events.Close,
          new Listener<BaseEvent>() {
            public void handleEvent(BaseEvent be) {
              if (be.getType().getEventCode() == Events.Close.getEventCode()) {
                appPortlet.closePortlet();
              }
            };
          });
    }

    return tab;
  }
  @Inject
  public ProjectIndicatorsContainer(
      ProjectSiteGridPanel siteEditor,
      SiteMap siteMap,
      final DesignPanel designPanel,
      Dispatcher service,
      EventBus eventBus) {

    this.siteEditor = siteEditor;
    this.siteMap = siteMap;
    this.designPanel = designPanel;
    this.service = service;
    this.eventBus = eventBus;

    BorderLayout borderLayout = new BorderLayout();
    borderLayout.setContainerStyle("x-border-layout-ct main-background");
    setLayout(borderLayout);

    ContentPanel mainPanel = new ContentPanel();
    mainPanel.setIcon(null);
    mainPanel.setLayout(new FitLayout());
    mainPanel.setSize(600, 300);

    // setIcon(IconImageBundle.ICONS.design());
    // map tab panel
    tabPanel = new TabPanel();
    tabPanel.setPlain(true);

    // map tab item
    mapTabItem = new TabItem("map");
    mapTabItem.setLayout(new FitLayout());
    mapTabItem.setEnabled(false);
    mapTabItem.setAutoHeight(true);
    mapTabItem.setEnabled(true);
    mapTabItem.add(siteMap);
    tabPanel.add(mapTabItem);

    // sites tab item
    sitesTabItem = new TabItem("sites");
    sitesTabItem.setLayout(new FitLayout());
    sitesTabItem.setEnabled(false);
    sitesTabItem.setAutoHeight(true);
    sitesTabItem.setEnabled(true);
    sitesTabItem.add(siteEditor);
    tabPanel.add(sitesTabItem);

    // buttons for indicator view
    newIndicatorButton = new Button("new indicator");
    newGroupButton = new Button("new group");
    reloadButton = new Button("reload button");

    mainPanel.add(newIndicatorButton);
    mainPanel.add(newGroupButton);
    mainPanel.add(reloadButton);

    BorderLayoutData centerLayout = new BorderLayoutData(Style.LayoutRegion.CENTER);
    centerLayout.setMargins(new Margins(0, 0, 0, 0));
    centerLayout.setSplit(true);
    centerLayout.setCollapsible(true);

    BorderLayoutData layout = new BorderLayoutData(Style.LayoutRegion.EAST);
    layout.setSplit(true);
    layout.setCollapsible(true);
    layout.setSize(375);
    layout.setMargins(new Margins(0, 0, 0, 5));

    add(designPanel, centerLayout);
    designPanel
        .getMappedIndicator()
        .addValueChangeHandler(
            new ValueChangeHandler<IndicatorDTO>() {

              @Override
              public void onValueChange(ValueChangeEvent<IndicatorDTO> event) {
                onMappedIndicatorChanged(event.getValue());
              }
            });

    add(tabPanel, layout);
    // setHeading(I18N.CONSTANTS.design() + " - " );

    siteEditor.addActionListener(
        new Listener<ComponentEvent>() {

          @Override
          public void handleEvent(ComponentEvent be) {
            if (UIActions.add.equals(be.getComponent().getItemId())) {
              addSite();
            }
          }
        });
  }