Examples of TwoLevelTab


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

     * @param viewPath the view path, which may have additional view items to be rendered
     */
    public void selectTab(String tabName, String subtabName, ViewPath viewPath) {

        try {
            TwoLevelTab tab = (tabName != null) ? this.tabSet.getTabByName(tabName) : null;
            SubTab subtab = null;

            // if the requested tab is not available for the tabset then select the default tab/subtab. Fire
            // an event in order to navigate to the new path
            if (tab == null || tab.getDisabled()) {
                this.tabSet.setIgnoreSelectEvents(false);
                subtab = selectDefaultTabAndSubTab();
                return;
            }

            // the tab is available, now get the subtab
            subtab = (subtabName != null) ? tab.getSubTabByName(subtabName) : tab.getDefaultSubTab();

            // due to our attempt to perform sticky tabbing we may request an invalid subtab when
            // switching resources. If the requested subtab is not available the select the default subtab
            // for the tab. Fire an event in order to navigate to the new path.
            if (subtab == null || tab.getLayout().isSubTabDisabled(subtab)) {
                this.tabSet.setIgnoreSelectEvents(false);
                subtab = selectDefaultSubTab(tab);
                return;
            }

            // the requested tab/subtab are valid, continue with this path

            // select the tab and subTab (we are suppressing event handling, so the smartgwt fired event is ignored,
            // alowing us to perform the desired subtab management below)
            this.tabSet.selectTab(tab);
            // this call adds the subtab canvas as a member of the subtablayout
            // don't show the subtab canvas until after we perform any necessary rendering.
            tab.getLayout().selectSubTab(subtab, false);

            // get the target canvas
            Canvas subView = subtab.getCanvas();

            // if this is a bookmarkable view then further rendering is deferred to its renderView method. This
View Full Code Here

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

            Log.warn("Failed to select tab " + tabName + "/" + subtabName + ".", e);
        }
    }

    private SubTab selectDefaultTabAndSubTab() {
        TwoLevelTab tab = this.tabSet.getDefaultTab();
        if (tab == null) {
            throw new IllegalStateException("No default tab is defined.");
        }

        return selectDefaultSubTab(tab);
View Full Code Here

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

    }

    private static TwoLevelTab[] createTabs() {
        List<TwoLevelTab> tabs = new ArrayList<TwoLevelTab>();

        TwoLevelTab summaryTab = new TwoLevelTab(new ViewName(Tab.Summary.NAME, MSG.common_title_summary()),
            ImageManager.getResourceIcon(ResourceCategory.SERVICE, AvailabilityType.UP));
        SubTab summaryActivity = new SubTab(summaryTab, new ViewName(Tab.Summary.SubTab.ACTIVITY,
            MSG.view_tabs_common_activity()), null);
        SubTab summaryTimeline = new SubTab(summaryTab, new ViewName(Tab.Summary.SubTab.TIMELINE,
            MSG.view_tabs_common_timeline()), null);
        summaryTab.registerSubTabs(summaryActivity, summaryTimeline);
        tabs.add(summaryTab);

        TwoLevelTab inventoryTab = new TwoLevelTab(new ViewName(Tab.Inventory.NAME, MSG.view_tabs_common_inventory()),
            IconEnum.INVENTORY_SUMMARY);
        SubTab inventoryChildren = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.CHILDREN,
            MSG.view_tabs_common_child_resources()), null);
        SubTab inventoryChildHistory = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.CHILD_HISTORY,
            MSG.view_tabs_common_child_history()), null);
        SubTab inventoryConn = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.CONNECTION_SETTINGS,
            MSG.view_tabs_common_connectionSettings()), null);
        SubTab inventoryConnHistory = new SubTab(inventoryTab, PluginConfigurationHistoryListView.VIEW_ID, null);
        SubTab inventoryGroups = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.GROUPS,
            MSG.view_tabs_common_groups()), null);
        SubTab inventoryAgent = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.AGENT,
            MSG.view_tabs_common_agent()), null);
        inventoryTab.registerSubTabs(inventoryChildren, inventoryChildHistory, inventoryConn, inventoryConnHistory,
            inventoryGroups, inventoryAgent);
        tabs.add(inventoryTab);

        TwoLevelTab alertsTab = new TwoLevelTab(new ViewName(Tab.Alerts.NAME, MSG.common_title_alerts()),
            IconEnum.ALERT_DEFINITIONS);
        SubTab alertHistory = new SubTab(alertsTab, new ViewName(Tab.Alerts.SubTab.HISTORY,
            MSG.view_tabs_common_history()), null);
        SubTab alertDef = new SubTab(alertsTab, new ViewName(Tab.Alerts.SubTab.DEFINITIONS,
            MSG.common_title_definitions()), null);
        alertsTab.registerSubTabs(alertDef, alertHistory);
        tabs.add(alertsTab);

        TwoLevelTab monitoringTab = new TwoLevelTab(
            new ViewName(Tab.Monitoring.NAME, MSG.view_tabs_common_monitoring()), IconEnum.SUSPECT_METRICS);

        SubTab monitorMetrics = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.METRICS,
            MSG.view_tabs_common_metrics()), null);
        SubTab monitorTraits = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.TRAITS,
            MSG.view_tabs_common_traits()), null);
        SubTab monitorSched = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.SCHEDULES,
            MSG.view_tabs_common_schedules()), null);
        SubTab monitorCallTime = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.CALL_TIME,
            MSG.view_tabs_common_calltime()), null);
        monitoringTab.registerSubTabs(monitorMetrics, monitorTraits, monitorSched, monitorCallTime);
        tabs.add(monitoringTab);

        TwoLevelTab eventsTab = new TwoLevelTab(new ViewName(Tab.Events.NAME, MSG.view_tabs_common_events()),
            IconEnum.EVENTS);
        SubTab eventHistory = new SubTab(eventsTab, new ViewName(Tab.Events.SubTab.HISTORY,
            MSG.view_tabs_common_history()), null);
        eventsTab.registerSubTabs(eventHistory);
        tabs.add(eventsTab);

        TwoLevelTab operationsTab = new TwoLevelTab(new ViewName(Tab.Operations.NAME, MSG.common_title_operations()),
            IconEnum.RECENT_OPERATIONS);
        SubTab operationsSchedules = new SubTab(operationsTab, new ViewName(Tab.Operations.SubTab.SCHEDULES,
            MSG.view_tabs_common_schedules()), null);
        SubTab operationsHistory = new SubTab(operationsTab, new ViewName(Tab.Operations.SubTab.HISTORY,
            MSG.view_tabs_common_history()), null);
        operationsTab.registerSubTabs(operationsSchedules, operationsHistory);
        tabs.add(operationsTab);

        TwoLevelTab configurationTab = new TwoLevelTab(new ViewName(Tab.Configuration.NAME,
            MSG.common_title_configuration()), IconEnum.CONFIGURATION_HISTORY);
        SubTab configCurrent = new SubTab(configurationTab, new ViewName(Tab.Configuration.SubTab.CURRENT,
            MSG.view_tabs_common_current()), null);
        SubTab configHistory = new SubTab(configurationTab, new ViewName(Tab.Configuration.SubTab.HISTORY,
            MSG.view_tabs_common_history()), null);
        configurationTab.registerSubTabs(configCurrent, configHistory);
        tabs.add(configurationTab);

        TwoLevelTab driftTab = new TwoLevelTab(new ViewName(Tab.Drift.NAME, MSG.view_tabs_common_drift()),
            IconEnum.DRIFT_COMPLIANCE);
        SubTab driftDefinitions = new SubTab(driftTab, new ViewName(Tab.Drift.SubTab.DEFINITIONS,
            MSG.common_title_definitions()), null);
        driftTab.registerSubTabs(driftDefinitions);
        tabs.add(driftTab);

        TwoLevelTab contentTab = new TwoLevelTab(new ViewName(Tab.Content.NAME, MSG.view_tabs_common_content()),
            IconEnum.CONTENT);
        SubTab contentDeployed = new SubTab(contentTab, new ViewName(Tab.Content.SubTab.DEPLOYED,
            MSG.view_tabs_common_deployed()), null);
        SubTab contentNew = new SubTab(contentTab, new ViewName(Tab.Content.SubTab.NEW, MSG.common_button_new()), null);
        SubTab contentSubscrip = new SubTab(contentTab, new ViewName(Tab.Content.SubTab.SUBSCRIPTIONS,
            MSG.view_tabs_common_subscriptions()), null);
        SubTab contentHistory = new SubTab(contentTab, new ViewName(Tab.Content.SubTab.HISTORY,
            MSG.view_tabs_common_history()), null);
        contentTab.registerSubTabs(contentDeployed, contentNew, contentSubscrip, contentHistory);
        tabs.add(contentTab);

        return tabs.toArray(new TwoLevelTab[tabs.size()]);
    }
View Full Code Here

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

    }

    private static TwoLevelTab[] createTabs() {
        List<TwoLevelTab> tabs = new ArrayList<TwoLevelTab>();

        TwoLevelTab summaryTab = new TwoLevelTab(new ViewName(Tab.Summary.NAME, MSG.common_title_summary()), ImageManager.getResourceIcon(
            ResourceCategory.SERVICE, AvailabilityType.UP));

        SubTab summaryActivity = new SubTab(summaryTab, new ViewName(Tab.Summary.SubTab.ACTIVITY, MSG.view_tabs_common_activity()), null);
        SubTab summaryTimeline = new SubTab(summaryTab, new ViewName(Tab.Summary.SubTab.TIMELINE, MSG.view_tabs_common_timeline()), null);
        summaryTab.registerSubTabs(summaryActivity, summaryTimeline);
        tabs.add(summaryTab);

        TwoLevelTab inventoryTab = new TwoLevelTab(new ViewName(Tab.Inventory.NAME, MSG.view_tabs_common_inventory()),
            IconEnum.INVENTORY_SUMMARY);
        SubTab inventoryMembers = new SubTab(inventoryTab, new ViewName(GroupTab.Inventory.SubTab.MEMBERS, MSG.view_tabs_common_members()), null);
        SubTab inventoryConn = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.CONNECTION_SETTINGS,
            MSG.view_tabs_common_connectionSettings()), null);
        SubTab inventoryConnHistory = new SubTab(inventoryTab, new ViewName(Tab.Inventory.SubTab.CONNECTION_SETTINGS_HISTORY,
            MSG.view_tabs_common_connectionSettingsHistory()), null);
        inventoryTab.registerSubTabs(inventoryMembers, inventoryConn, inventoryConnHistory);
        tabs.add(inventoryTab);

        TwoLevelTab alertsTab = new TwoLevelTab(new ViewName(Tab.Alerts.NAME, MSG.common_title_alerts()), IconEnum.ALERT_DEFINITIONS);
        SubTab alertHistory = new SubTab(alertsTab, new ViewName(Tab.Alerts.SubTab.HISTORY, MSG.view_tabs_common_history()), null);
        SubTab alertDef = new SubTab(alertsTab, new ViewName(Tab.Alerts.SubTab.DEFINITIONS, MSG.common_title_definitions()), null);
        alertsTab.registerSubTabs(alertDef, alertHistory);
        tabs.add(alertsTab);

        TwoLevelTab monitoringTab = new TwoLevelTab(new ViewName(Tab.Monitoring.NAME, MSG.view_tabs_common_monitoring()),
            IconEnum.SUSPECT_METRICS);
        SubTab monitorGraphs = new SubTab(monitoringTab, new ViewName(GroupTab.Monitoring.SubTab.GRAPHS, MSG.view_tabs_common_graphs()), null);
        SubTab monitorMetrics = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.METRICS, MSG.view_tabs_common_metrics()), null);
        SubTab monitorTraits = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.TRAITS, MSG.view_tabs_common_traits()), null);

        SubTab monitorSched = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.SCHEDULES, MSG.view_tabs_common_schedules()), null);
        SubTab monitorCallTime = new SubTab(monitoringTab, new ViewName(Tab.Monitoring.SubTab.CALL_TIME, MSG.view_tabs_common_calltime()), null);
        monitoringTab.registerSubTabs(monitorGraphs, monitorMetrics, monitorTraits, monitorSched,
            monitorCallTime);
        tabs.add(monitoringTab);

        TwoLevelTab eventsTab = new TwoLevelTab(new ViewName(Tab.Events.NAME, MSG.view_tabs_common_events()), IconEnum.EVENTS);
        SubTab eventHistory = new SubTab(eventsTab, new ViewName(Tab.Events.SubTab.HISTORY, MSG.view_tabs_common_history()), null);
        eventsTab.registerSubTabs(eventHistory);
        tabs.add(eventsTab);

        TwoLevelTab operationsTab = new TwoLevelTab(new ViewName(Tab.Operations.NAME, MSG.common_title_operations()),
            IconEnum.RECENT_OPERATIONS);
        SubTab operationsSchedules = new SubTab(operationsTab,
            new ViewName(Tab.Operations.SubTab.SCHEDULES, MSG.view_tabs_common_schedules()), null);
        SubTab operationsHistory = new SubTab(operationsTab, new ViewName(Tab.Operations.SubTab.HISTORY, MSG.view_tabs_common_history()),
            null);
        operationsTab.registerSubTabs(operationsSchedules, operationsHistory);
        tabs.add(operationsTab);

        TwoLevelTab configurationTab = new TwoLevelTab(new ViewName(Tab.Configuration.NAME, MSG.common_title_configuration()),
            IconEnum.CONFIGURATION_HISTORY);
        SubTab configCurrent = new SubTab(configurationTab, new ViewName(Tab.Configuration.SubTab.CURRENT, MSG.view_tabs_common_current()), null);
        SubTab configHistory = new SubTab(configurationTab, new ViewName(Tab.Configuration.SubTab.HISTORY, MSG.view_tabs_common_history()), null);
        configurationTab.registerSubTabs(configCurrent, configHistory);
        tabs.add(configurationTab);

        return tabs.toArray(new TwoLevelTab[tabs.size()]);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.