switch (at) {
case INSPECT:
boolean addListener = slotWindow == null;
RPSlot content = ((Corpse) entity).getContent();
slotWindow = inspector.inspectMe(entity, content, slotWindow, 2, 2);
SlotWindow window = slotWindow;
if (window != null) {
window.setTitle(entity.getTitle());
window.setMinimizable(false);
prepareInspectAutoClose(window, entity, content);
}
/*
* Register a listener for window closing so that we can
* drop the reference to the closed window and let the
* garbage collector claim it.
*/
if (addListener && (window != null)) {
window.addCloseListener(new CloseListener() {
public void windowClosed(InternalWindow window) {
slotWindow = null;
}
});
}
/*
* In case the view got released while the window was created and
* added, and before the main thread was aware that there's a window
* to be closed, close it now. (onAction is called from the event
* dispatch thread).
*/
if (isReleased()) {
if (window != null) {
window.close();
}
}
break;
default: