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; }
/** Called when the user confirms the dialog */ private void ok() { // The "stepname" variable will be the return value for the open() method. // Setting to step name from the dialog control stepname = wStepname.getText(); // Setting the settings to the meta object meta.setConsecutiveDelimsAsOne(wRemoveBlanks.getSelection()); int nrfields = wGroup.nrNonEmpty(); meta.allocate(nrfields); for (int i = 0; i < nrfields; i++) { TableItem item = wGroup.getNonEmpty(i); meta.getSourceFields()[i] = item.getText(1); meta.getSourceDelims()[i] = item.getText(2); meta.getOutputFields()[i] = item.getText(3); meta.getOutputDelims()[i] = item.getText(4); } // close the SWT dialog window dispose(); }
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()); } }
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; } }