use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class UndockModeAction method isEnabled.
@Override
public boolean isEnabled() {
ModeImpl contextMode = getMode2WorkWith();
if (null == contextMode)
return false;
boolean docked = contextMode.getState() == Constants.MODE_STATE_JOINED;
if (!docked)
return false;
if (contextMode.getKind() == Constants.MODE_KIND_EDITOR)
return Switches.isEditorModeUndockingEnabled();
return contextMode.getKind() == Constants.MODE_KIND_VIEW && Switches.isViewModeUndockingEnabled();
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class DefaultModel method createWindowSystemSnapshot.
// Controller updates <<
// ///////////////////////
@Override
public WindowSystemSnapshot createWindowSystemSnapshot() {
WindowSystemSnapshot wsms = new WindowSystemSnapshot();
// PENDING
ModeStructureSnapshot mss = createModeStructureSnapshot();
wsms.setModeStructureSnapshot(mss);
ModeImpl activeMode = getActiveMode();
wsms.setActiveModeSnapshot(activeMode == null ? null : mss.findModeSnapshot(activeMode.getName()));
ModeImpl maximizedMode = null != getViewMaximizedMode() ? getViewMaximizedMode() : null;
wsms.setMaximizedModeSnapshot(maximizedMode == null ? null : mss.findModeSnapshot(maximizedMode.getName()));
wsms.setMainWindowBoundsJoined(getMainWindowBoundsJoined());
wsms.setMainWindowBoundsSeparated(getMainWindowBoundsSeparated());
wsms.setEditorAreaBounds(getEditorAreaBounds());
wsms.setEditorAreaState(getEditorAreaState());
wsms.setEditorAreaFrameState(getEditorAreaFrameState());
wsms.setMainWindowFrameStateJoined(getMainWindowFrameStateJoined());
wsms.setMainWindowFrameStateSeparated(getMainWindowFrameStateSeparated());
wsms.setToolbarConfigurationName(getToolbarConfigName());
return wsms;
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class DefaultModel method updateSlidingSelections.
/**
* Keeps selected components of sliding modes in sync with given current
* active mode. Sliding mode can have non-null selection (=slide) only if
* it is active mode as well
*/
private void updateSlidingSelections(ModeImpl curActive) {
Set slidingModes = modesSubModel.getSlidingModes();
ModeImpl curSliding = null;
for (Iterator iter = slidingModes.iterator(); iter.hasNext(); ) {
curSliding = (ModeImpl) iter.next();
if (!curSliding.equals(curActive)) {
setModeSelectedTopComponent(curSliding, null);
}
}
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class DockingStatus method mark.
/**
* Remember which TopComponents are docked and which are slided.
*/
public void mark() {
Set<ModeImpl> modes = model.getModes();
for (Iterator<ModeImpl> i = modes.iterator(); i.hasNext(); ) {
ModeImpl modeImpl = i.next();
if (modeImpl.getState() == Constants.MODE_STATE_SEPARATED)
continue;
List<String> views = model.getModeOpenedTopComponentsIDs(modeImpl);
if (modeImpl.getKind() == Constants.MODE_KIND_VIEW) {
docked.addAll(views);
slided.removeAll(views);
} else if (modeImpl.getKind() == Constants.MODE_KIND_SLIDING) {
docked.removeAll(views);
slided.addAll(views);
}
}
marked = true;
}
use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.
the class DocumentsDlg method activate.
// GEN-LAST:event_closeDocuments
private void activate(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_activate
// Add your handling code here:
Node[] selNodes = explorer.getSelectedNodes();
if (selNodes.length == 0) {
return;
}
closeDialog();
final TopComponent tc = ((TopComponentNode) selNodes[0]).getTopComponent();
// Call using invokeLater to make sure it is performed after dialog
// is closed.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// #37226-41075 Unmaximized the other mode if needed.
WindowManagerImpl wm = WindowManagerImpl.getInstance();
ModeImpl mode = (ModeImpl) wm.findMode(tc);
if (mode != null && mode != wm.getCurrentMaximizedMode()) {
wm.switchMaximizedMode(null);
}
tc.requestActive();
}
});
}
Aggregations