Hey,
I want to apologize up front for the length of this email...
I have taken over an old Pivot 1.5 app, and I am trying to take examples from
an existing process and create a similar one. There is an existing wizard that
takes input from the user (sets up a card pane and includes src from several
wtkx files) and then processes the information at the end.
All I am trying to do is get one screen to show server/UI/middle tier version
information. I have the logic in place that probes for the latest versions and
lets the UI know when it needs to be updated and locks out certain
functionality. What I am having the hardest time doing is simply getting a
table pane created.
Here is what I have...
CODE
private class ViewVersionAction extends Action
{
@Override
public void perform()
{
try
{
//AutoSyncTemplateWarning astw =
(AutoSyncTemplateWarning)
AutoSyncView.readObject("xml/autosync/version/versionInfo.wtkx");
AutoSyncVersion asv = (AutoSyncVersion)
AutoSyncView.readObject("xml/autosync/version/autoSyncVersion.wtkx");
asv.setPreferredSize(600, 350);
asv.setLocation(getWidth() / 2 -
asv.getPreferredWidth() / 2, getHeight() / 2 - asv.getPreferredHeight() / 2);
asv.open(AutoSyncView.display, AutoSyncView.window);
asv.register(selfReference);
}
catch(Exception e)
{
e.printStackTrace(log.getPrintStream());
e.printStackTrace();
}
}
}
autoSyncVersion.wtkx
<siu.autosync.version:AutoSyncVersion
xmlns:wtkx="http://pivot.apache.org/wtkx"
xmlns="org.apache.pivot.wtk"
xmlns:content="org.apache.pivot.wtk.content"
xmlns:siu.autosync.version="web.ui.autosync.version"
title="AutoSync Version">
<content>
<TablePane styles="{padding:8,
horizontalSpacing:5, verticalSpacing:5}">
<columns>
<TablePane.Column width="1*" />
</columns>
<rows>
<TablePane.Row
height="1*">
<CardPane width="100">
<wtkx:include src="versionInfo.wtkx" wtkx:id="versionInfo"/>
</CardPane>
</TablePane.Row>
</rows>
</TablePane>
</content>
</siu.autosync.version:AutoSyncVersion>
versionInfo.wktx
<TablePane
xmlns:wtkx="http://pivot.apache.org/wtkx"
xmlns="org.apache.pivot.wtk"
xmlns:content="org.apache.pivot.wtk.content">
<columns>
<TablePane.Column width="600" />
</columns>
<rows>
<TablePane.Row height="230">
<TextArea enabled="false"
editable="false" wtkx:id="info" />
</TablePane.Row>
<TablePane.Row height="50">
<Separator/>
</TablePane.Row>
<TablePane.Row height="70">
<BoxPane
styles="{horizontalAlignment:'center'}">
<PushButton wtkx:id="okButton"
buttonData="OK"/>
</BoxPane>
</TablePane.Row>
</rows>
</TablePane>
I have all the variables defined correctly in the classes, but I get this error:
java.lang.IllegalArgumentException: Can not set
web.ui.autosync.version.VersionInfo field
web.ui.autosync.version.AutoSyncVersion.versionInfo to
org.apache.pivot.wtk.TablePane
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown
Source)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at org.apache.pivot.wtkx.WTKXSerializer.bind(WTKXSerializer.java:1337)
at org.apache.pivot.wtkx.WTKXSerializer.bind(WTKXSerializer.java:1281)
at
org.apache.pivot.wtkx.WTKXSerializer.readObject(WTKXSerializer.java:481)
at
org.apache.pivot.wtkx.WTKXSerializer.readObject(WTKXSerializer.java:411)
at
org.apache.pivot.wtkx.WTKXSerializer.readObject(WTKXSerializer.java:366)
at web.ui.autosync.AutoSyncView.readObject(AutoSyncView.java:294)
at
web.ui.autosync.AutoSyncView$ViewVersionAction.perform(AutoSyncView.java:838)
at org.apache.pivot.wtk.Button.press(Button.java:367)
at org.apache.pivot.wtk.Menu$Item.press(Menu.java:214)
at org.apache.pivot.wtk.skin.MenuItemSkin.mouseUp(MenuItemSkin.java:142)
at
org.apache.pivot.wtk.Component$ComponentMouseButtonListenerList.mouseUp(Component.java:462)
at org.apache.pivot.wtk.Component.mouseUp(Component.java:2610)
at org.apache.pivot.wtk.Container.mouseUp(Container.java:742)
at org.apache.pivot.wtk.Container.mouseUp(Container.java:742)
at org.apache.pivot.wtk.Container.mouseUp(Container.java:742)
at org.apache.pivot.wtk.Container.mouseUp(Container.java:742)
at org.apache.pivot.wtk.Container.mouseUp(Container.java:742)
at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.processMouseEvent(ApplicationContext.java:874)
at java.awt.Component.processEvent(Unknown Source)
at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.processEvent(ApplicationContext.java:655)
at java.awt.Component.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)
Any help is greatly appreaciated!
Jason Dorsey | Engineering Intern