home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
MaskedTextFieldBeanInfo.java
< prev
next >
Wrap
Text File
|
1999-01-14
|
4KB
|
101 lines
/*
* @(#MaskedTextFieldBeanInfo.java
*
* Copyright (c) 1998 Symantec Corporation. All Rights Reserved.
*
*/
package com.symantec.itools.awt;
import java.beans.*;
import java.util.ResourceBundle;
import com.symantec.itools.beans.HelperBeanInfo;
import com.symantec.itools.vcafe.beans.ActionDescriptor;
import com.symantec.itools.vcafe.beans.MethodDescriptorAttributes;
// 08/19/98 LAB Moved to GroupAWTAdditions folder.
/**
* BeanInfo for the MaskedTextField component.
*
*/
public class MaskedTextFieldBeanInfo extends HelperBeanInfo {
protected final static String m_WinHelpID = "0x602C8";
public MaskedTextFieldBeanInfo() {
setInheritSuperBeanInfo(true);
ResourceBundle group = ResourceBundle.getBundle("com.symantec.itools.awt.GroupBundle");
String s = group.getString("GroupAWTAdditions");
setComponentLibraryFolder(s);
setToolbarFolder(s);
setWinHelpKey(m_WinHelpID);
// set icons
set16x16ColorIconName("mask16.gif");
set32x32ColorIconName("mask32.gif");
set16x16MonoIconName("mask16bw.gif");
set32x32MonoIconName("mask32bw.gif");
}
public PropertyDescriptor[] getPropertyDescriptors() {
ResourceBundle prop = ResourceBundle.getBundle("com.symantec.itools.awt.PropBundle");
try {
PropertyDescriptor mask = new PropertyDescriptor("mask", beanClass);
mask.setDisplayName(prop.getString("mask"));
PropertyDescriptor[] rv = { mask };
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
/**
* 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 ActionDescriptor.
* @return method descriptions for this bean
* @see com.symantec.itools.vcafe.beans.ActionDescriptor
*/
public MethodDescriptor[] getMethodDescriptors() {
Class[] args = null;
ActionDescriptor connection;
java.util.Vector connections;
java.util.Vector md = new java.util.Vector();
ResourceBundle conn = ResourceBundle.getBundle("com.symantec.itools.awt.ConnBundle");
String s;
try {
MethodDescriptor getMask = new MethodDescriptor(beanClass.getMethod("getMask", args));
connections = new java.util.Vector();
connection = new ActionDescriptor("output", "String", "",
"%name%.getMask()",
conn.getString("getMask"));
connections.addElement(connection);
getMask.setValue(MethodDescriptorAttributes.ACTION_ATTRIBUTE, 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 ActionDescriptor("input", "String", "",
"%name%.setMask(%arg%);",
conn.getString("setMask"));
connections.addElement(connection);
setMask.setValue(MethodDescriptorAttributes.ACTION_ATTRIBUTE, 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 Class getBeanClass()
{
return beanClass;
}
private final static Class beanClass = MaskedTextField.class;
}