📄 swapbuttonbeaninfo.java
字号:
package com.magelang.splitter;
/**
* The bean information class for com.magelang.SwapButton.
* @see com.magelang.SwapButton
*/
public class SwapButtonBeanInfo extends java.beans.SimpleBeanInfo {
/**
* Gets the action.actionPerformed(java.awt.event.ActionEvent) method descriptor.
* @return java.beans.MethodDescriptor
*/
public java.beans.MethodDescriptor actionactionPerformed_javaawteventActionEventMethodEventDescriptor() {
java.beans.MethodDescriptor aDescriptor = null;
try {
/* Create and return the action.actionPerformed(java.awt.event.ActionEvent) method descriptor. */
java.lang.reflect.Method aMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aParameterTypes[] = {
java.awt.event.ActionEvent.class
};
aMethod = (java.awt.event.ActionListener.class).getMethod("actionPerformed", aParameterTypes);
} catch (java.lang.Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aMethod = findMethod((java.awt.event.ActionListener.class), "actionPerformed", 1);
};
try {
/* Try creating the method descriptor with parameter descriptors. */
java.beans.ParameterDescriptor aParameterDescriptor1 = new java.beans.ParameterDescriptor();
aParameterDescriptor1.setName("arg1");
aParameterDescriptor1.setDisplayName("e");
java.beans.ParameterDescriptor aParameterDescriptors[] = {
aParameterDescriptor1
};
aDescriptor = new java.beans.MethodDescriptor(aMethod, aParameterDescriptors);
} catch (java.lang.Throwable exception) {
/* Try creating the method descriptor without parameter descriptors. */
handleException(exception);
aDescriptor = new java.beans.MethodDescriptor(aMethod);
};
/* aDescriptor.setDisplayName("action"); */
aDescriptor.setShortDescription("action.actionPerformed(java.awt.event.ActionEvent)");
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (java.lang.Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Gets the action event set descriptor.
* @return java.beans.EventSetDescriptor
*/
public java.beans.EventSetDescriptor actionEventSetDescriptor() {
java.beans.EventSetDescriptor aDescriptor = null;
try {
try {
/* Try using method descriptors to create the action event set descriptor. */
java.beans.MethodDescriptor eventMethodDescriptors[] = {
actionactionPerformed_javaawteventActionEventMethodEventDescriptor() };
java.lang.reflect.Method anAddMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class anAddMethodParameterTypes[] = {
java.awt.event.ActionListener.class
};
anAddMethod = getBeanClass().getMethod("addActionListener", anAddMethodParameterTypes);
} catch (java.lang.Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
anAddMethod = findMethod(getBeanClass(), "addActionListener", 1);
};
java.lang.reflect.Method aRemoveMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aRemoveMethodParameterTypes[] = {
java.awt.event.ActionListener.class
};
aRemoveMethod = getBeanClass().getMethod("removeActionListener", aRemoveMethodParameterTypes);
} catch (java.lang.Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aRemoveMethod = findMethod(getBeanClass(), "removeActionListener", 1);
};
aDescriptor = new java.beans.EventSetDescriptor(
"action",
java.awt.event.ActionListener.class,
eventMethodDescriptors, anAddMethod, aRemoveMethod);
} catch (java.lang.Throwable exception) {
/* Using method descriptors failed, try using the methods names. */
handleException(exception);
java.lang.String eventMethodNames[] = {
"actionPerformed" };
aDescriptor = new java.beans.EventSetDescriptor(getBeanClass(),
"action",
java.awt.event.ActionListener.class,
eventMethodNames,
"addActionListener",
"removeActionListener");
};
/* aDescriptor.setUnicast(false); */
aDescriptor.setDisplayName("actionPerformed");
aDescriptor.setShortDescription("The button was pressed");
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (java.lang.Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Find the method by comparing (name & parameter size) against the methods in the class.
* @return java.lang.reflect.Method
* @param aClass java.lang.Class
* @param methodName java.lang.String
* @param parameterCount int
*/
public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) {
try {
/* Since this method attempts to find a method by getting all methods from the class, */
/* this method should only be called if getMethod can not find the method. */
java.lang.reflect.Method methods[] = aClass.getMethods();
for (int index = 0; index < methods.length; index++){
java.lang.reflect.Method method = methods[index];
if ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) {
return method;
};
};
} catch (java.lang.Throwable exception) {
return null;
};
return null;
}
/**
* Gets the bean class.
* @return java.lang.Class
*/
public static java.lang.Class getBeanClass() {
return com.magelang.splitter.SwapButton.class;
}
/**
* Gets the bean class name.
* @return java.lang.String
*/
public static java.lang.String getBeanClassName() {
return "com.magelang.SwapButton";
}
/**
* Return the event set descriptors for this bean.
* @return java.beans.EventSetDescriptor[]
*/
public java.beans.EventSetDescriptor[] getEventSetDescriptors() {
try {
java.beans.EventSetDescriptor aDescriptorList[] = {
actionEventSetDescriptor()
};
return aDescriptorList;
} catch (java.lang.Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Return the method descriptors for this bean.
* @return java.beans.MethodDescriptor[]
*/
public java.beans.MethodDescriptor[] getMethodDescriptors() {
try {
java.beans.MethodDescriptor aDescriptorList[] = {
};
return aDescriptorList;
} catch (java.lang.Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Return the property descriptors for this bean.
* @return java.beans.PropertyDescriptor[]
*/
public java.beans.PropertyDescriptor[] getPropertyDescriptors() {
try {
java.beans.PropertyDescriptor aDescriptorList[] = {
};
return aDescriptorList;
} catch (java.lang.Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Called whenever the bean information class throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(java.lang.Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -