home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 7.3 KB | 231 lines |
- /*
- * @(#ButtonPanelBeanInfo.java
- *
- * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
- *
- */
-
- package symantec.itools.db.beans.binding;
-
- import java.beans.*;
- import symantec.itools.beans.*;
-
-
- /**
- * BeanInfo for Mediator
- *
- */
-
- public class ButtonPanelBeanInfo extends SimpleBeanInfo {
-
- public BeanInfo[] getAdditionalBeanInfo() {
- try {
- java.util.Vector v = new java.util.Vector();
- BeanInfo[] rv;
- BeanInfo b;
- Class c = beanClass.getSuperclass();
-
- while (c.isAssignableFrom(Object.class) != true) {
- b = Introspector.getBeanInfo(c);
- v.addElement(b);
- c = c.getSuperclass();
- }
- rv = new BeanInfo[v.size()];
- v.copyInto(rv);
-
- return rv;
- }
- catch (IntrospectionException e) { throw new Error(e.toString());}
- }
-
- public BeanDescriptor getBeanDescriptor() {
- SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
- bd.setFolder("JDBC");
- bd.setToolbar("JDBC");
-
- return (BeanDescriptor) bd;
- }
-
- public java.awt.Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_MONO_16x16 ||
- iconKind == BeanInfo.ICON_COLOR_16x16) {
- java.awt.Image img = loadImage("MediatorIconColor16.gif");
- return img;
- }
-
- if (iconKind == BeanInfo.ICON_MONO_32x32 ||
- iconKind == BeanInfo.ICON_COLOR_32x32) {
- java.awt.Image img = loadImage("MediatorIconColor32.gif");
- return img;
- }
-
- return null;
- }
-
- /*public MethodDescriptor[] getMethodDescriptors() {
- Class[] args;
- ConnectionDescriptor connection;
- java.util.Vector connections;
- java.util.Vector md = new java.util.Vector();
-
-
- MethodDescriptor[] rv = new MethodDescriptor[md.size()];
- md.copyInto(rv);
-
- return rv;
- }*/
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- try{
- PropertyDescriptor dataSource = new PropertyDescriptor("dataSource", beanClass);
- dataSource.setBound(false);
- dataSource.setConstrained(false);
- dataSource.setDisplayName("Record Set Navigator");
- dataSource.setPropertyEditorClass(OutputEditor.class);
-
- PropertyDescriptor previous_button = new PropertyDescriptor("previous_button", beanClass);
- previous_button.setBound(false);
- previous_button.setConstrained(false);
- previous_button.setDisplayName("Button: Previous");
-
- PropertyDescriptor next_button = new PropertyDescriptor("next_button", beanClass);
- next_button.setBound(false);
- next_button.setConstrained(false);
- next_button.setDisplayName("Button: Next");
-
- PropertyDescriptor first_button = new PropertyDescriptor("first_button", beanClass);
- first_button.setBound(false);
- first_button.setConstrained(false);
- first_button.setDisplayName("Button: First");
-
- PropertyDescriptor goto_button = new PropertyDescriptor("goto_button", beanClass);
- goto_button.setBound(false);
- goto_button.setConstrained(false);
- goto_button.setDisplayName("Button: Goto");
-
- PropertyDescriptor insert_button = new PropertyDescriptor("insert_button", beanClass);
- insert_button.setBound(false);
- insert_button.setConstrained(false);
- insert_button.setDisplayName("Button: Insert");
-
- PropertyDescriptor delete_button = new PropertyDescriptor("delete_button", beanClass);
- delete_button.setBound(false);
- delete_button.setConstrained(false);
- delete_button.setDisplayName("Button: Delete");
-
- PropertyDescriptor restart_button = new PropertyDescriptor("restart_button", beanClass);
- restart_button.setBound(false);
- restart_button.setConstrained(false);
- restart_button.setDisplayName("Button: Restart");
-
- PropertyDescriptor undo_button = new PropertyDescriptor("undo_button", beanClass);
- undo_button.setBound(false);
- undo_button.setConstrained(false);
- undo_button.setDisplayName("Button: Undo");
-
- PropertyDescriptor save_button = new PropertyDescriptor("save_button", beanClass);
- save_button.setBound(false);
- save_button.setConstrained(false);
- save_button.setDisplayName("Button: Save");
-
- PropertyDescriptor position_panel = new PropertyDescriptor("position_panel", beanClass);
- position_panel.setBound(false);
- position_panel.setConstrained(false);
- position_panel.setDisplayName("Panel: position");
-
- PropertyDescriptor query_panel = new PropertyDescriptor("query_panel", beanClass);
- query_panel.setBound(false);
- query_panel.setConstrained(false);
- query_panel.setDisplayName("Panel: Query");
-
- PropertyDescriptor nextString = new PropertyDescriptor("nextString", beanClass);
- nextString.setBound(false);
- nextString.setConstrained(false);
- nextString.setDisplayName("Label: Next");
-
- PropertyDescriptor previousString = new PropertyDescriptor("previousString", beanClass);
- previousString.setBound(false);
- previousString.setConstrained(false);
- previousString.setDisplayName("Label: Previous");
-
- PropertyDescriptor firstString = new PropertyDescriptor("firstString", beanClass);
- firstString.setBound(false);
- firstString.setConstrained(false);
- firstString.setDisplayName("Label: First");
-
- PropertyDescriptor gotoString = new PropertyDescriptor("gotoString", beanClass);
- gotoString.setBound(false);
- gotoString.setConstrained(false);
- gotoString.setDisplayName("Label: Goto");
-
- PropertyDescriptor reStartString = new PropertyDescriptor("reStartString", beanClass);
- reStartString.setBound(false);
- reStartString.setConstrained(false);
- reStartString.setDisplayName("Label: Re-Start");
-
- PropertyDescriptor insertString = new PropertyDescriptor("insertString", beanClass);
- insertString.setBound(false);
- insertString.setConstrained(false);
- insertString.setDisplayName("Label: Insert");
-
- PropertyDescriptor saveString = new PropertyDescriptor("saveString", beanClass);
- saveString.setBound(false);
- saveString.setConstrained(false);
- saveString.setDisplayName("Label: Save");
-
- PropertyDescriptor undoString = new PropertyDescriptor("undoString", beanClass);
- undoString.setBound(false);
- undoString.setConstrained(false);
- undoString.setDisplayName("Label: Undo");
-
- PropertyDescriptor deleteString = new PropertyDescriptor("deleteString", beanClass);
- deleteString.setBound(false);
- deleteString.setConstrained(false);
- deleteString.setDisplayName("Label: Delete");
-
- PropertyDescriptor startString = new PropertyDescriptor("startString", beanClass);
- startString.setBound(false);
- startString.setConstrained(false);
- startString.setDisplayName("Label: Start");
-
- PropertyDescriptor executeString = new PropertyDescriptor("executeString", beanClass);
- executeString.setBound(false);
- executeString.setConstrained(false);
- executeString.setDisplayName("Label: Execute");
- PropertyDescriptor[] rv = {
- dataSource,
- next_button,
- previous_button,
- first_button,
- goto_button,
- restart_button,
- delete_button,
- undo_button,
- insert_button,
- save_button,
- position_panel,
- query_panel,
- previousString,
- nextString,
- firstString,
- gotoString,
- reStartString,
- insertString,
- saveString,
- undoString,
- deleteString,
- startString,
- executeString
- };
-
- return rv;
- } catch (IntrospectionException e) { throw new Error(e.toString()); }
- }
-
- public int getDefaultPropertyIndex() {
- return 0; // the index for our default property is always 0
- }
-
- private final static Class beanClass = ButtonPanel.class;
-
- } // end of class MediatorBeanInfo