Пример #1
0
 private void newEntry() {
   DataEntryDialog dialog = new DataEntryDialog(shell);
   dialog.setLabels(columnNames);
   String[] data = dialog.open();
   if (data != null) {
     TableItem item = new TableItem(table, SWT.NONE);
     item.setText(data);
     isModified = true;
   }
 }
Пример #2
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;
   }
 }