home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / ButtonPanelBeanInfo.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  7.3 KB  |  231 lines

  1. /*
  2.  * @(#ButtonPanelBeanInfo.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. package symantec.itools.db.beans.binding;
  9.  
  10. import java.beans.*;
  11. import symantec.itools.beans.*;
  12.  
  13.  
  14. /**
  15.  * BeanInfo for Mediator
  16.  *
  17.  */
  18.  
  19. public class ButtonPanelBeanInfo extends SimpleBeanInfo {
  20.  
  21.     public BeanInfo[] getAdditionalBeanInfo() {
  22.         try {
  23.             java.util.Vector v = new java.util.Vector();
  24.             BeanInfo[] rv;
  25.             BeanInfo b;
  26.             Class c = beanClass.getSuperclass();
  27.  
  28.             while (c.isAssignableFrom(Object.class) != true) {
  29.                 b = Introspector.getBeanInfo(c);
  30.                 v.addElement(b);
  31.                 c = c.getSuperclass();
  32.             }
  33.             rv = new BeanInfo[v.size()];
  34.             v.copyInto(rv);
  35.  
  36.             return rv;
  37.         }
  38.         catch (IntrospectionException e) { throw new Error(e.toString());}
  39.     }
  40.  
  41.     public BeanDescriptor getBeanDescriptor() {
  42.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  43.         bd.setFolder("JDBC");
  44.         bd.setToolbar("JDBC");
  45.  
  46.         return (BeanDescriptor) bd;
  47.     }
  48.  
  49.     public java.awt.Image getIcon(int iconKind) {
  50.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  51.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  52.             java.awt.Image img = loadImage("MediatorIconColor16.gif");
  53.             return img;
  54.         }
  55.  
  56.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  57.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  58.             java.awt.Image img = loadImage("MediatorIconColor32.gif");
  59.             return img;
  60.         }
  61.  
  62.         return null;
  63.     }
  64.  
  65.     /*public MethodDescriptor[] getMethodDescriptors() {
  66.         Class[] args;
  67.         ConnectionDescriptor connection;
  68.         java.util.Vector connections;
  69.         java.util.Vector md = new java.util.Vector();
  70.  
  71.  
  72.         MethodDescriptor[] rv = new MethodDescriptor[md.size()];
  73.         md.copyInto(rv);
  74.  
  75.         return rv;
  76.     }*/
  77.  
  78.     public PropertyDescriptor[] getPropertyDescriptors() {
  79.         try{
  80.         PropertyDescriptor dataSource = new PropertyDescriptor("dataSource", beanClass);
  81.         dataSource.setBound(false);
  82.         dataSource.setConstrained(false);
  83.         dataSource.setDisplayName("Record Set Navigator");
  84.         dataSource.setPropertyEditorClass(OutputEditor.class);
  85.  
  86.         PropertyDescriptor previous_button = new PropertyDescriptor("previous_button", beanClass);
  87.         previous_button.setBound(false);
  88.         previous_button.setConstrained(false);
  89.         previous_button.setDisplayName("Button: Previous");
  90.  
  91.         PropertyDescriptor next_button = new PropertyDescriptor("next_button", beanClass);
  92.         next_button.setBound(false);
  93.         next_button.setConstrained(false);
  94.         next_button.setDisplayName("Button: Next");
  95.  
  96.         PropertyDescriptor first_button = new PropertyDescriptor("first_button", beanClass);
  97.         first_button.setBound(false);
  98.         first_button.setConstrained(false);
  99.         first_button.setDisplayName("Button: First");
  100.  
  101.         PropertyDescriptor goto_button = new PropertyDescriptor("goto_button", beanClass);
  102.         goto_button.setBound(false);
  103.         goto_button.setConstrained(false);
  104.         goto_button.setDisplayName("Button: Goto");
  105.  
  106.         PropertyDescriptor insert_button = new PropertyDescriptor("insert_button", beanClass);
  107.         insert_button.setBound(false);
  108.         insert_button.setConstrained(false);
  109.         insert_button.setDisplayName("Button: Insert");
  110.  
  111.         PropertyDescriptor delete_button = new PropertyDescriptor("delete_button", beanClass);
  112.         delete_button.setBound(false);
  113.         delete_button.setConstrained(false);
  114.         delete_button.setDisplayName("Button: Delete");
  115.  
  116.         PropertyDescriptor restart_button = new PropertyDescriptor("restart_button", beanClass);
  117.         restart_button.setBound(false);
  118.         restart_button.setConstrained(false);
  119.         restart_button.setDisplayName("Button: Restart");
  120.  
  121.         PropertyDescriptor undo_button = new PropertyDescriptor("undo_button", beanClass);
  122.         undo_button.setBound(false);
  123.         undo_button.setConstrained(false);
  124.         undo_button.setDisplayName("Button: Undo");
  125.  
  126.         PropertyDescriptor save_button = new PropertyDescriptor("save_button", beanClass);
  127.         save_button.setBound(false);
  128.         save_button.setConstrained(false);
  129.         save_button.setDisplayName("Button: Save");
  130.  
  131.         PropertyDescriptor position_panel = new PropertyDescriptor("position_panel", beanClass);
  132.         position_panel.setBound(false);
  133.         position_panel.setConstrained(false);
  134.         position_panel.setDisplayName("Panel: position");
  135.  
  136.         PropertyDescriptor query_panel = new PropertyDescriptor("query_panel", beanClass);
  137.         query_panel.setBound(false);
  138.         query_panel.setConstrained(false);
  139.         query_panel.setDisplayName("Panel: Query");
  140.  
  141.         PropertyDescriptor nextString = new PropertyDescriptor("nextString", beanClass);
  142.         nextString.setBound(false);
  143.         nextString.setConstrained(false);
  144.         nextString.setDisplayName("Label: Next");
  145.  
  146.         PropertyDescriptor previousString = new PropertyDescriptor("previousString", beanClass);
  147.         previousString.setBound(false);
  148.         previousString.setConstrained(false);
  149.         previousString.setDisplayName("Label: Previous");
  150.  
  151.         PropertyDescriptor firstString = new PropertyDescriptor("firstString", beanClass);
  152.         firstString.setBound(false);
  153.         firstString.setConstrained(false);
  154.         firstString.setDisplayName("Label: First");
  155.  
  156.         PropertyDescriptor gotoString = new PropertyDescriptor("gotoString", beanClass);
  157.         gotoString.setBound(false);
  158.         gotoString.setConstrained(false);
  159.         gotoString.setDisplayName("Label: Goto");
  160.  
  161.         PropertyDescriptor reStartString = new PropertyDescriptor("reStartString", beanClass);
  162.         reStartString.setBound(false);
  163.         reStartString.setConstrained(false);
  164.         reStartString.setDisplayName("Label: Re-Start");
  165.  
  166.         PropertyDescriptor insertString = new PropertyDescriptor("insertString", beanClass);
  167.         insertString.setBound(false);
  168.         insertString.setConstrained(false);
  169.         insertString.setDisplayName("Label: Insert");
  170.  
  171.         PropertyDescriptor saveString = new PropertyDescriptor("saveString", beanClass);
  172.         saveString.setBound(false);
  173.         saveString.setConstrained(false);
  174.         saveString.setDisplayName("Label: Save");
  175.  
  176.         PropertyDescriptor undoString = new PropertyDescriptor("undoString", beanClass);
  177.         undoString.setBound(false);
  178.         undoString.setConstrained(false);
  179.         undoString.setDisplayName("Label: Undo");
  180.  
  181.         PropertyDescriptor deleteString = new PropertyDescriptor("deleteString", beanClass);
  182.         deleteString.setBound(false);
  183.         deleteString.setConstrained(false);
  184.         deleteString.setDisplayName("Label: Delete");
  185.  
  186.         PropertyDescriptor startString = new PropertyDescriptor("startString", beanClass);
  187.         startString.setBound(false);
  188.         startString.setConstrained(false);
  189.         startString.setDisplayName("Label: Start");
  190.  
  191.         PropertyDescriptor executeString = new PropertyDescriptor("executeString", beanClass);
  192.         executeString.setBound(false);
  193.         executeString.setConstrained(false);
  194.         executeString.setDisplayName("Label: Execute");
  195.         PropertyDescriptor[] rv = {
  196.             dataSource,
  197.             next_button,
  198.             previous_button,
  199.             first_button,
  200.             goto_button,
  201.             restart_button,
  202.             delete_button,
  203.             undo_button,
  204.             insert_button,
  205.             save_button,
  206.             position_panel,
  207.             query_panel,
  208.             previousString,
  209.             nextString,
  210.             firstString,
  211.             gotoString,
  212.             reStartString,
  213.             insertString,
  214.             saveString,
  215.             undoString,
  216.             deleteString,
  217.             startString,
  218.             executeString
  219.             };
  220.  
  221.         return rv;
  222.         } catch (IntrospectionException e) { throw new Error(e.toString()); }
  223.     }
  224.  
  225.     public int getDefaultPropertyIndex() {
  226.         return 0;    //  the index for our default property is always 0
  227.     }
  228.  
  229.     private final static Class beanClass = ButtonPanel.class;
  230.  
  231. }    //  end of class MediatorBeanInfo