Beispiel #1
0
 /**
  * Get resources files in quick fix dialog.
  *
  * @return the resources
  */
 public List<String> getResources() {
   List<String> resources = new ArrayList<String>();
   Table resourcesTable = new DefaultTable(1);
   int count = resourcesTable.rowCount();
   for (int i = 0; i < count; i++) {
     resources.add(resourcesTable.getItem(i).getText());
   }
   return resources;
 }
Beispiel #2
0
 /**
  * Get available fixes provided by quick fix.
  *
  * @return available fixes
  */
 public List<String> getAvailableFixes() {
   List<String> fixes = new ArrayList<String>();
   Table fixesTable = new DefaultTable(0);
   int count = fixesTable.rowCount();
   for (int i = 0; i < count; i++) {
     fixes.add(fixesTable.getItem(i).getText());
   }
   return fixes;
 }
Beispiel #3
0
 /**
  * Select fix in available fixes with provided text.
  *
  * @param fix the fix
  */
 public void selectFix(String fix) {
   Table fixTable = new DefaultTable(0);
   int count = fixTable.rowCount();
   for (int i = 0; i < count; i++) {
     String fixInTable = fixTable.getItem(i).getText();
     if (fixInTable.contains(fix)) {
       fixTable.select(fixInTable);
       break;
     }
   }
 }
 public ServiceTestClassWizard selectMixin(String... mixin) {
   Table table = new DefaultTable();
   List<TableItem> items = table.getItems();
   for (TableItem item : items) {
     String text = item.getText();
     for (int i = 0; i < mixin.length; i++) {
       if (mixin[i] != null && mixin[i].equals(text)) {
         item.setChecked(true);
       }
     }
   }
   return this;
 }
 @Override
 public boolean test() {
   items = table.getItems();
   for (TableItem item : items) {
     if (!item.getSWTWidget().isDisposed() && matcher.matches(item.getText())) {
       item.select();
       return true;
     }
   }
   return false;
 }