我正在开发一些自定义屏幕和自定义操作,并希望在它们之间创建关联,就像添加“创建程序组”屏幕建议添加“创建程序组”操作一样。
所以我有一个屏幕,并希望将一个动作与它联系起来。该操作应放在“安装”屏幕上。在屏幕bean信息类中,我将以下行添加到构造函数中:
setAssociatedAction(MyAction.class.getName(), InstallationScreen.class.getName());
这似乎没有做任何事情。我重新编译,并重新添加屏幕到安装程序,但它不会提示我添加操作。我尝试将相同的设置添加到操作的构造函数中,认为可能两者都需要创建彼此的关联才能工作:
setAssociatedScreen(MyScreen.class.getName());
setInstallerTargetScreen(InstallationScreen.class.getName());
它也没有帮助。我甚至尝试通过创建动作来反过来查看是否请求创建屏幕,但是没有运气。幸运的是,设置安装程序目标屏幕按预期工作。
我也尝试了以下内容:
如果我做错了什么,我不确定我做错了什么。该文档不会包含任何其他依赖项:
希望这不是一个错误。
提前致谢!
修改
我即将解决此问题,但仅作为install4j的扩展。在BeanInfo中指定Bean类时,我使用了错误的类。
我有:
public MyActionBeanInfo() {
super("Title", "Description", "Category", false, true, null, MyActionBeanInfo.class);
}
而不是:
public MyActionBeanInfo() {
super("Title", "Description", "Category", false, true, null, MyAction.class);
}
作为一个小的增强,如果它不是一个有效的Bean类,是否可以从超级构造函数中抛出异常(可能是IllegalArgumentException)?
BUT!
当我没有用作扩展时,我仍然收到了ClassNotFound和NullPointer异常。
这是堆栈跟踪:
java.lang.ClassNotFoundException: com.geowareinc.util.installer.actions.MyAction
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.install4j.gui.views.installer.d.g.a(ejt:92)
at com.install4j.gui.views.installer.i.b.a(ejt:41)
at com.install4j.gui.views.installer.i.b.a(ejt:31)
at com.install4j.gui.views.installer.i.b.a(ejt:18)
at com.install4j.gui.views.installer.d.h.a(ejt:34)
at com.install4j.gui.views.installer.d.h.call(ejt:32)
at com.install4j.gui.views.installer.d.ax.a(ejt:1238)
at com.install4j.gui.views.installer.d.g.a(ejt:32)
at com.install4j.gui.views.installer.b.h.a(ejt:388)
at com.install4j.gui.views.installer.d.ax.f(ejt:691)
at com.install4j.gui.views.installer.d.bd.actionPerformed(ejt:540)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException
at sun.reflect.misc.ReflectUtil.checkPackageAccess(Unknown Source)
at sun.reflect.misc.ReflectUtil.isPackageAccessible(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at com.install4j.gui.views.installer.d.g.b(ejt:60)
at com.install4j.gui.views.installer.i.b.a(ejt:73)
at com.install4j.gui.views.installer.i.b.a(ejt:53)
at com.install4j.gui.views.installer.i.b.a(ejt:31)
at com.install4j.gui.views.installer.i.b.a(ejt:18)
at com.install4j.gui.views.installer.d.h.a(ejt:34)
at com.install4j.gui.views.installer.d.h.call(ejt:32)
at com.install4j.gui.views.installer.d.ax.a(ejt:1238)
at com.install4j.gui.views.installer.d.g.a(ejt:32)
at com.install4j.gui.views.installer.b.h.a(ejt:388)
at com.install4j.gui.views.installer.d.ax.f(ejt:691)
at com.install4j.gui.views.installer.d.bd.actionPerformed(ejt:540)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
答案 0 :(得分:1)
这是install4j中的一个错误。如果在安装程序 - >自定义代码&上添加bean,则无法加载关联的屏幕和操作。资源标签。
这将在5.1.7中修复。