home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / JCurrencyTextFieldBeanInfo.java < prev    next >
Text File  |  1998-11-25  |  6KB  |  133 lines

  1. package com.symantec.itools.swing;
  2.  
  3. import java.beans.*;
  4. import java.util.ResourceBundle;
  5. import com.symantec.itools.swing.DesignTimeResourceBundle;
  6. import com.symantec.itools.vcafe.beans.*;
  7. import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes;
  8.  
  9. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  10. //  10/06/98    VJ    Added code for grouping together currency properties
  11.  
  12. public class JCurrencyTextFieldBeanInfo extends com.symantec.itools.beans.HelperBeanInfo {
  13.   public JCurrencyTextFieldBeanInfo()
  14.     {
  15.         setInheritSuperBeanInfo(true);
  16.  
  17.         ResourceBundle resources = ResourceBundle.getBundle("com.symantec.itools.swing.DesignTimeResourceBundle");
  18.         String folderName = resources.getString(DesignTimeResourceBundle.SWING_ADDITIONS_FOLDER_TOOLBAR_KEY);
  19.         setComponentLibraryFolder(folderName);
  20.         setToolbarFolder(folderName);
  21.  
  22.         setWinHelpKey(m_WinHelpID);
  23.     }
  24.  
  25.     protected Class getBeanClass()
  26.     {
  27.         return JCurrencyTextField.class;
  28.     }
  29.  
  30.  
  31.  
  32.     /**
  33.      * Gets an image that may be used to visually represent this bean
  34.      * (in the toolbar, on a form, etc).
  35.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  36.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  37.      * @return an image for this bean, always color even if requested monochrome
  38.      * @see BeanInfo#ICON_MONO_16x16
  39.      * @see BeanInfo#ICON_COLOR_16x16
  40.      * @see BeanInfo#ICON_MONO_32x32
  41.      * @see BeanInfo#ICON_COLOR_32x32
  42.      */
  43.     public java.awt.Image getIcon(int iconKind) {
  44.     java.awt.Image img = null;
  45.     switch (iconKind) {
  46.         case BeanInfo.ICON_MONO_16x16:
  47.         case BeanInfo.ICON_COLOR_16x16:
  48.             img = loadImage("jcurrency16.gif");
  49.             break;
  50.         case BeanInfo.ICON_MONO_32x32:
  51.         case BeanInfo.ICON_COLOR_32x32:
  52.             img = loadImage("jcurrency32.gif");
  53.         }
  54.         return img;
  55.     }
  56.     
  57.     //VJ start
  58.     public PropertyDescriptor[] getPropertyDescriptors() {
  59.         try{
  60.             /*
  61.             DataText should not be exposed - Puru (10/26/98)
  62.         PropertyDescriptor dataText = new PropertyDescriptor("dataText", getBeanClass(),"getDataText",null);
  63.         dataText.setBound(false);
  64.         dataText.setConstrained(false);
  65.         dataText.setDisplayName("Data Text");
  66.         dataText.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  67.         dataText.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DATA_TEXT_HELP_ID));
  68.             */
  69.  
  70.         PropertyDescriptor ATMmode = new PropertyDescriptor("ATMmode", getBeanClass());
  71.         ATMmode.setBound(false);
  72.         ATMmode.setConstrained(false);
  73.         ATMmode.setDisplayName("ATM Mode");
  74.         ATMmode.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  75.         //to be uncommented later
  76.         //ATMmode.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_ATM_MODE_HELP_ID));
  77.  
  78.         PropertyDescriptor decimalPoint = new PropertyDescriptor("decimalPoint", getBeanClass());
  79.         decimalPoint.setBound(false);
  80.         decimalPoint.setConstrained(false);
  81.         decimalPoint.setDisplayName("Decimal Point");
  82.         decimalPoint.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  83.         decimalPoint.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DECIMAL_POINT_HELP_ID));
  84.  
  85.         PropertyDescriptor digitsAfterDecimal = new PropertyDescriptor("digitsAfterDecimal", getBeanClass());
  86.         digitsAfterDecimal.setBound(false);
  87.         digitsAfterDecimal.setConstrained(false);
  88.         digitsAfterDecimal.setDisplayName("Digits After Decimal");
  89.         digitsAfterDecimal.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  90.         digitsAfterDecimal.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_DIGITS_AFTER_DECIMAL_HELP_ID));
  91.  
  92.         PropertyDescriptor currencyLeading = new PropertyDescriptor("currencyLeading", getBeanClass());
  93.         currencyLeading.setBound(false);
  94.         currencyLeading.setConstrained(false);
  95.         currencyLeading.setDisplayName("Leading Symbol");
  96.         currencyLeading.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  97.         currencyLeading.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_LEADING_SYMBOL_HELP_ID));
  98.  
  99.         PropertyDescriptor separator = new PropertyDescriptor("separator", getBeanClass());
  100.         separator.setBound(false);
  101.         separator.setConstrained(false);
  102.         separator.setDisplayName("Separator");
  103.         separator.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  104.         separator.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_HELP_ID));
  105.  
  106.         PropertyDescriptor separatorEnabled = new PropertyDescriptor("separatorEnabled", getBeanClass());
  107.         separatorEnabled.setBound(false);
  108.         separatorEnabled.setConstrained(false);
  109.         separatorEnabled.setDisplayName("Separator Enabled");
  110.         separatorEnabled.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  111.         separatorEnabled.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SEPARATOR_ENABLED_HELP_ID));
  112.  
  113.         PropertyDescriptor currencySymbol = new PropertyDescriptor("currencySymbol", getBeanClass());
  114.         currencySymbol.setBound(false);
  115.         currencySymbol.setConstrained(false);
  116.         currencySymbol.setDisplayName("Symbol");
  117.         currencySymbol.setValue(PropertyDescriptorAttributes.GROUPING_ATTRIBUTE,"Currency");
  118.         currencySymbol.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JCURRENCYTEXTFIELD_SYMBOL_HELP_ID));
  119.  
  120.         PropertyDescriptor document = new PropertyDescriptor ("document", getBeanClass ());
  121.         document.setHidden (true);
  122.  
  123.          PropertyDescriptor[] rv = {ATMmode,currencySymbol,currencyLeading,decimalPoint,digitsAfterDecimal,
  124.                                      separator,separatorEnabled,document};
  125.  
  126.         return rv;
  127.         } catch (IntrospectionException e) { throw new Error(e.toString()); }
  128.     }
  129.     //VJ end
  130.  
  131.     protected final static String m_WinHelpID = "0x600FC";
  132. }
  133.