home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
JMaskedTextFieldBeanInfo.java
< prev
next >
Wrap
Text File
|
1998-10-25
|
5KB
|
126 lines
/*
* @(#JMaskedTextFieldBeanInfo.java
*
* Copyright (c) 1998 Symantec Corporation. All Rights Reserved.
*
*/
package com.symantec.itools.swing;
import java.beans.*;
import java.util.ResourceBundle;
import com.symantec.itools.swing.DesignTimeResourceBundle;
import com.symantec.itools.vcafe.beans.PropertyDescriptorAttributes;
import com.symantec.itools.vcafe.beans.PropertyHelpIDs;
// 08/19/98 LAB Moved to GroupAWTAdditions folder.
/**
* BeanInfo for the JMaskedTextField component.
*
*/
public class JMaskedTextFieldBeanInfo extends com.symantec.itools.beans.HelperBeanInfo {
public JMaskedTextFieldBeanInfo()
{
setInheritSuperBeanInfo(true);
ResourceBundle resources = ResourceBundle.getBundle("com.symantec.itools.swing.DesignTimeResourceBundle");
String folderName = resources.getString(DesignTimeResourceBundle.SWING_ADDITIONS_FOLDER_TOOLBAR_KEY);
setComponentLibraryFolder(folderName);
setToolbarFolder(folderName);
setWinHelpKey(m_WinHelpID);
}
protected Class getBeanClass()
{
return JMaskedTextField.class;
}
public PropertyDescriptor[] getPropertyDescriptors() {
ResourceBundle prop = ResourceBundle.getBundle("symantec.itools.resources.PropBundle");
final Class beanClass = getBeanClass();
try {
PropertyDescriptor mask = new PropertyDescriptor("mask", beanClass);
mask.setDisplayName(prop.getString("mask"));
mask.setValue(PropertyDescriptorAttributes.WIN_HELP_ATTRIBUTE, new Integer(PropertyHelpIDs.JMASKEDTEXTFIELD_MASK_HELP_ID));
PropertyDescriptor document = new PropertyDescriptor ("document", beanClass);
document.setHidden (true);
PropertyDescriptor[] rv = { mask, document };
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
/**
* Gets an image that may be used to visually represent this bean
* (in the toolbar, on a form, etc).
* @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
* BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
* @return an image for this bean, always color even if requested monochrome
* @see BeanInfo#ICON_MONO_16x16
* @see BeanInfo#ICON_COLOR_16x16
* @see BeanInfo#ICON_MONO_32x32
* @see BeanInfo#ICON_COLOR_32x32
*/
public java.awt.Image getIcon(int iconKind) {
java.awt.Image img = null;
switch (iconKind) {
case BeanInfo.ICON_MONO_16x16:
case BeanInfo.ICON_COLOR_16x16:
img = loadImage("jmask16.gif");
break;
case BeanInfo.ICON_MONO_32x32:
case BeanInfo.ICON_COLOR_32x32:
img = loadImage("jmask32.gif");
}
return img;
}
/**
* Gets an array of descriptions of the methods used for "connections" by
* Visual CafΘ's Interaction Wizard.
* Included in each method description is a CONNECTIONS ConnectionDescriptor.
* @return method descriptions for this bean
* @see symantec.itools.beans.ConnectionDescriptor#CONNECTIONS
*/
/*public MethodDescriptor[] getMethodDescriptors() {
Class[] args = null;
ConnectionDescriptor connection;
java.util.Vector connections;
java.util.Vector md = new java.util.Vector();
ResourceBundle conn = ResourceBundle.getBundle("symantec.itools.resources.ConnBundle");
String s;
try {
MethodDescriptor getMask = new MethodDescriptor(beanClass.getMethod("getMask", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("output", "String", "",
"%name%.getMask()",
conn.getString("getMask"));
connections.addElement(connection);
getMask.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(getMask);
} catch (Exception e) { throw new Error("getMask:: " + e.toString()); }
try{
args = new Class[1];
args[0] = java.lang.String.class ;
MethodDescriptor setMask = new MethodDescriptor(beanClass.getMethod("setMask", args));
connections = new java.util.Vector();
connection = new ConnectionDescriptor("input", "String", "",
"%name%.setMask(%arg%);",
conn.getString("setMask"));
connections.addElement(connection);
setMask.setValue(ConnectionDescriptor.CONNECTIONS, connections);
md.addElement(setMask);
} catch (Exception e) { throw new Error("setMask:: " + e.toString()); }
MethodDescriptor[] rv = new MethodDescriptor[md.size()];
md.copyInto(rv);
return rv;
}*/
protected final static String m_WinHelpID = "0x600FB";
}