use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class UndockModeAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
WindowManagerImpl wmi = WindowManagerImpl.getInstance();
ModeImpl contextMode = getMode2WorkWith();
boolean isDocked = contextMode.getState() == Constants.MODE_STATE_JOINED;
if (isDocked) {
wmi.userUndockedMode(contextMode);
} else {
wmi.userDockedMode(contextMode);
}
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class DesignViewComponent method modeNameActionPerformed.
private void modeNameActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_modeNameActionPerformed
Mode mode = WindowManager.getDefault().findMode(this);
if (mode instanceof ModeImpl) {
ModeImpl mi = (ModeImpl) mode;
mi.setModeName(modeName.getText());
}
for (TopComponent tc : mode.getTopComponents()) {
if (tc instanceof DesignViewComponent) {
DesignViewComponent dvc = (DesignViewComponent) tc;
dvc.refresh();
}
}
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class CollapseTabGroupAction method updateEnabled.
private void updateEnabled() {
ModeImpl contextMode = mode;
if (contextMode == null) {
// the updating instance will get the TC to close from winsys
TopComponent tc = TopComponent.getRegistry().getActivated();
if (null != tc)
contextMode = (ModeImpl) WindowManagerImpl.getInstance().findMode(tc);
}
if (null == contextMode) {
setEnabled(false);
return;
}
boolean enable = contextMode.getState() == Constants.MODE_STATE_JOINED;
enable &= contextMode.getKind() == Constants.MODE_KIND_EDITOR;
boolean hasOtherEditorMode = false;
for (ModeImpl m : WindowManagerImpl.getInstance().getModes()) {
if (m.getKind() == Constants.MODE_KIND_EDITOR && m.getState() == Constants.MODE_STATE_JOINED && m != contextMode) {
hasOtherEditorMode = true;
break;
}
}
enable &= hasOtherEditorMode;
setEnabled(enable);
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class MinimizeModeAction method updateEnabled.
private void updateEnabled() {
ModeImpl contextMode = mode;
if (contextMode == null) {
// the updating instance will get the TC to close from winsys
TopComponent tc = TopComponent.getRegistry().getActivated();
if (null != tc)
contextMode = (ModeImpl) WindowManagerImpl.getInstance().findMode(tc);
}
if (null == contextMode) {
setEnabled(false);
return;
}
setEnabled(Switches.isModeSlidingEnabled() && contextMode.getKind() == Constants.MODE_KIND_VIEW && contextMode.getState() == Constants.MODE_STATE_JOINED);
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class MoveModeAction method updateEnabled.
private void updateEnabled() {
ModeImpl contextMode = getModeToWorkWith();
if (null == contextMode || // || contextMode.getKind() == Constants.MODE_KIND_EDITOR
contextMode.getState() == Constants.MODE_STATE_SEPARATED || null == contextMode.getSelectedTopComponent() || WindowManagerImpl.getInstance().getCurrentMaximizedMode() != null) {
setEnabled(false);
return;
}
TopComponent tc = contextMode.getSelectedTopComponent();
if (null == tc) {
setEnabled(false);
return;
}
setEnabled(true);
}
Aggregations