Example usage for com.google.gwt.user.client.ui DeckPanel showWidget

List of usage examples for com.google.gwt.user.client.ui DeckPanel showWidget

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DeckPanel showWidget.

Prototype

public void showWidget(int index) 

Source Link

Document

Shows the widget at the specified index.

Usage

From source file:org.pentaho.mantle.client.ui.PerspectiveManager.java

License:Open Source License

private void showOpenedPerspective(boolean browserChecked, boolean schedulesChecked) {
    DeckPanel contentDeck = MantleApplication.getInstance().getContentDeck();
    if (MantleApplication.getInstance().getContentDeck()
            .getWidgetIndex(SolutionBrowserPanel.getInstance()) == -1) {
        contentDeck.add(SolutionBrowserPanel.getInstance());
    }/*from   w w w  . ja  v a2s .  c  om*/
    // show stuff we've created/configured
    contentDeck.showWidget(contentDeck.getWidgetIndex(SolutionBrowserPanel.getInstance()));
    SolutionBrowserPanel.getInstance()
            .setNavigatorShowing(SolutionBrowserPanel.getInstance().isNavigatorShowing());
    setCheckMMenuItem(browserChecked, schedulesChecked);
}

From source file:org.pentaho.mantle.client.ui.PerspectiveManager.java

License:Open Source License

private void showSchedulesPerspective() {

    GWT.runAsync(new RunAsyncCallback() {

        public void onSuccess() {
            DeckPanel contentDeck = MantleApplication.getInstance().getContentDeck();
            if (MantleApplication.getInstance().getContentDeck()
                    .getWidgetIndex(SchedulesPerspectivePanel.getInstance()) == -1) {
                contentDeck.add(SchedulesPerspectivePanel.getInstance());
            } else {
                SchedulesPerspectivePanel.getInstance().refresh();
            }//  ww w  .j  a v a2s. c om
            contentDeck.showWidget(contentDeck.getWidgetIndex(SchedulesPerspectivePanel.getInstance()));
        }

        public void onFailure(Throwable reason) {
        }
    });
    setCheckMMenuItem(false, true);
}

From source file:org.pentaho.mantle.client.ui.PerspectiveManager.java

License:Open Source License

private void showAdminPerspective(boolean browserChecked, boolean schedulesChecked) {
    DeckPanel contentDeck = MantleApplication.getInstance().getContentDeck();
    if (MantleApplication.getInstance().getContentDeck()
            .getWidgetIndex(MantleXul.getInstance().getAdminPerspective()) == -1) {
        contentDeck.add(MantleXul.getInstance().getAdminPerspective());
    }/*from  w ww  .  ja v  a2 s . c o m*/
    contentDeck.showWidget(contentDeck.getWidgetIndex(MantleXul.getInstance().getAdminPerspective()));
    MantleXul.getInstance().customizeAdminStyle();
    MantleXul.getInstance().configureAdminCatTree();
    // disable Browser and schedules menuItem
    setCheckMMenuItem(browserChecked, schedulesChecked);
}

From source file:org.pentaho.mantle.client.ui.xul.MantleModel.java

License:Open Source License

@Bindable
public void loadSettingsPanel() {
    GWT.runAsync(new RunAsyncCallback() {
        public void onSuccess() {
            DeckPanel contentDeck = MantleXul.getInstance().getAdminContentDeck();
            if (contentDeck.getWidgetIndex(ContentCleanerPanel.getInstance()) == -1) {
                contentDeck.add(ContentCleanerPanel.getInstance());
            }//from   w  w  w .j  a  v  a2s  .  c  o  m
            contentDeck.showWidget(contentDeck.getWidgetIndex(ContentCleanerPanel.getInstance()));
        }

        public void onFailure(Throwable reason) {
        }
    });
}

From source file:org.pentaho.mantle.client.ui.xul.MantleModel.java

License:Open Source License

@Bindable
public void loadUserRolesAdminPanel() {
    GWT.runAsync(new RunAsyncCallback() {
        public void onSuccess() {
            DeckPanel contentDeck = MantleXul.getInstance().getAdminContentDeck();
            if (MantleApplication.getInstance().getContentDeck()
                    .getWidgetIndex(UserRolesAdminPanelController.getInstance()) == -1) {
                contentDeck.add(UserRolesAdminPanelController.getInstance());
            }//  w  w w  .  j a v a2  s  .com
            contentDeck.showWidget(contentDeck.getWidgetIndex(UserRolesAdminPanelController.getInstance()));
        }

        public void onFailure(Throwable reason) {
        }
    });
}

From source file:org.pentaho.mantle.client.ui.xul.MantleModel.java

License:Open Source License

@Bindable
public void loadEmailAdminPanel() {
    GWT.runAsync(new RunAsyncCallback() {
        public void onSuccess() {
            DeckPanel contentDeck = MantleXul.getInstance().getAdminContentDeck();
            if (MantleApplication.getInstance().getContentDeck()
                    .getWidgetIndex(EmailAdminPanelController.getInstance()) == -1) {
                contentDeck.add(EmailAdminPanelController.getInstance());
            }//from   w  ww . ja v a 2  s. c om
            contentDeck.showWidget(contentDeck.getWidgetIndex(EmailAdminPanelController.getInstance()));
        }

        public void onFailure(Throwable reason) {
        }
    });
}

From source file:rocket.widget.client.tabpanel.TabPanel.java

License:Apache License

public void select(final int index) {
    final TabItem newlySelectedItem = this.get(index);
    TabItem previousSelection = null;/*from  w ww.ja  v  a 2  s .  c  o m*/
    final int previouslySelectedIndex = this.getSelectedIndex();
    if (-1 != previouslySelectedIndex) {
        previousSelection = this.get(previouslySelectedIndex);
    }

    final BeforeTabSelectEvent beforeSelected = new BeforeTabSelectEvent();
    beforeSelected.setCurrentSelection(previousSelection);
    beforeSelected.setNewSelection(newlySelectedItem);

    final TabListenerCollection listeners = this.getTabListeners();
    listeners.fireBeforeTabSelected(beforeSelected);

    if (false == beforeSelected.isCancelled()) {
        final String selectedStyle = this.getTabBarItemSelectedStyleName();

        final TabBarPanel tabBarPanel = this.getTabBarPanel();
        final DeckPanel contentPanel = this.getContentPanel();

        // find the previously selected tab. and unselect it.
        final int previousIndex = contentPanel.getVisibleWidget();
        TabItem previouslySelectedTabItem = null;
        if (-1 != previousIndex) {
            final Widget tab = tabBarPanel.getWidget(previousIndex + 1);
            tab.removeStyleName(selectedStyle);
            previouslySelectedTabItem = this.get(previousIndex);
        }

        // apply the style to the new tab.
        final Widget tabBarItemPanel = tabBarPanel.getWidget(index + 1);
        tabBarItemPanel.addStyleName(selectedStyle);

        // tell the deckPanel to select a new sub-widget.
        contentPanel.showWidget(index);

        final TabSelectEvent selectedEvent = new TabSelectEvent();
        selectedEvent.setPreviouslySelected(previouslySelectedTabItem);
        selectedEvent.setCurrentSelection(newlySelectedItem);

        listeners.fireTabSelected(selectedEvent);
    }
}