Search in sources :

Example 6 with WindowStateChangeEvent

use of org.rstudio.core.client.events.WindowStateChangeEvent 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 7 with WindowStateChangeEvent

use of org.rstudio.core.client.events.WindowStateChangeEvent 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

WindowStateChangeEvent (org.rstudio.core.client.events.WindowStateChangeEvent)7 LogicalWindow (org.rstudio.core.client.layout.LogicalWindow)5 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 SelectionHandler (com.google.gwt.event.logical.shared.SelectionHandler)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 Command (com.google.gwt.user.client.Command)1 AppCommand (org.rstudio.core.client.command.AppCommand)1 Handler (org.rstudio.core.client.command.Handler)1 WindowState (org.rstudio.core.client.layout.WindowState)1