View Javadoc
1 /* 2 * ==================================================================== 3 * 4 * This code is subject to the freebxml License, Version 1.1 5 * 6 * Copyright (c) 2003 freebxml.org. All rights reserved. 7 * 8 * ==================================================================== 9 * 10 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/client/browser/DiscoveryPanel.java,v 1.25 2003/08/13 03:10:24 farrukh_najmi Exp $ 11 * 12 */ 13 package com.sun.xml.registry.client.browser; 14 15 import javax.swing.JPanel; 16 import javax.xml.registry.JAXRException; 17 18 /*** 19 * The top level panel for discovery operations. 20 * 21 * @author <a href="mailto:Farrukh.Najmi@Sun.COM">Farrukh S. Najmi</a> 22 */ 23 public class DiscoveryPanel extends JPanel { 24 25 private JAXRResourceBundle resourceBundle = JAXRResourceBundle.getInstance(); 26 27 private java.awt.GridBagConstraints c = new java.awt.GridBagConstraints(); 28 29 private RegistryObjectsTableModel registryObjectsTableModel = null; 30 private RegistryObjectsTable registryObjectsTable = null; 31 32 JPanel registryObjectsDetailPanel = null; 33 javax.swing.JSplitPane splitPane2 = null; 34 35 FindParamsPanel findParamsPanel = null; 36 37 /*** 38 * Class Constructor. 39 */ 40 public DiscoveryPanel() throws javax.xml.registry.JAXRException { 41 java.awt.GridBagLayout gbl = new java.awt.GridBagLayout(); 42 setLayout(gbl); 43 44 findParamsPanel = new FindParamsPanel(this); 45 46 JPanel findResultsPanel = createFindResultsPanel(); 47 48 javax.swing.JSplitPane splitPane = new javax.swing.JSplitPane(javax.swing.JSplitPane.HORIZONTAL_SPLIT, 49 findParamsPanel, findResultsPanel); 50 c.gridx = 0; 51 c.gridy = 0; 52 c.gridwidth = 1; 53 c.gridheight = 1; 54 c.weightx = 0.5; 55 c.weighty = 0.5; 56 c.fill = java.awt.GridBagConstraints.BOTH; 57 c.anchor = java.awt.GridBagConstraints.CENTER; 58 c.insets = new java.awt.Insets(4, 4, 4, 4); 59 gbl.setConstraints(splitPane, c); 60 add(splitPane); 61 62 } 63 64 private JPanel createFindResultsPanel() { 65 //The registryObjectsTable 66 JPanel registryObjectsTablePanel = new JPanel(); 67 registryObjectsTablePanel.setBorder( 68 javax.swing.BorderFactory.createTitledBorder(resourceBundle.getString("tabbedPane.discovery.searchResults"))); 69 registryObjectsTablePanel.setLayout(new java.awt.BorderLayout()); 70 71 registryObjectsTableModel = new RegistryObjectsTableModel(); 72 TableSorter sorter = new TableSorter(registryObjectsTableModel); 73 registryObjectsTable = new RegistryObjectsTable(sorter); 74 sorter.addMouseListenerToHeaderInTable(registryObjectsTable); 75 76 javax.swing.JScrollPane registryObjectsTablePane = 77 new javax.swing.JScrollPane(registryObjectsTable); 78 registryObjectsTablePanel.add(registryObjectsTablePane, java.awt.BorderLayout.CENTER); 79 80 return registryObjectsTablePanel; 81 } 82 83 void find() { 84 RegistryBrowser.setWaitCursor(); 85 86 if (RegistryBrowser.client.connection == null) { 87 RegistryBrowser.displayError("Connect to a registry by specifying Registry Location first."); 88 } 89 else { 90 javax.xml.registry.BulkResponse resp = findParamsPanel.executeQuery(); 91 92 if (resp != null) { 93 registryObjectsTableModel.update(resp); 94 } 95 } 96 97 RegistryBrowser.setDefaultCursor(); 98 99 } 100 101 public void clear() throws JAXRException { 102 registryObjectsTableModel.setRegistryObjects(new java.util.ArrayList()); 103 findParamsPanel.clear(); 104 } 105 }

This page was automatically generated by Maven