Package org.rhq.coregui.client.components.tab

Examples of org.rhq.coregui.client.components.tab.NamedTab


    }

    private TabSet getDetailsTabSet(ListGridRecord record) {
        TabSet tabset = new NamedTabSet();

        Tab generalTab = new NamedTab(new ViewName("general", MSG.common_title_generalProp()));
        generalTab.setPane(getDetailsTableForAlert(record));

        Tab conditionsTab = new NamedTab(new ViewName("conditions", MSG.view_alert_common_tab_conditions()));
        conditionsTab.setPane(getConditionsForAlert(record));

        Tab notificationsTab = new NamedTab(new ViewName("notifications", MSG.view_alert_common_tab_notifications()));
        notificationsTab.setPane(getNotificationsForAlert(record));

        tabset.addTab(generalTab);
        tabset.addTab(conditionsTab);
        tabset.addTab(notificationsTab);
View Full Code Here


        super();
        setHeight100();
        setWidth100();
        setLayoutTopMargin(8);
        tabset = new NamedTabSet();
        NamedTab table = new NamedTab(tableTabInfo.name);
        table.addTabSelectedHandler(new TabSelectedHandler() {
            public void onTabSelected(TabSelectedEvent event) {
                CoreGUI.goToView(VIEW_PATH);
            }
        });

        NamedTab settings = new NamedTab(settingsTabInfo.name);
        settings.addTabSelectedHandler(new TabSelectedHandler() {
            public void onTabSelected(TabSelectedEvent event) {
                CoreGUI.goToView(VIEW_PATH + "/" + settingsTabInfo.name);
            }
        });

        alerts = new NamedTab(alertsTabInfo.name);
        alerts.addTabSelectedHandler(new TabSelectedHandler() {
            public void onTabSelected(TabSelectedEvent event) {
                CoreGUI.goToView(VIEW_PATH + "/" + alertsTabInfo.name);
            }
        });
View Full Code Here

        tabSet.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, buttons );

        tabSet.addTabSelectedHandler(new TabSelectedHandler() {
            public void onTabSelected(TabSelectedEvent tabSelectedEvent) {
                NamedTab selectedTab = tabSet.getTabByTitle(tabSelectedEvent.getTab().getTitle());

                /*
                 * do not record history item if initially loading the DashboardsView.  if the selectedDashboardView is
                 * null, suppression will prevent redirection from #Dashboards to #Dashboards/dashboardId,
                 * which would require the user to hit the back button twice to return to the previous page.
                 */
                if (selectedDashboardView != null) {
                    Log.debug(" ***** selectedTab: " + selectedTab.getName() + ", " + selectedTab.getTitle());
                    CoreGUI.goToView(LinkManager.getDashboardLink(Integer.valueOf(selectedTab.getName())), true);
                }

                selectedDashboardView = (DashboardView) selectedTab.getPane();
                selectedDashboard = selectedDashboardView.getDashboard();
                editButton.setTitle(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
                selectedDashboardView.setEditMode(editMode);

                // If re-selecting a Dashboard, make sure it, and its portlets, are up to date
                if (selectedDashboardView.isDrawn()) {
                    // I think this should work with markForRedraw but for some reason it does not
                    selectedDashboardView.redraw();
                }
            }
        });

        for (Dashboard dashboard : dashboards) {
            String dashboardName = String.valueOf(dashboard.getId());
            String dashboardTitle = dashboard.getName();
            DashboardView dashboardView = new DashboardView(this, dashboard);
            Tab tab = new NamedTab(new ViewName(dashboardName, dashboardTitle), null);
            tab.setPane(dashboardView);
            tab.setCanClose(true);

            tabSet.addTab(tab);
            if (dashboard.getName().equals(selectedTabName)) {
                tabSet.selectTab(tab);
            }
View Full Code Here

            public void onSuccess(Dashboard result) {
                String dashboardName = String.valueOf(result.getId());
                String dashboardTitle = result.getName();
                dashboardsByName.put(dashboardTitle, result); // update map so name can not be reused
                DashboardView dashboardView = new DashboardView(DashboardsView.this, result);
                NamedTab tab = new NamedTab(new ViewName(dashboardName, dashboardTitle), null);
                tab.setPane(dashboardView);
                tab.setCanClose(true);

                editMode = true;

                tabSet.addTab(tab);
                tabSet.selectTab(tab);
View Full Code Here

        }

        NamedTab[] tabs = tabSet.getTabs();

        // if nothing selected or pathtab does not exist, default to the first tab
        NamedTab selectedTab = tabs[0];
        selectedTabName = selectedTab.getName();

        if (!viewPath.isEnd()) {
            String pathTabName = viewPath.getCurrent().getPath();

            for (NamedTab tab : tabSet.getTabs()) {
                if (tab.getName().equals(pathTabName)) {
                    selectedTab = tab;
                    selectedTabName = pathTabName;
                    break;
                }
            }
        }

        if (!selectedTab.equals(tabSet.getSelectedTab())) {
            tabSet.selectTab(selectedTab);

        } else if (viewPath.isRefresh()) {
            refresh();
        }
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.tab.NamedTab

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.