Search in sources :

Example 6 with LogicalWindow

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

the class PaneManager method zoomTab.

public void zoomTab(Tab tab) {
    activateTab(tab);
    WorkbenchTabPanel tabPanel = getOwnerTabPanel(tab);
    LogicalWindow parentWindow = tabPanel.getParentWindow();
    if (parentWindow == null)
        return;
    toggleWindowZoom(parentWindow, tab);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow)

Example 7 with LogicalWindow

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

the class PaneManager method getParentLogicalWindow.

LogicalWindow getParentLogicalWindow(Element el) {
    LogicalWindow targetWindow = null;
    while (el != null && targetWindow == null) {
        el = el.getParentElement();
        for (LogicalWindow window : panes_) {
            Widget activeWidget = window.getActiveWidget();
            if (activeWidget == null)
                continue;
            Element activeEl = activeWidget.getElement();
            if (el.equals(activeEl)) {
                targetWindow = window;
                break;
            }
        }
    }
    return targetWindow;
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) Element(com.google.gwt.dom.client.Element) Widget(com.google.gwt.user.client.ui.Widget)

Example 8 with LogicalWindow

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

the class PaneManager method restoreSavedLayout.

private void restoreSavedLayout() {
    // hidden windows to display themselves, and so on.
    for (LogicalWindow window : panes_) window.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
    maximizedWindow_.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL, true));
    resizeHorizontally(panel_.getWidgetSize(right_), widgetSizePriorToZoom_);
    invalidateSavedLayoutState(true);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) WindowStateChangeEvent(org.rstudio.core.client.events.WindowStateChangeEvent)

Example 9 with LogicalWindow

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

the class PaneManager method fullyMaximizeWindow.

private void fullyMaximizeWindow(final LogicalWindow window, final Tab tab) {
    if (window.equals(getSourceLogicalWindow()))
        maximizedTab_ = Tab.Source;
    else if (window.equals(getConsoleLogicalWindow()))
        maximizedTab_ = Tab.Console;
    else
        maximizedTab_ = tab;
    maximizedWindow_ = window;
    manageLayoutCommands();
    panel_.setSplitterEnabled(false);
    if (widgetSizePriorToZoom_ < 0)
        widgetSizePriorToZoom_ = panel_.getWidgetSize(right_);
    // transfers don't always propagate as expected)
    for (LogicalWindow pane : panes_) pane.onWindowStateChange(new WindowStateChangeEvent(WindowState.NORMAL));
    boolean isLeftWidget = DomUtils.contains(left_.getElement(), window.getActiveWidget().getElement());
    window.onWindowStateChange(new WindowStateChangeEvent(WindowState.EXCLUSIVE));
    final double initialSize = panel_.getWidgetSize(right_);
    double targetSize = isLeftWidget ? 0 : panel_.getOffsetWidth();
    if (targetSize < 0)
        targetSize = 0;
    // Ensure focus is sent to Help iframe on activation.
    Command onActivation = null;
    if (maximizedTab_.equals(Tab.Help)) {
        onActivation = new Command() {

            @Override
            public void execute() {
                commands_.activateHelp().execute();
            }
        };
    }
    resizeHorizontally(initialSize, targetSize, onActivation);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) Command(com.google.gwt.user.client.Command) AppCommand(org.rstudio.core.client.command.AppCommand) WindowStateChangeEvent(org.rstudio.core.client.events.WindowStateChangeEvent)

Example 10 with LogicalWindow

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

the class PaneManager method onLayoutZoomCurrentPane.

@Handler
public void onLayoutZoomCurrentPane() {
    LogicalWindow activeWindow = getActiveLogicalWindow();
    if (activeWindow == null)
        return;
    toggleWindowZoom(activeWindow, null);
}
Also used : LogicalWindow(org.rstudio.core.client.layout.LogicalWindow) 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