protected CommandManager getCommandManager() {
CommandManager commandManager;
ApplicationWindow appWindow = Application.instance().getActiveWindow();
if (appWindow == null || appWindow.getCommandManager() == null) {
if (localCommandManager == null) {
localCommandManager = new DefaultCommandManager();
}
commandManager = localCommandManager;
}
else {
commandManager = appWindow.getCommandManager();