Search in sources :

Example 11 with LogicalWindow

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

the class PaneManager method restoreFourPaneLayout.

private void restoreFourPaneLayout() {
    // widgets to size themselves vertically.
    for (LogicalWindow window : panes_) window.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
    double rightWidth = panel_.getWidgetSize(right_);
    double panelWidth = panel_.getOffsetWidth();
    double minThreshold = (2.0 / 5.0) * panelWidth;
    double maxThreshold = (3.0 / 5.0) * panelWidth;
    if (rightWidth <= minThreshold)
        resizeHorizontally(rightWidth, minThreshold);
    else if (rightWidth >= maxThreshold)
        resizeHorizontally(rightWidth, maxThreshold);
    invalidateSavedLayoutState(true);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) WindowStateChangeEvent(org.rstudio.core.client.events.WindowStateChangeEvent)

Example 12 with LogicalWindow

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

the class PaneManager method onActivateConsolePane.

@Handler
public void onActivateConsolePane() {
    // Ensure that the console window is activated
    LogicalWindow consoleWindow = getConsoleLogicalWindow();
    if (consoleWindow.getState().equals(WindowState.MINIMIZE)) {
        WindowStateChangeEvent event = new WindowStateChangeEvent(WindowState.NORMAL);
        consoleWindow.onWindowStateChange(event);
    }
    // created.
    if (consoleTabPanel_.isEmpty()) {
        consolePane_.focus();
    } else {
        LogicalWindow activeWindow = getActiveLogicalWindow();
        if (consoleWindow.equals(activeWindow)) {
            consoleTabPanel_.selectNextTab();
        } else {
            consoleTabPanel_.selectTab(consoleTabPanel_.getSelectedIndex());
        }
    }
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) WindowStateChangeEvent(org.rstudio.core.client.events.WindowStateChangeEvent) Handler(org.rstudio.core.client.command.Handler) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) SelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler)

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