Example usage for com.google.gwt.chrome.crx.client Tabs getSelected

List of usage examples for com.google.gwt.chrome.crx.client Tabs getSelected

Introduction

In this page you can find the example usage for com.google.gwt.chrome.crx.client Tabs getSelected.

Prototype

public static native void getSelected(int windowId, OnTabCallback callback) ;

Source Link

Document

Retrieve the currently selected tab in the specified window.

Usage

From source file:com.google.speedtracer.client.BackgroundPage.java

License:Apache License

/**
 * Opens the monitor UI for a given tab, iff it is not already open.
 *//*w w  w  .  j  a  v  a 2  s. co  m*/
private void openMonitor(final int browserId, final int tabId, final TabModel tabModel) {
    assert (tabModel != null);

    Windows.create(MONITOR_RESOURCE_PATH + "?tabId=" + tabId + "&browserId=" + Integer.toString(browserId), 0,
            0, 850, 700, new OnWindowCallback() {
                public void onWindow(Window window) {
                    tabModel.monitorClosed = false;
                    // The Tab containing the Monitor UI should not have a valid browser
                    // action button.
                    Tabs.getSelected(window.getId(), new OnTabCallback() {
                        public void onTab(Tab tab) {
                            setBrowserActionIcon(tab.getId(), browserAction.mtIconDisabled(), null);
                        }
                    });
                }
            });
}