use of com.cubrid.common.ui.common.action.SwitchWorkspaceAction in project cubrid-manager by CUBRID.
the class SelectWorkspaceDialog method getWorkspaceMenu.
/**
*
* Get workspace menu
*
* @param productName String
* @param productVersion String
* @return MenuManager
*/
public static MenuManager getWorkspaceMenu(String productName, String productVersion) {
MenuManager workspaceMenu = new MenuManager(Messages.menuSwitchWorkspace);
String lastUsed = PREFERENCES.get(KEY_LAST_WORKSPACE, null);
String recentUsed = PREFERENCES.get(KEY_RECENT_WORKSPACES, null);
if (recentUsed != null) {
String[] all = recentUsed.split(WORKSPACE_SPLIT_CHAR);
for (String str : all) {
if (str.equals(lastUsed)) {
continue;
}
SwitchWorkspaceAction action = new SwitchWorkspaceAction(str, productName, productVersion, false);
workspaceMenu.add(action);
}
}
workspaceMenu.add(new Separator());
workspaceMenu.add(new SwitchWorkspaceAction(Messages.menuOther, productName, productVersion, true));
return workspaceMenu;
}
Aggregations