use of org.rstudio.core.client.events.WindowStateChangeEvent in project rstudio by rstudio.
the class DualWindowLayoutPanel method replaceWindows.
public void replaceWindows(LogicalWindow windowA, LogicalWindow windowB) {
unhookEvents();
windowA_ = windowA;
windowB_ = windowB;
hookEvents();
layout_.setWidgets(new Widget[] { windowA_.getNormal(), windowA_.getMinimized(), windowB_.getNormal(), windowB_.getMinimized() });
Scheduler.get().scheduleFinally(new ScheduledCommand() {
public void execute() {
windowA_.onWindowStateChange(new WindowStateChangeEvent(NORMAL));
}
});
}
use of org.rstudio.core.client.events.WindowStateChangeEvent in project rstudio by rstudio.
the class LogicalWindow method onWindowStateChange.
public void onWindowStateChange(WindowStateChangeEvent event) {
WindowState newState = event.getNewState();
if (state_ == EXCLUSIVE && newState == MAXIMIZE)
newState = NORMAL;
if (newState == state_)
newState = NORMAL;
events_.fireEvent(new WindowStateChangeEvent(newState, event.skipFocusChange()));
}
use of org.rstudio.core.client.events.WindowStateChangeEvent 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() + "')");
}
}
use of org.rstudio.core.client.events.WindowStateChangeEvent 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);
}
use of org.rstudio.core.client.events.WindowStateChangeEvent 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);
}
Aggregations