home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
HelperBeanInfo.java
< prev
next >
Wrap
Text File
|
1998-10-21
|
5KB
|
185 lines
package com.symantec.itools.beans;
import java.beans.*;
import com.symantec.itools.vcafe.beans.BeanDescriptorAttributes;
public abstract class HelperBeanInfo
extends SimpleBeanInfo
{
//
// Implementation
//
public BeanDescriptor getBeanDescriptor()
{
BeanDescriptor beanDescriptor = new BeanDescriptor(getBeanClass(),getCustomizerClass());
modifyBeanDescriptor(beanDescriptor);
return beanDescriptor;
}
public BeanInfo[] getAdditionalBeanInfo()
{
if (m_InheritSuperBeanInfo)
{
BeanInfo[] supersbeanInfo = new BeanInfo[1];
try
{
supersbeanInfo[0] = Introspector.getBeanInfo(getBeanClass().getSuperclass());
return supersbeanInfo;
}
catch(IntrospectionException e)
{
e.printStackTrace();
}
}
return null;
}
public java.awt.Image getIcon(int iconKind)
{
switch(iconKind)
{
case ICON_COLOR_16x16:
if (m_16x16ColorIcon != null)
return loadImage(m_16x16ColorIcon);
break;
case ICON_COLOR_32x32:
if (m_32x32ColorIcon != null)
return loadImage(m_16x16ColorIcon);
break;
case ICON_MONO_16x16:
if (m_16x16MonoIcon != null)
return loadImage(m_16x16ColorIcon);
break;
case ICON_MONO_32x32:
if (m_32x32MonoIcon != null)
return loadImage(m_32x32MonoIcon);
break;
}//switch
return null;
}
//
// Properties
//
protected void set16x16ColorIconName(String new16x16ColorIcon)
{
m_16x16ColorIcon = new16x16ColorIcon;
}
protected void set32x32ColorIconName(String new32x32ColorIcon)
{
m_32x32ColorIcon = new32x32ColorIcon;
}
protected void set16x16MonoIconName(String new16x16MonoIcon)
{
m_16x16MonoIcon = new16x16MonoIcon;
}
protected void set32x32MonoIconName(String new32x32MonoIcon)
{
m_32x32MonoIcon = new32x32MonoIcon;
}
protected boolean isInheritSuperBeanInfo()
{
return m_InheritSuperBeanInfo;
}
protected void setInheritSuperBeanInfo(boolean newInheritSuperBeanInfo)
{
m_InheritSuperBeanInfo = newInheritSuperBeanInfo;
}
protected String getComponentLibraryFolder()
{
return m_ComponentLibraryFolder;
}
protected void setComponentLibraryFolder(String newComponentLibraryFolder)
{
m_ComponentLibraryFolder = newComponentLibraryFolder;
}
protected String getToolbarFolder()
{
return m_ToolbarFolder;
}
protected void setToolbarFolder(String newToolbarFolder)
{
m_ToolbarFolder = newToolbarFolder;
}
protected String getWinHelpKey()
{
return m_WinHelpKey;
}
protected void setWinHelpKey(String newWinHelpKey)
{
m_WinHelpKey = newWinHelpKey;
}
protected Boolean getIsContainer()
{
return m_IsContainer;
}
protected void setIsContainer(Boolean newIsContainer)
{
m_IsContainer = newIsContainer;
}
protected void setIsContainer(boolean newIsContainer)
{
setIsContainer(newIsContainer ? Boolean.TRUE : Boolean.FALSE);
}
//
// Overrides
//
protected abstract Class getBeanClass();
protected Class getCustomizerClass()
{
return null;
}
protected void modifyBeanDescriptor(BeanDescriptor beanDescriptor)
{
if (m_ComponentLibraryFolder != null)
beanDescriptor.setValue(BeanDescriptorAttributes.FOLDER_ATTRIBUTE,m_ComponentLibraryFolder);
if (m_ToolbarFolder != null)
beanDescriptor.setValue(BeanDescriptorAttributes.TOOLBAR_ATTRIBUTE,m_ToolbarFolder);
if (m_WinHelpKey != null)
beanDescriptor.setValue(BeanDescriptorAttributes.WINHELP_ATTRIBUTE,m_WinHelpKey);
if (m_IsContainer != null)
beanDescriptor.setValue(com.symantec.itools.swing.beans.BeanDescriptorAttributes.IS_CONTAINER_ATTRIBUTE,m_IsContainer);
}
protected boolean m_InheritSuperBeanInfo = false;
protected String m_ComponentLibraryFolder = null;
protected String m_ToolbarFolder = null;
protected String m_WinHelpKey = null;
protected Boolean m_IsContainer = null;
protected String m_16x16ColorIcon = null;
protected String m_32x32ColorIcon = null;
protected String m_16x16MonoIcon = null;
protected String m_32x32MonoIcon = null;
}