예제 #1
0
 private void loadProfiles() {
   try {
     settings.load();
   } catch (CoreException e) {
     reportStatus(e.getStatus());
   }
   for (TeaVMProfile profile : settings.getProfiles()) {
     createItemForProfile(profile);
   }
 }
예제 #2
0
 private void addProfile() {
   try {
     TeaVMProfile profile = settings.createProfile();
     TableItem item = createItemForProfile(profile);
     storeItem(item);
     TeaVMProfileDialog dialog = new TeaVMProfileDialog(getShell(), settings, profile);
     dialog.setProject(project);
     dialog.open();
     updateItem(item);
   } catch (CoreException e) {
     reportStatus(e.getStatus());
   }
 }
예제 #3
0
 @Override
 public boolean performOk() {
   try {
     updateNature();
     for (int i = 0; i < profilesTable.getItemCount(); ++i) {
       TableItem item = profilesTable.getItem(i);
       storeItem(item);
     }
     settings.save();
   } catch (CoreException e) {
     reportStatus(e.getStatus());
   }
   return super.performOk();
 }
예제 #4
0
 private void deleteProfile() {
   if (profilesTable.getSelectionCount() != 1) {
     return;
   }
   TableItem item = profilesTable.getSelection()[0];
   TeaVMProfile profile = (TeaVMProfile) item.getData();
   if (!profile.getExternalToolId().isEmpty()) {
     return;
   }
   boolean confirmed =
       MessageDialog.openConfirm(
           getShell(),
           "Deletion confirmation",
           "Are you sure to delete profile " + item.getText(0) + "?");
   if (!confirmed) {
     return;
   }
   settings.deleteProfile((TeaVMProfile) item.getData());
   item.dispose();
 }