View Javadoc
1 /*** 2 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/client/browser/ClassificationSchemePanel.java,v 1.4 2003/07/30 23:39:11 farrukh_najmi Exp $ 3 */ 4 package com.sun.xml.registry.client.browser; 5 6 import java.awt.*; 7 import java.awt.event.*; 8 import java.util.*; 9 import javax.swing.*; 10 import javax.xml.registry.*; 11 import javax.xml.registry.infomodel.*; 12 13 /*** 14 * Panel to edit/inspect a Service. 15 * 16 * @author <a href="mailto:Farrukh.Najmi@Sun.COM">Farrukh S. Najmi</a> 17 */ 18 public class ClassificationSchemePanel extends RegistryEntryPanel { 19 20 JCheckBox externalCheckBox = null; 21 22 String[] valueTypes = { 23 "Embedded Path", 24 "Non-Unique", 25 "Unique" 26 }; 27 JComboBox valueTypeCombo = null; 28 29 /*** 30 * Creates new ServicePanel 31 */ 32 public ClassificationSchemePanel() { 33 setBorder(BorderFactory.createTitledBorder("ClassificationScheme")); 34 35 externalCheckBox = new JCheckBox("External ClassificationScheme"); 36 externalCheckBox.setSelected(false); 37 externalCheckBox.setEnabled(false); 38 c.gridx = 0; 39 c.gridy = row+0; 40 c.gridwidth = 1; 41 c.gridheight = 1; 42 c.weightx = 0.0; 43 c.weighty = 0.0; 44 c.fill = GridBagConstraints.NONE; 45 c.anchor = GridBagConstraints.WEST; 46 c.insets = new Insets(4, 4, 0, 4); 47 gbl.setConstraints(externalCheckBox, c); 48 add(externalCheckBox); 49 50 JLabel valueTypeLabel = new JLabel("Value Type:", SwingConstants.LEFT); 51 c.gridx = 0; 52 c.gridy = row+1; 53 c.gridwidth = 1; 54 c.gridheight = 1; 55 c.weightx = 0.0; 56 c.weighty = 0.0; 57 c.fill = GridBagConstraints.NONE; 58 c.anchor = GridBagConstraints.WEST; 59 c.insets = new Insets(4, 4, 0, 4); 60 gbl.setConstraints(valueTypeLabel, c); 61 add(valueTypeLabel); 62 63 valueTypeCombo = new JComboBox(valueTypes); 64 valueTypeCombo.setEditable(true); 65 c.gridx = 0; 66 c.gridy = row+2; 67 c.gridwidth = 1; 68 c.gridheight = 1; 69 c.weightx = 0.5; 70 c.weighty = 0.0; 71 c.fill = GridBagConstraints.HORIZONTAL; 72 c.anchor = GridBagConstraints.WEST; 73 c.insets = new Insets(4, 4, 0, 4); 74 gbl.setConstraints(valueTypeCombo, c); 75 add(valueTypeCombo); 76 77 } 78 79 public void setModel(Object obj) throws JAXRException { 80 if (!(obj instanceof ClassificationScheme)) { 81 throw new InvalidRequestException("Expecting a ClassificationScheme. Got a " + obj.getClass().getName()); 82 } 83 super.setModel(obj); 84 ClassificationScheme classificationScheme = (ClassificationScheme)obj; 85 86 try { 87 if (classificationScheme != null) { 88 externalCheckBox.setSelected(classificationScheme.isExternal()); 89 } 90 } 91 catch (JAXRException e) { 92 RegistryBrowser.displayError(e); 93 } 94 } 95 96 public Object getModel() throws JAXRException { 97 super.getModel(); 98 return model; 99 } 100 101 protected void validateInput() throws JAXRException { 102 super.validateInput(); 103 104 ClassificationScheme classificationScheme = (ClassificationScheme)model; 105 106 } 107 108 public void clear() throws JAXRException { 109 super.clear(); 110 externalCheckBox.setSelected(false); 111 } 112 113 114 } 115

This page was automatically generated by Maven