use of org.netbeans.core.windows.view.ui.slides.SlideController in project netbeans-rcp-lite by outersky.
the class ActionUtils method createMinimizeWindowAction.
static Action createMinimizeWindowAction(TopComponent tc) {
SlideController slideController = (SlideController) SwingUtilities.getAncestorOfClass(SlideController.class, tc);
ModeImpl mode = findMode(tc);
int tabIndex = null == mode ? -1 : mode.getOpenedTopComponents().indexOf(tc);
boolean initialState = WindowManagerImpl.getInstance().isTopComponentMinimized(tc);
Action res = new AutoHideWindowAction(slideController, tabIndex, initialState);
res.setEnabled(null != mode && mode.getState() == Constants.MODE_STATE_JOINED);
return res;
}
use of org.netbeans.core.windows.view.ui.slides.SlideController in project netbeans-rcp-lite by outersky.
the class MinimizeWindowAction method checkEnabled.
private boolean checkEnabled() {
TopComponent context = TopComponent.getRegistry().getActivated();
if (null == context) {
return false;
}
SlideController slideController = (SlideController) SwingUtilities.getAncestorOfClass(SlideController.class, context);
if (null == slideController)
return false;
ModeImpl mode = (ModeImpl) WindowManagerImpl.getInstance().findMode(context);
if (null == mode)
return false;
if (WindowManagerImpl.getInstance().isTopComponentMinimized(context))
return false;
if (mode.getState() != Constants.MODE_STATE_JOINED)
return false;
if (mode.getKind() != Constants.MODE_KIND_VIEW)
return false;
return Switches.isTopComponentSlidingEnabled() && Switches.isSlidingEnabled(context);
}
Aggregations