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);
  }
  protected void initUI() {
    TabItem west = (TabItem) Registry.get(AppView.TAB_STORAGE);
    ContentPanel clusters = new ContentPanel();
    clusters.setAnimCollapse(false);
    clusters.setHeading("Storage Engines");
    clusters.addListener(
        Events.Expand,
        new Listener<ComponentEvent>() {
          public void handleEvent(ComponentEvent be) {
            Dispatcher.get().dispatch(AppEvents.NAV_STORAGE);
          }
        });

    storageEnginesPanel = new StorageEnginesPanel();
    storageEnginesPanel
        .getGrid()
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener<StorageEngine>() {
              @Override
              public void selectionChanged(SelectionChangedEvent<StorageEngine> se) {
                AppEvent evt = new AppEvent(AppEvents.VIEW_STORAGE_ENGINE, se.getSelectedItem());
                Dispatcher.forwardEvent(evt);
              }
            });
    clusters.add(storageEnginesPanel, new BorderLayoutData(LayoutRegion.CENTER));

    west.add(clusters);
  }
  private void initTabs() {
    m_certificatesTab = new CertificatesTab(m_currentSession);
    if (m_certificatesConfig != null) {
      m_certificatesConfig.add(m_certificatesTab);
      m_certificatesConfig.layout();
    }

    m_snapshotsTab = new SnapshotsTab(m_currentSession, m_servicesTree);
    if (m_snapshotsConfig != null) {
      m_snapshotsConfig.add(m_snapshotsTab);
      m_snapshotsConfig.layout();
    }

    m_permissionsTab = new PermissionsTab(m_currentSession);
    if (m_permissionsConfig != null) {
      m_permissionsConfig.add(m_permissionsTab);
      m_permissionsConfig.layout();
    }
  }
Example #4
0
  Widget initwidget() {
    VerticalPanel v = new VerticalPanel();
    v.setSpacing(2);

    TabPanel tabpanel = new TabPanel();
    tabpanel.setPlain(true);
    tabpanel.setHeight(450);
    tabpanel.setWidth(760);
    TabItem t1 = new TabItem();
    t1.setText("配偶");
    VerticalPanel vt1 = new VerticalPanel();
    vt1.setSpacing(2);

    vt1.add(createbcode_Spouse_Form());
    t1.add(vt1);
    t1.setScrollMode(Scroll.AUTO);

    TabItem t2 = new TabItem();
    t2.setText("家庭成员");
    VerticalPanel vt2 = new VerticalPanel();
    vt2.setSpacing(2);
    vt2.add(create_bcode_famify_Grid());
    t2.add(vt2);
    t2.setScrollMode(Scroll.AUTO);

    TabItem t3 = new TabItem();
    t3.setText("紧急联络方式");
    VerticalPanel vt3 = new VerticalPanel();
    vt3.setSpacing(2);
    vt3.add(create_bcode_contact_Grid());
    t3.add(vt3);
    t3.setScrollMode(Scroll.AUTO);

    tabpanel.add(t3);
    tabpanel.add(t2);
    tabpanel.add(t1);

    v.add(tabpanel);

    this.add(v);
    return null;
  }
  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;
  }
Example #6
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;
  }
Example #7
0
  private TabItem createRegisterTab() {
    TabItem tabItem = new TabItem("Register");

    FormPanel form = new FormPanel();
    form.setFrame(false);
    form.setHeading("Create a new account.");
    form.setWidth(350);
    form.setLayout(new FlowLayout());

    FieldSet fieldSet = new FieldSet();

    FormLayout layout = new FormLayout();
    layout.setLabelWidth(75);
    fieldSet.setLayout(layout);

    final TextField<String> nameField = new TextField<String>();
    nameField.setFieldLabel("Name");
    fieldSet.add(nameField);

    final TextField<String> passField = new TextField<String>();
    passField.setPassword(true);
    passField.setFieldLabel("Password");
    fieldSet.add(passField);

    final TextField<String> emailField = new TextField<String>();
    emailField.setFieldLabel("Email");
    fieldSet.add(emailField);

    form.add(fieldSet);
    form.setButtonAlign(HorizontalAlignment.CENTER);
    Button registerButton = new Button("Register");
    form.addButton(registerButton);

    registerButton.addListener(
        Events.Select,
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            String name = nameField.getValue();
            String pass = passField.getValue();
            String email = emailField.getValue();

            if (name == null || pass == null || email == null) {
              Info.display(
                  "Incorrect register data", "Name, password and email must not be empty!");
              return;
            }

            userService.register(
                name,
                pass,
                email,
                new AsyncCallback<UserLoginRegisterResponse>() {
                  // @Override
                  public void onFailure(Throwable caught) {
                    Info.display("Error while registering account!", caught.getMessage());
                  }
                  // @Override
                  public void onSuccess(UserLoginRegisterResponse result) {
                    if (!result.isSuccess()) {
                      Info.display("The account not registered!", result.getMessage());
                    } else {
                      User user = result.getUser();
                      Info.display(
                          "Registered :)",
                          "Registered successfuly. You've been automaticly logged in as "
                              + user.getName()
                              + " level: "
                              + user.getUserType());
                      hide();
                      tabs.init(user);
                    }
                  }
                });
          }
        });

    tabItem.add(form);
    return tabItem;
  }
Example #8
0
  private TabItem createLoginTab() {
    TabItem tabItem = new TabItem("Login");

    FormPanel form = new FormPanel();
    form.setHeading("Login using existing user.");
    form.setWidth(350);
    form.setLayout(new FlowLayout());

    FieldSet fieldSet = new FieldSet();

    FormLayout layout = new FormLayout();
    layout.setLabelWidth(75);
    fieldSet.setLayout(layout);

    final TextField<String> fieldName = new TextField<String>();
    fieldName.setFieldLabel("Name");
    fieldSet.add(fieldName);

    final TextField<String> fieldPassword = new TextField<String>();
    fieldPassword.setPassword(true);
    fieldPassword.setFieldLabel("Password");
    fieldSet.add(fieldPassword);

    form.add(fieldSet);
    form.setButtonAlign(HorizontalAlignment.CENTER);
    Button loginButton = new Button("Login");
    form.addButton(loginButton);

    loginButton.addListener(
        Events.Select,
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            final String name = fieldName.getValue();
            String pass = fieldPassword.getValue();

            if (name == null || pass == null) {
              Info.display("Loggin in Error!", "Name or password is empty!");
              return;
            }

            // Sprawdza usera
            userService.login(
                name,
                pass,
                new AsyncCallback<UserLoginRegisterResponse>() {
                  public void onSuccess(UserLoginRegisterResponse result) {
                    if (!result.isSuccess()) {
                      Info.display("Couldn't log in", result.getMessage());
                    } else {
                      User user = result.getUser();
                      Info.display(
                          "Logged in",
                          "Logged in successfuly as "
                              + user.getName()
                              + " level: "
                              + user.getUserType());
                      hide();
                      tabs.init(user);
                    }
                  }

                  public void onFailure(Throwable caught) {
                    Info.display("Error while loggin in.", caught.getMessage());
                  };
                });
          }
        });
    tabItem.add(form);
    return tabItem;
  }
Example #9
0
  public ContentPanel initWeiget() {
    // ----

    // ----
    ContentPanel panel = new ContentPanel();
    panel.setLayout(new BorderLayout());
    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 150);
    westData.setSplit(true);
    westData.setCollapsible(true);
    westData.setMargins(new Margins(0));
    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(5, 0, 5, 0));

    panel.add(CreateCcodeLeftPanel(), westData);

    TabPanel tabpanel = new TabPanel();

    tabpanel.setWidth(450);
    tabpanel.setHeight(450);
    tabpanel.setAutoHeight(true);
    TabItem normal = new TabItem("基本信息");
    normal.add(CreateCCodeDetailPanel());

    ContentPanel branchorg = new ContentPanel(); // createCcodebranchorgaddPanel
    TabItem bangogndizhi = new TabItem("办公地点和分支机构");

    branchorg.setHeight(400);
    branchorg.setHeaderVisible(false);
    branchorg.setLayout(new RowLayout(Orientation.VERTICAL));
    branchorg.add(createOfficePanel(), new RowData(1, 0.5));
    branchorg.add(createCcodebranchorgaddPanel(), new RowData(1, 0.5));
    bangogndizhi.add(branchorg);

    TabItem lianxiren = new TabItem("联系人信息");
    lianxiren.add(createLinkManPanel());

    final TabItem searchframe = new TabItem("查询相关信息");
    searchframe.setAutoHeight(true);
    final BaseSerchHtml bsh = new BaseSerchHtml();
    searchframe.add(bsh.getSearchFrame());
    searchframe.addListener(
        Events.Select,
        new Listener() {

          @Override
          public void handleEvent(BaseEvent be) {
            bsh.SearchHtml(
                store.getValue("cname") == null ? "" : store.getValue("cname").toString());
          }
        });
    /** store 换行的时候进行关键字的搜索 */
    store.addBaseStoreListener(
        BaseStoreEvent.EventType.ROW_CHANGED,
        new BaseStoreListener() {

          @Override
          public void BaseStoreEventHandle(BaseStoreEvent evt) {
            if (evt.getEventType() == BaseStoreEvent.EventType.ROW_CHANGED) {

              if (searchframe.isVisible()) {
                bsh.SearchHtml(
                    store.getValue("cname") == null ? "" : store.getValue("cname").toString());
              }
            }
          }

          @Override
          public void onBrowserEvent(Event event) {
            // TODO Auto-generated method stub

          }
        });
    tabpanel.add(normal);
    tabpanel.add(bangogndizhi);
    tabpanel.add(lianxiren);
    tabpanel.add(searchframe);

    panel.add(tabpanel, centerData);

    registerMainStore(store);
    registerStore(store);
    return panel;
  }
  @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();
            }
          }
        });
  }