public void contextMenuDisplayed(
ContextMenuEvent event) {
windowMenuDisplayed(event, contextMenuComp);
}
};
ContextMenuManager cmm =
ContextMenuManager.getContextMenuManager();
cmm.addContextMenuListener(menuListener);
}
} else {
// If the cell has decreased to ACTIVE it is no longer
// visible and is no longer close enough to the viewer to be
// potentially viewable, so we release control of the app if
// it is controlled. We did a similar thing in 0.4
// Wonderland, where we released control on a teleport. But
// this is a more elegant solution.
if (app != null) {
ControlArb controlArb = app.getControlArb();
if (controlArb != null) {
if (controlArb.hasControl()) {
controlArb.releaseControl();
}
}
}
}
break;
// The cell is no longer visible
case DISK:
if (!increasing) {
if (menuFactory != null) {
contextMenuComp.removeContextMenuFactory(menuFactory);
menuFactory = null;
}
if (menuListener != null) {
ContextMenuManager cmm =
ContextMenuManager.getContextMenuManager();
cmm.removeContextMenuListener(menuListener);
menuListener = null;
}
// issue #968: clean up the local visuals for this app cell,
// but don't remove it from the server