Exemplo n.º 1
0
  private boolean findMatch(
      String searchString, TableItem item, int column, boolean matchWord, boolean matchCase) {

    String tableText = matchCase ? item.getText(column) : item.getText(column).toLowerCase();
    if (matchWord) {
      if (tableText != null && tableText.equals(searchString)) {
        return true;
      }

    } else {
      if (tableText != null && tableText.indexOf(searchString) != -1) {
        return true;
      }
    }
    return false;
  }
 private void launchEditor(TableItem item) {
   String theCommand = resUser.getString("Custom_editor");
   theCommand = theCommand.replaceAll("%file%", item.getText(3));
   theCommand = theCommand.replaceAll("%line%", item.getText(1));
   theCommand = theCommand.replace('/', File.separatorChar);
   theCommand = theCommand.replaceAll("%slash%", "/");
   try {
     Runtime.getRuntime().exec(theCommand);
   } catch (IOException e) {
     displayError("Error launching editor: " + e.getMessage());
   }
 }
Exemplo n.º 3
0
 private void editEntry(TableItem item) {
   DataEntryDialog dialog = new DataEntryDialog(shell);
   dialog.setLabels(columnNames);
   String[] values = new String[table.getColumnCount()];
   for (int i = 0; i < values.length; i++) {
     values[i] = item.getText(i);
   }
   dialog.setValues(values);
   values = dialog.open();
   if (values != null) {
     item.setText(values);
     isModified = true;
   }
 }