/** * Get or create a component displaying the node properties. * Only to be called if hasProperties() is true; */ public JComponent getPropertiesComponent() { if(propcomp==null) { propcomp = new RequiredServiceProperties(); } propcomp.setService(info); return propcomp; }
/** * Create new service properties panel. */ public RequiredServiceProperties() { super(" Service Properties "); createTextField("Name"); createTextField("Type"); createTextField("Multiple"); createTextField("Binding"); addFullLineComponent("Methods_label", new JLabel("Methods")); JTable table = SGUI.createReadOnlyTable(); table.setTableHeader(new ResizeableTableHeader(table.getColumnModel())); JPanel scroll = new JPanel(new BorderLayout()); scroll.add(table, BorderLayout.CENTER); scroll.add(table.getTableHeader(), BorderLayout.NORTH); addFullLineComponent("Methods", scroll); }
getTextField("Name").setText(info.getName()); getTextField("Type").setText(info.getType().getTypeName()); getTextField("Multiple").setText(""+info.isMultiple()); RequiredServiceBinding bind = info.getDefaultBinding(); StringBuffer buf = new StringBuffer(); if(bind.getComponentType()!=null) buf.append(" component type="+bind.getComponentType()); getTextField("Binding").setText(buf.toString()); JTable list = (JTable)getComponent("Methods").getComponent(0); JTable list = (JTable)getComponent("Methods").getComponent(0); DefaultTableModel dtm = new DefaultTableModel(); dtm.addColumn("Not Available", new String[]{"Class file for service type not available locally.", "Methods cannot be displayed."});