Package org.zkoss.zul

Examples of org.zkoss.zul.Tab


     * Check, if all tabs with data binded components are created So we work
     * with spring BeanCreation we must check a little bit deeper, because
     * the Controller are preCreated ? After that, go back to the
     * current/selected tab.
     */
    Tab currentTab = tabbox_ArticleMain.getSelectedTab();

    if (getArticleDetailCtrl().getBinder() == null) {
      Events.sendEvent(new Event(Events.ON_SELECT, tabArticleDetail, null));
    }

    // go back to selected tab
    currentTab.setSelected(true);

    // Check which button is clicked and calculate the rowIndex
    if (((ForwardEvent) event).getOrigin().getTarget() == btnNext) {
      if (index < (blml.size() - 1)) {
        index = index + 1;
View Full Code Here


    self.setAttribute("controller", this, false);

    // Set the Dashboard unClosable
    try {
      Component cmp = (Component) windowDashboard.getParent().getParent().getParent();
      Tab menuTab = (Tab) cmp.getFellowIfAny("tab_menu_Item_Home", false);
      menuTab.setClosable(false);
    } catch (Exception e) {
      ZksampleMessageUtils.showErrorMessage(e.toString());
      e.printStackTrace();
    }
View Full Code Here

        /**
         * Check if the tab is already opened than select them and<br>
         * go out of here. If not than create them.<br>
         */

        Tab checkTab = null;
        try {
          // checkTab = (Tab) tabs.getFellow(tabName);
          checkTab = (Tab) tabs.getFellow("tab_" + tabID.trim());
          checkTab.setSelected(true);
        } catch (final ComponentNotFoundException ex) {
          // Ignore if can not get tab.
        }

        if (checkTab == null) {

          final Tab tab = new Tab();
          tab.setId("tab_" + tabID.trim());

          if (tabLabel != null) {
            tab.setLabel(tabLabel.trim());
          } else {
            tab.setLabel(tabLabel.trim());
          }
          tab.setClosable(true);
          tab.setParent(tabs);

          final Tabpanels tabpanels = (Tabpanels) center.getFellow("divCenter").getFellow("tabBoxIndexCenter").getFellow("tabsIndexCenter")
              .getFellow("tabpanelsBoxIndexCenter");
          final Tabpanel tabpanel = new Tabpanel();
          tabpanel.setHeight("100%");
          tabpanel.setStyle("padding: 0px;");
          tabpanel.setParent(tabpanels);

          /*
           * create the page and put it in the tabs area
           */
          Executions.createComponents(zulFilePathName, tabpanel, null);
          tab.setSelected(true);
        }
      } else {
        /* get an instance of the borderlayout defined in the zul-file */
        final Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
        /* get an instance of the searched CENTER layout area */
 
View Full Code Here

        final Center center = bl.getCenter();

        final Tabs tabs = (Tabs) center.getFellow("divCenter").getFellow("tabBoxIndexCenter").getFellow("tabsIndexCenter");

        // Check if the tab is already open, if not than create them
        Tab checkTab = null;
        try {
          checkTab = (Tab) tabs.getFellow("tab_" + this.getId());
          checkTab.setSelected(true);
        } catch (final ComponentNotFoundException ex) {
          // Ignore if can not get tab.
        }

        if (checkTab == null) {

          final Tab tab = new Tab();
          tab.setId("tab_" + this.getId());
          tab.setLabel(this.getLabel().trim());
          tab.setClosable(true);

          tab.setParent(tabs);

          final Tabpanels tabpanels = (Tabpanels) center.getFellow("divCenter").getFellow("tabBoxIndexCenter").getFellow("tabsIndexCenter").getFellow("tabpanelsBoxIndexCenter");
          final Tabpanel tabpanel = new Tabpanel();
          tabpanel.setHeight("100%");
          tabpanel.setStyle("padding: 0px;");
          tabpanel.setParent(tabpanels);

          Executions.createComponents(getZulNavigation(), tabpanel, null);
          tab.setSelected(true);
        }
      } else {
        /* get an instance of the borderlayout defined in the zul-file */
        final Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
        /* get an instance of the searched CENTER layout area */
 
View Full Code Here

        final Center center = bl.getCenter();

        final Tabs tabs = (Tabs) center.getFellow("divCenter").getFellow("tabBoxIndexCenter").getFellow("tabsIndexCenter");

        // Check if the tab is already open, if not than create them
        Tab checkTab = null;
        try {
          checkTab = (Tab) tabs.getFellow("tab_" + this.getId());
          checkTab.setSelected(true);
        } catch (final ComponentNotFoundException ex) {
          // Ignore if can not get tab.
        }

        if (checkTab == null) {
          final Tab tab = new Tab();
          tab.setId("tab_" + this.getId());
          tab.setLabel(this.getLabel().trim());
          tab.setClosable(true);

          tab.setParent(tabs);

          final Tabpanels tabpanels = (Tabpanels) center.getFellow("divCenter").getFellow("tabBoxIndexCenter").getFellow("tabsIndexCenter").getFellow("tabpanelsBoxIndexCenter");
          final Tabpanel tabpanel = new Tabpanel();
          tabpanel.setHeight("100%");
          tabpanel.setStyle("padding: 0px;");
          tabpanel.setParent(tabpanels);

          Executions.createComponents(getZulNavigation(), tabpanel, null);
          tab.setSelected(true);
        }
      } else {
        /* get an instance of the borderlayout defined in the zul-file */
        final Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
        /* get an instance of the searched CENTER layout area */
 
View Full Code Here

  }
 
  public void setCurrentSheetByName(String name) {
    int j = 0;
    for (final Iterator it = tabs.getChildren().iterator(); it.hasNext(); ++j) {
      final Tab tab = (Tab) it.next();
      if (name.equals(tab.getLabel())) {
        setCurrentSheet(j);
        break;
      }
    }
  }
View Full Code Here

  /**
   * Add a sheet name to tabbox
   * @param name
   */
  public void addSheet(String name) {
    Tab tab = new Tab(name);
    tab.setContext(sheetContextMenu);
    tab.setParent(tabs);
  }
View Full Code Here

   
    tabs.getChildren().clear();

    List<String> names = getDesktopWorkbenchContext().getWorkbookCtrl().getSheetNames();
    for (String name : names) {
      final Tab tab = new Tab(name);
      tab.addEventListener(org.zkoss.zk.ui.event.Events.ON_RIGHT_CLICK, new EventListener() {
      public void onEvent(Event event) throws Exception {           
        if (tabbox.getSelectedTab().getLabel() != tab.getLabel())
          setSelectedTab(tab);
 
        protectSheet.setChecked(getDesktopWorkbenchContext().getWorkbookCtrl().isSheetProtect());
        MouseEvent evt = (MouseEvent)event;
        sheetContextMenu.open(evt.getPageX(), evt.getPageY());
      }});
      tab.setParent(tabs);
      if (seldIndex == tab.getIndex()) {
        setSelectedTabDirectly(tab);
      }
    }
  }
View Full Code Here

                    order);

            showSyncInfo();

            // Reload order info in all tabs
            Tab previousTab = orderController.getCurrentTab();
            orderController.initEdit(order);
            orderController.selectTab(previousTab.getId());
        } catch (ConnectorException e) {
            messagesForUser.showMessage(Level.ERROR,
                    _("Failed: {0}", e.getMessage()));
        } catch (WebApplicationException e) {
            LOG.info(e);
View Full Code Here

        return newUser;
    }

    private void validateConstraints() {
        Tab selectedTab = personalDataTab;
        try {
            validatePersonalDataTab();

            selectedTab = assignedCriteriaTab;
            validateAssignedCriteriaTab();

            selectedTab = costCategoryAssignmentTab;
            validateCostCategoryAssigmentTab();

            //TODO: check 'calendar' tab
        }
        catch (WrongValueException e) {
            selectedTab.setSelected(true);
            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Tab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.