private void updateWorkspace() {
    String name =
        availableWorkspacesListBox.getItemText(availableWorkspacesListBox.getSelectedIndex());

    List<String> selectedModulesList = new ArrayList<String>(selectedModulesListBox.getItemCount());
    for (int i = 0; i < selectedModulesListBox.getItemCount(); i++) {
      selectedModulesList.add(selectedModulesListBox.getItemText(i));
    }
    List<String> availableModuleList =
        new ArrayList<String>(availableModulesListBox.getItemCount());
    for (int i = 0; i < availableModulesListBox.getItemCount(); i++) {
      availableModuleList.add(availableModulesListBox.getItemText(i));
    }
    availableModuleList.removeAll(selectedModulesList);
    LoadingPopup.showMessage(constants.LoadingStatuses());

    repositoryService.updateWorkspace(
        name,
        selectedModulesList.toArray(new String[selectedModulesList.size()]),
        availableModuleList.toArray(new String[availableModuleList.size()]),
        new GenericCallback<java.lang.Void>() {
          public void onSuccess(Void v) {
            Window.alert(constants.WorkspaceUpdated());
            refreshWorkspaceList();
          }
        });
  }
示例#2
0
 private void selectUser(final String userEmail) {
   if (userEmail != null) {
     for (int i = 0; i < users.getItemCount(); i++) {
       if (users.getValue(i).equalsIgnoreCase(userEmail)) {
         users.setSelectedIndex(i);
         break;
       }
     }
   }
   userChanged();
 }
 private boolean isConfigListEmpty() {
   return configList.getItemCount() == 0;
 }
 private void selectLastConfig() {
   int lastIndex = configList.getItemCount() - 1;
   configList.setSelectedIndex(lastIndex);
 }