private void loadProfiles() {
   try {
     settings.load();
   } catch (CoreException e) {
     reportStatus(e.getStatus());
   }
   for (TeaVMProfile profile : settings.getProfiles()) {
     createItemForProfile(profile);
   }
 }
 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());
   }
 }
 @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();
 }
 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();
 }