/** Listener to handle button actions */
 public void actionPerformed(ActionEvent e) {
   // Check if the user pressed the remove button
   if (e.getSource() == remove_button) {
     int row = table.getSelectedRow();
     model.removeRow(row);
     table.clearSelection();
     table.repaint();
     valueChanged(null);
   }
   // Check if the user pressed the remove all button
   if (e.getSource() == remove_all_button) {
     model.clearAll();
     table.setRowSelectionInterval(0, 0);
     table.repaint();
     valueChanged(null);
   }
   // Check if the user pressed the filter button
   if (e.getSource() == filter_button) {
     filter.showDialog();
     if (filter.okPressed()) {
       // Update the display with new filter
       model.setFilter(filter);
       table.repaint();
     }
   }
   // Check if the user pressed the start button
   if (e.getSource() == start_button) {
     start();
   }
   // Check if the user pressed the stop button
   if (e.getSource() == stop_button) {
     stop();
   }
   // Check if the user wants to switch layout
   if (e.getSource() == layout_button) {
     details_panel.remove(details_soap);
     details_soap.removeAll();
     if (details_soap.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
       details_soap = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
     } else {
       details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
     }
     details_soap.setTopComponent(request_panel);
     details_soap.setRightComponent(response_panel);
     details_soap.setResizeWeight(.5);
     details_panel.add(details_soap, BorderLayout.CENTER);
     details_panel.validate();
     details_panel.repaint();
   }
   // Check if the user is changing the reflow option
   if (e.getSource() == reflow_xml) {
     request_text.setReflowXML(reflow_xml.isSelected());
     response_text.setReflowXML(reflow_xml.isSelected());
   }
 }
 public void setSwingFocus(ICFLibAnyObj value) {
   final String S_ProcName = "setSwingFocus";
   if ((value == null) || (value instanceof ICFSecurityISOCountryObj)) {
     super.setSwingFocus(value);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(
             getClass(), S_ProcName, "value", value, "ICFSecurityISOCountryObj");
   }
   if (dataTable == null) {
     return;
   }
   if (value == null) {
     dataTable.clearSelection();
   } else {
     ICFInternetISOCountryObj curSelected;
     PickerTableModel tblDataModel = getDataModel();
     int selectedRow = dataTable.getSelectedRow();
     int modelIndex = dataTable.convertRowIndexToModel(selectedRow);
     if (selectedRow >= 0) {
       Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER);
       curSelected = (ICFInternetISOCountryObj) selectedRowData;
     } else {
       curSelected = null;
     }
     if (curSelected != value) {
       int len = tblDataModel.getRowCount();
       int idx = 0;
       while ((idx < len) && (tblDataModel.getValueAt(idx, COLID_ROW_HEADER) != value)) {
         idx++;
       }
       if (idx < len) {
         int viewRow = dataTable.convertRowIndexToView(idx);
         dataTable.clearSelection();
         dataTable.addRowSelectionInterval(viewRow, viewRow);
       }
     }
   }
 }
Esempio n. 3
0
  protected void moveSelectedRow(JTable from, JTable to) {

    SimpleColorTableModel fromModel = (SimpleColorTableModel) from.getModel();
    SimpleColorTableModel toModel = (SimpleColorTableModel) to.getModel();

    for (int index : from.getSelectedRows()) {

      Vector rowValue = (Vector) fromModel.getDataVector().get(index);

      toModel.addRow(rowValue);
    }

    int selectedRow = -1;
    while ((selectedRow = from.getSelectedRow()) != -1) {

      fromModel.removeRow(selectedRow);
    }

    from.clearSelection();
  }
Esempio n. 4
0
 /** Resets the contents of this CallStackComponent. */
 public void reset() {
   methodNames.removeAllElements();
   callStackTable.revalidate();
   callStackTable.clearSelection();
 }
Esempio n. 5
0
 /** The action of the table loosing focus */
 public void callStackTable_focusLost(FocusEvent e) {
   callStackTable.clearSelection();
 }
 /** The action of the table loosing the focus. */
 public void segmentTable_focusLost(FocusEvent e) {
   segmentTable.clearSelection();
 }
 /** The action of the table gaining the focus. */
 public void segmentTable_focusGained(FocusEvent e) {
   segmentTable.clearSelection();
   notifyListeners();
 }
 /** Hides all selections. */
 public void hideSelect() {
   segmentTable.clearSelection();
 }
 /** Resets the contents of this MemorySegmentComponent. */
 public void reset() {
   segmentTable.clearSelection();
   hideFlash();
   hideHighlight();
 }