Search in sources :

Example 1 with LogicalWindow

use of org.rstudio.core.client.layout.LogicalWindow in project rstudio by rstudio.

the class PaneManager method createPanes.

private ArrayList<LogicalWindow> createPanes(PaneConfig config) {
    ArrayList<LogicalWindow> results = new ArrayList<LogicalWindow>();
    JsArrayString panes = config.getPanes();
    for (int i = 0; i < 4; i++) {
        results.add(panesByName_.get(panes.get(i)));
    }
    return results;
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) ArrayList(java.util.ArrayList) JsArrayString(com.google.gwt.core.client.JsArrayString)

Example 2 with LogicalWindow

use of org.rstudio.core.client.layout.LogicalWindow in project rstudio by rstudio.

the class PaneManager method createConsole.

private LogicalWindow createConsole() {
    PrimaryWindowFrame frame = new PrimaryWindowFrame("Console", null);
    ToolbarButton goToWorkingDirButton = commands_.goToWorkingDir().createToolbarButton();
    goToWorkingDirButton.addStyleName(ThemeResources.INSTANCE.themeStyles().windowFrameToolbarButton());
    LogicalWindow logicalWindow = new LogicalWindow(frame, new MinimizedWindowFrame("Console"));
    consoleTabPanel_ = new ConsoleTabPanel(frame, logicalWindow, consolePane_, compilePdfTab_, findOutputTab_, sourceCppTab_, renderRmdTab_, deployContentTab_, markersTab_, terminalTab_, eventBus_, goToWorkingDirButton);
    return logicalWindow;
}
Also used : ToolbarButton(org.rstudio.core.client.widget.ToolbarButton) MinimizedWindowFrame(org.rstudio.core.client.theme.MinimizedWindowFrame) LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) PrimaryWindowFrame(org.rstudio.core.client.theme.PrimaryWindowFrame)

Example 3 with LogicalWindow

use of org.rstudio.core.client.layout.LogicalWindow in project rstudio by rstudio.

the class PaneManager method createTabSet.

private Triad<LogicalWindow, WorkbenchTabPanel, MinimizedModuleTabLayoutPanel> createTabSet(String persisterName, ArrayList<Tab> tabs) {
    final WindowFrame frame = new WindowFrame();
    final MinimizedModuleTabLayoutPanel minimized = new MinimizedModuleTabLayoutPanel();
    final LogicalWindow logicalWindow = new LogicalWindow(frame, minimized);
    final WorkbenchTabPanel tabPanel = new WorkbenchTabPanel(frame, logicalWindow);
    populateTabPanel(tabs, tabPanel, minimized);
    frame.setFillWidget(tabPanel);
    minimized.addSelectionHandler(new SelectionHandler<Integer>() {

        public void onSelection(SelectionEvent<Integer> integerSelectionEvent) {
            int tab = integerSelectionEvent.getSelectedItem();
            tabPanel.selectTab(tab);
        }
    });
    tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {

        public void onSelection(SelectionEvent<Integer> integerSelectionEvent) {
            int index = integerSelectionEvent.getSelectedItem();
            WorkbenchTab selected = tabPanel.getTab(index);
            lastSelectedTab_ = workbenchTabToTab(selected);
            session_.persistClientState();
        }
    });
    new SelectedTabStateValue(persisterName, tabPanel);
    return new Triad<LogicalWindow, WorkbenchTabPanel, MinimizedModuleTabLayoutPanel>(logicalWindow, tabPanel, minimized);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) MinimizedWindowFrame(org.rstudio.core.client.theme.MinimizedWindowFrame) PrimaryWindowFrame(org.rstudio.core.client.theme.PrimaryWindowFrame) WindowFrame(org.rstudio.core.client.theme.WindowFrame) MinimizedModuleTabLayoutPanel(org.rstudio.core.client.theme.MinimizedModuleTabLayoutPanel) Triad(org.rstudio.core.client.Triad)

Example 4 with LogicalWindow

use of org.rstudio.core.client.layout.LogicalWindow in project rstudio by rstudio.

the class PaneManager method createSource.

private LogicalWindow createSource() {
    WindowFrame sourceFrame = new WindowFrame();
    sourceFrame.setFillWidget(source_.asWidget());
    source_.forceLoad();
    return sourceLogicalWindow_ = new LogicalWindow(sourceFrame, new MinimizedWindowFrame("Source"));
}
Also used : MinimizedWindowFrame(org.rstudio.core.client.theme.MinimizedWindowFrame) LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) MinimizedWindowFrame(org.rstudio.core.client.theme.MinimizedWindowFrame) PrimaryWindowFrame(org.rstudio.core.client.theme.PrimaryWindowFrame) WindowFrame(org.rstudio.core.client.theme.WindowFrame)

Example 5 with LogicalWindow

use of org.rstudio.core.client.layout.LogicalWindow in project rstudio by rstudio.

the class PaneManager method activateTab.

public void activateTab(Tab tab) {
    lastSelectedTab_ = tab;
    WorkbenchTabPanel panel = getOwnerTabPanel(tab);
    // Ensure that the pane is visible (otherwise tab selection will fail)
    LogicalWindow parent = panel.getParentWindow();
    if (parent.getState() == WindowState.MINIMIZE || parent.getState() == WindowState.HIDE) {
        parent.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL));
    }
    if (tabToIndex_.containsKey(tab)) {
        int index = tabToIndex_.get(tab);
        panel.selectTab(index);
    } else {
        // unexpected; why are we trying to activate a suppressed tab?
        Debug.logWarning("Attempt to activate suppressed or unavailable " + "tab '" + tab.name() + "')");
    }
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) WindowStateChangeEvent(org.rstudio.core.client.events.WindowStateChangeEvent)

Aggregations

LogicalWindow (org.rstudio.core.client.layout.LogicalWindow)12 WindowStateChangeEvent (org.rstudio.core.client.events.WindowStateChangeEvent)5 MinimizedWindowFrame (org.rstudio.core.client.theme.MinimizedWindowFrame)3 PrimaryWindowFrame (org.rstudio.core.client.theme.PrimaryWindowFrame)3 SelectionHandler (com.google.gwt.event.logical.shared.SelectionHandler)2 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)2 Handler (org.rstudio.core.client.command.Handler)2 WindowFrame (org.rstudio.core.client.theme.WindowFrame)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 Element (com.google.gwt.dom.client.Element)1 Command (com.google.gwt.user.client.Command)1 Widget (com.google.gwt.user.client.ui.Widget)1 ArrayList (java.util.ArrayList)1 Triad (org.rstudio.core.client.Triad)1 AppCommand (org.rstudio.core.client.command.AppCommand)1 MinimizedModuleTabLayoutPanel (org.rstudio.core.client.theme.MinimizedModuleTabLayoutPanel)1 ToolbarButton (org.rstudio.core.client.widget.ToolbarButton)1