コード例 #1
0
 public void valueChanged(ListSelectionEvent event) {
   if (table.getSelectedRow() == -1) textArea.setText(null);
   else {
     TableItem item = table.getTableItemAt(table.getSelectedRow());
     textArea.setText(item.toString());
   }
   textArea.setCaretPosition(0);
 }
コード例 #2
0
    protected void customizeCellRenderer(
        JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
      setPaintFocusBorder(false);
      setFocusBorderAroundIcon(true);
      setBorder(NO_FOCUS_BORDER);

      final TableItem tableItem = ((TableItem) value);
      tableItem.getCellAppearance().customize(this);
    }
コード例 #3
0
 public void saveData() {
   TableUtil.stopEditing(myTable);
   final int count = myTable.getRowCount();
   String[] urls = ArrayUtil.newStringArray(count);
   for (int row = 0; row < count; row++) {
     final TableItem item = ((MyTableModel) myTable.getModel()).getTableItemAt(row);
     urls[row] = item.getUrl();
   }
   getModel().setRootUrls(AnnotationOrderRootType.getInstance(), urls);
 }