コード例 #1
0
 /** Listener to handle table selection changes */
 public void valueChanged(ListSelectionEvent e) {
   int row = table.getSelectedRow();
   // Check if they selected a specific row
   if (row > 0) {
     remove_button.setEnabled(true);
   } else {
     remove_button.setEnabled(false);
   }
   // Check for "most recent" selection
   if (row == 0) {
     row = model.getRowCount() - 1;
     if (row == 0) {
       row = -1;
     }
   }
   if (row == -1) {
     // Clear the details panel
     details_time_value.setText("");
     details_target_value.setText("");
     details_status_value.setText("");
     request_text.setText("");
     response_text.setText("");
   } else {
     // Show the details for the row
     SOAPMonitorData soap = model.getData(row);
     details_time_value.setText(soap.getTime());
     details_target_value.setText(soap.getTargetService());
     details_status_value.setText(soap.getStatus());
     if (soap.getSOAPRequest() == null) {
       request_text.setText("");
     } else {
       request_text.setText(soap.getSOAPRequest());
       request_text.setCaretPosition(0);
     }
     if (soap.getSOAPResponse() == null) {
       response_text.setText("");
     } else {
       response_text.setText(soap.getSOAPResponse());
       response_text.setCaretPosition(0);
     }
   }
 }
コード例 #2
0
 /** Check if soap data matches filter */
 public boolean filterMatch(SOAPMonitorData soap) {
   boolean match = true;
   if (filter_include != null) {
     // Check for service match
     Enumeration e = filter_include.elements();
     match = false;
     while (e.hasMoreElements() && !match) {
       String service = (String) e.nextElement();
       if (service.equals(soap.getTargetService())) {
         match = true;
       }
     }
   }
   if (filter_exclude != null) {
     // Check for service match
     Enumeration e = filter_exclude.elements();
     while (e.hasMoreElements() && match) {
       String service = (String) e.nextElement();
       if (service.equals(soap.getTargetService())) {
         match = false;
       }
     }
   }
   if (filter_active) {
     // Check for active status match
     if (soap.getSOAPResponse() != null) {
       match = false;
     }
   }
   if (filter_complete) {
     // Check for complete status match
     if (soap.getSOAPResponse() == null) {
       match = false;
     }
   }
   // The "most recent" is always a match
   if (soap.getId() == null) {
     match = true;
   }
   return match;
 }