private void refreshWorkspaceList() { LoadingPopup.showMessage(constants.LoadingWorkspaces()); repositoryService.listWorkspaces( new GenericCallback<String[]>() { public void onSuccess(String[] workspaces) { availableWorkspacesListBox.clear(); for (String workspace : workspaces) { availableWorkspacesListBox.addItem(workspace); } LoadingPopup.close(); } }); }
private void refreshModuleList(String selectedWorkspaceName) { if (selectedWorkspaceName == null || "".equals(selectedWorkspaceName)) { return; } LoadingPopup.showMessage(constants.LoadingWorkspaces()); moduleService.listModules( selectedWorkspaceName, new GenericCallback<Module[]>() { public void onSuccess(Module[] packageConfigData) { selectedModulesListBox.clear(); for (Module p : packageConfigData) { selectedModulesListBox.addItem(p.getName()); } LoadingPopup.close(); } }); LoadingPopup.showMessage(constants.LoadingWorkspaces()); moduleService.listModules( new GenericCallback<Module[]>() { public void onSuccess(Module[] packageConfigData) { availableModulesListBox.clear(); for (Module p : packageConfigData) { boolean isSelected = false; for (int i = 0; i < selectedModulesListBox.getItemCount(); i++) { if (p.getName().equals(selectedModulesListBox.getItemText(i))) { isSelected = true; } } if (!isSelected) { availableModulesListBox.addItem(p.getName()); } } LoadingPopup.close(); } }); }