<MyColourRendererPlugin Project>/src/org/myorg/mycolourrendererplugin/ColouringRendererBeanInfo.java |
package org.myorg.mycolourrendererplugin;
import java.beans.BeanDescriptor;
import java.beans.EventSetDescriptor;
import java.beans.IntrospectionException;
import java.beans.MethodDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.openide.util.NbBundle;
public class ColouringRendererBeanInfo extends SimpleBeanInfo {
private static BeanDescriptor getBdescriptor(){
BeanDescriptor beanDescriptor = new BeanDescriptor ( ColouringRenderer.class , null );
beanDescriptor.setDisplayName(NbBundle.getMessage(ColouringRendererBeanInfo.class, "TIT_ColoringRenderer"));
return beanDescriptor; }
private static final int PROPERTY_splitValue = 0;
private static final int PROPERTY_lowerColor = 1;
private static final int PROPERTY_higherColor = 2;
private static PropertyDescriptor[] getPdescriptor(){
PropertyDescriptor[] properties = new PropertyDescriptor[3];
try {
properties[PROPERTY_splitValue] = new PropertyDescriptor ( "splitValue", ColouringRenderer.class, "getSplitValue", "setSplitValue" );
properties[PROPERTY_splitValue].setDisplayName ( NbBundle.getMessage(ColouringRendererBeanInfo.class, "NAME_SplitValue") );
properties[PROPERTY_lowerColor] = new PropertyDescriptor ( "lowerColor", ColouringRenderer.class, "getLowerColor", "setLowerColor" );
properties[PROPERTY_lowerColor].setDisplayName ( NbBundle.getMessage(ColouringRendererBeanInfo.class,"NAME_LowerColor") );
properties[PROPERTY_higherColor] = new PropertyDescriptor ( "higherColor", ColouringRenderer.class, "getHigherColor", "setHigherColor" );
properties[PROPERTY_higherColor].setDisplayName ( NbBundle.getMessage(ColouringRendererBeanInfo.class,"NAME_HigherColor") );
}
catch(IntrospectionException e) {
Logger.getLogger(ColouringRendererBeanInfo.class.getName()).log(Level.WARNING, null, e);
}
return properties; }
private static EventSetDescriptor[] getEdescriptor(){
EventSetDescriptor[] eventSets = new EventSetDescriptor[0];
return eventSets; }
private static MethodDescriptor[] getMdescriptor(){
MethodDescriptor[] methods = new MethodDescriptor[0];
return methods; }
private static final int defaultPropertyIndex = -1;
private static final int defaultEventIndex = -1;
<code></code>
@return
@Override
public BeanDescriptor getBeanDescriptor() {
return getBdescriptor();
}
<code></code>
@return
<p>
@Override
public PropertyDescriptor[] getPropertyDescriptors() {
return getPdescriptor();
}
<code></code>
@return
@Override
public EventSetDescriptor[] getEventSetDescriptors() {
return getEdescriptor();
}
<code></code>
@return
@Override
public MethodDescriptor[] getMethodDescriptors() {
return getMdescriptor();
}
@return
<P>
@Override
public int getDefaultPropertyIndex() {
return defaultPropertyIndex;
}
@return
<P>
@Override
public int getDefaultEventIndex() {
return defaultEventIndex;
}
}