コード例 #1
0
 private void editCurrent() {
   GenericEditor editor = tableModel.getEditor();
   editor.edit(tableModel.getRowData(objectTable.getSelectedRow()));
   MainFrame w = (MainFrame) this.getTopLevelAncestor();
   w.addToDesktop(editor);
   editor.show();
 }
コード例 #2
0
 void addButton_actionPerformed(ActionEvent e) {
   GenericEditor editor = tableModel.getEditor();
   editor.editNew();
   MainFrame w = (MainFrame) this.getTopLevelAncestor();
   w.addToDesktop(editor);
   editor.show();
 }
コード例 #3
0
 public String[] getSelectedHosts() {
   Object[] sels = model.getSelectedValues(table);
   String[] vals = new String[sels.length];
   for (int x = 0; x < sels.length; x++) {
     vals[x] = sels[x] + "";
   }
   return vals;
 }
コード例 #4
0
 private void printCurrent() {
   if (tableModel instanceof TransportTableModel) {
     Transport o = (Transport) tableModel.getRowData(objectTable.getSelectedRow());
     String filename = TransportHelper.createHTMLFileFromTransport(o);
     try {
       Runtime runtime = Runtime.getRuntime();
       runtime.exec("explorer " + filename);
     } catch (IOException ioe) {
       System.out.println(ioe);
     }
   }
 }
コード例 #5
0
  public void end() {
    final int[] selected = table.getSelectedRows();

    model.clear(rows.size());
    Iterator i = rows.iterator();
    while (i.hasNext()) {
      model.addEntry((Map) i.next());
    }
    rows.clear();

    if (SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              model.fireListeners();
              fixSelection(selected);
            }
          });
    } else {
      model.fireListeners();
      fixSelection(selected);
    }
  }
コード例 #6
0
 private void removeCurrent() {
   LogicItem l = (LogicItem) tableModel.getRowData(objectTable.getSelectedRow());
   tableModel.remove(objectTable.getSelectedRow());
   MainFrame mf = (MainFrame) this.getTopLevelAncestor();
   mf.refreshLists(l, transport.client.tablemodel.GenericTableModel.REFRESH_DELETE);
 }
コード例 #7
0
 /**
  * refresh
  *
  * @param o Object
  */
 public void refresh(LogicItem o, int refreshType) {
   tableModel.refresh(o, refreshType);
 }
コード例 #8
0
 void refreshButton_actionPerformed(ActionEvent e) {
   tableModel.refresh();
 }