I previously posted this message as Support Requests-1881150, but maybe it was not the right channel to use ?
I have a styling issue. I get some message like
Mon Jan 28 13:35:58 CET 2008 TRACE: Setting up XValidationFactory
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:XuiLabels.properties
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:default/includes/posinput.xml
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setBorder on the class net.xoetrope.swing.XPassword
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPassword
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:default/includes/journal.xml
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Actually I'm looking for 3.2rc2b sources to help myself on this issue. Could you please give me a link (I'm lost in the branch). Should I use http://xui.svn.sourceforge.net/viewvc/xui/xui/trunk/src/net/xoetrope/swing/ ? (we only use - renamed with version name - XuiOptional-v3.2rc2b.jar and XuiCoreSwing-v3.2rc2b.jar)
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I wasn't monitoring those forums - we don't offer support via the support forums (they come with the project setup on SF by default), but I'll take a look.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If that factory isn't there then the XuiBuilder class will attempt to use reflection to set any of those properties, including styles, that are not set via the XAttributedComponent interface.
My guess would be that the XStyleFactory is not set, but I would need to see more of the source before I could fully diagnose the problem. I've tried some test applications here and I don't see those warnings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In all likelihood the style is being set as described earlier. There are a variety of component types and models supported by XUI and this is one downside of that variety - I could suppress the warning for the styles, but the warning may be valid for some components.
Is it causing a problem or is it just an annoyance?
-Luan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the source pointer. I will have a look.
This is causing a problem (only?) in a XTable. The styles are not applied. They are
jtable.setBorderStyle("journalBorder");
jtable.setHeaderStyle("journalHeader");
jtable.setStyle("journalData");
jtable.setSelectedStyle("journalSelected");
and
// set the table as selectable
jtable.setInteractiveTable(true);
jtable.setFocusable(false);
jtable.setDragEnabled(false);
jtable.setColumnSelectionAllowed(false);
jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// set the styles
jtable.setBorderStyle("journalBorder");
jtable.setHeaderStyle("journalHeader");
jtable.setStyle("journalData");
jtable.setSelectedStyle("journalSelected");
// initialize the journal table header
XModel jmodel = createModel();
if (jmodel != null) {
this.appendEmpty(jmodel);
jtable.setModel(jmodel);
for (int i = 0; i < width.length; i++) {
jtable.setColWidth(i, width[i]);
}
}
jtable.setSelectedRow(0);
}
I will let you know soon about my investigations...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmm.... i don't think that is the cause of the problem as the section of the log you reported referred to the XEdit component not the XTable. (or perhaps you just pasted the wrong part of the log???)
Is it comitted to the OfBiz repository? One of the guys here has that setup and may be able to investigate if you give some further instructions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Trying to debug this morning, I'm still not sure why but we got a problem with error dialog box. To reproduce : click on the Pay button just after login. I'm using the debug vesion of the jars and I checked out the XUI32 sources. When debuggin, It seems to flow correctly but the error dialog box does not appear and the java instance is still running at max CPU (50% on my Pentium HT on XPsp2). Note that I'm able to pause the debugged instance in Eclipse. I will continue to investigate but I'm not sure how to do now...
Thanks for your help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think that the problem with an error dialog is related to XUI.
In "org.ofbiz.pos.screen.PosDialog" class you have:
protected void configure() // invoked from the constructor
{
[...]
dialog.addComponentListner(new ComponentListneer() {
public void componentResized(ComponentEvent e) {
this.reset(); // SO INVOKED WHENEVER THE DIALOG CHANGES ITS SIZE
}
[...]
}
}
Invocation of the "reset()" method above eventually results in calling the "pack()" method on the PosDialog instance
( thisPosDialog.checkSize() -> this.pack() ).
The "pack()" method is as follows:
private void pack()
{
// CHANGES THE DIALOG'S SIZE SO COMPONENT LISTENERS GET CALLED WHICH RESULTS
// IN RECURSIVE (AND INFINITE) INVOCATION OF THE "pack()" METHOD.
dialog.pack();
It seems that the problem comes only from XTable.setBorderStyle which used a content var prior to 3.1 version. This has been commented out. Let me know if you want some help on this issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've logged a bug on this (http://sourceforge.net/tracker/index.php?func=detail&aid=1883588&group_id=76693&atid=547957)
In 2.0.7 the XTable component was a home grown component and XTable2 was a version of Swing's JTable. In XUI 3.0 this changed and XTable was derived from the JTable, so there are significant differences between the two versions.
It may not be so easy to get the L&F of the two versions to match.
Could you send a screenshot of what you want (or the 2.0.7 version) and what you are getting? We try to get it as close as possible.
Luan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW the XTable in 2.0.7 was a scroll pane, whereas the 3.0 version needs to be nested within a scroll pane component if you want scrolling.
I've modified the methods as follows
/**
* Set the style of the border
* @param styleName the style name
*/
public void setBorderStyle( String styleName )
{
XStyle style = currentProject.getStyleManager().getStyle( styleName );
Color borderColor = style.getStyleAsColor( XStyle.COLOR_FORE );
setBorder( new LineBorder( borderColor ));
}
Not 100% sure if that will do exactly what you want. Can you build from source or do you want me to generate a build for you?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After having struggled a bit with imports missing (I have already added info.clearthought.layout, Junit, Groovy and plugin.jar), I still miss (at least)
org.objectweb.asm
antlr.*
com.thoughtworks.xstream.XStream
com.jgoodies.looks.*
com.kitfox.svg.*
and I'm a bit tired of it. In the meantime could you please send me an updated jar with your changes ?
BTW do you use Netbeans or Eclipse to buld (I suppose Netbeans from build.xml file, I use Eclipse) ?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
aren't used by XUI, so I don't kow how you get the dependancies. We use NetBeans for the build of the XUI jars, but there are Eclipse projects in the SVN repository for Kalideoscope and XuiPro, both of which include all the XUI source. There are also build instructions (could be better) on the wiki.
Hi,
I previously posted this message as Support Requests-1881150, but maybe it was not the right channel to use ?
I have a styling issue. I get some message like
Mon Jan 28 13:35:58 CET 2008 TRACE: Setting up XValidationFactory
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:XuiLabels.properties
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:default/includes/posinput.xml
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setBorder on the class net.xoetrope.swing.XPassword
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPassword
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 TRACE: Opening file:default/includes/journal.xml
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XEdit
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Mon Jan 28 13:35:58 CET 2008 WARNING: Could not set the property: setStyle on the class net.xoetrope.swing.XPanel
Actually I'm looking for 3.2rc2b sources to help myself on this issue. Could you please give me a link (I'm lost in the branch). Should I use http://xui.svn.sourceforge.net/viewvc/xui/xui/trunk/src/net/xoetrope/swing/ ? (we only use - renamed with version name - XuiOptional-v3.2rc2b.jar and XuiCoreSwing-v3.2rc2b.jar)
Thanks
Sorry, I wasn't monitoring those forums - we don't offer support via the support forums (they come with the project setup on SF by default), but I'll take a look.
The 3.2 source is at
http://xui.svn.sourceforge.net/viewvc/xui/xui/branches/xui32/src/net/xoetrope/swing/
but the warnings puzzle me a bit as the styles are normally set by the XStyleFactory
(see http://xui.svn.sourceforge.net/viewvc/xui/xui/branches/xui32/src/net/xoetrope/xui/style/XStyleFactory.java?view=log\)
If that factory isn't there then the XuiBuilder class will attempt to use reflection to set any of those properties, including styles, that are not set via the XAttributedComponent interface.
My guess would be that the XStyleFactory is not set, but I would need to see more of the source before I could fully diagnose the problem. I've tried some test applications here and I don't see those warnings.
Hold that - I can see the warning at runtime.
Jacques,
In all likelihood the style is being set as described earlier. There are a variety of component types and models supported by XUI and this is one downside of that variety - I could suppress the warning for the styles, but the warning may be valid for some components.
Is it causing a problem or is it just an annoyance?
-Luan
Luan,
Thanks for the source pointer. I will have a look.
This is causing a problem (only?) in a XTable. The styles are not applied. They are
jtable.setBorderStyle("journalBorder");
jtable.setHeaderStyle("journalHeader");
jtable.setStyle("journalData");
jtable.setSelectedStyle("journalSelected");
and
<!-- embedded journal table styles (required but can be customized) -->
<style name="journalBorder">
<font_face value="verdana"/>
<font_size value="0"/>
<font_weight value="0"/>
<font_italic value="0"/>
<color_back value="ffffff"/>
<color_fore value="ffffff"/>
</style>
<style name="journalData">
<font_face value="verdana"/>
<font_size value="16"/>
<font_weight value="0"/>
<font_italic value="0"/>
<color_back value="cccccc"/>
<color_fore value="000000"/>
</style>
<style name="journalHeader">
<font_face value="verdana"/>
<font_size value="18"/>
<font_weight value="1"/>
<font_italic value="0"/>
<color_back value="cccccc"/>
<color_fore value="000000"/>
</style>
<style name="journalSelected">
<font_face value="verdana"/>
<font_size value="16"/>
<font_weight value="1"/>
<font_italic value="0"/>
<color_back value="678FB9"/>
<color_fore value="000000"/>
</style>
They were working with 2.07. We have changed some code around but I don't think these changes have an impact on styles.
Mabye helpful, the complete constructor
public Journal(PosScreen page) {
this.jpanel = (XScrollPane) page.findComponent("journal_panel");
this.jpanel.setVisible(false);
this.jtable = (XTable) page.findComponent("jtable");
// set the table as selectable
jtable.setInteractiveTable(true);
jtable.setFocusable(false);
jtable.setDragEnabled(false);
jtable.setColumnSelectionAllowed(false);
jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// set the styles
jtable.setBorderStyle("journalBorder");
jtable.setHeaderStyle("journalHeader");
jtable.setStyle("journalData");
jtable.setSelectedStyle("journalSelected");
// initialize the journal table header
XModel jmodel = createModel();
if (jmodel != null) {
this.appendEmpty(jmodel);
jtable.setModel(jmodel);
for (int i = 0; i < width.length; i++) {
jtable.setColWidth(i, width[i]);
}
}
jtable.setSelectedRow(0);
}
I will let you know soon about my investigations...
Hmmm.... i don't think that is the cause of the problem as the section of the log you reported referred to the XEdit component not the XTable. (or perhaps you just pasted the wrong part of the log???)
Is it comitted to the OfBiz repository? One of the guys here has that setup and may be able to investigate if you give some further instructions.
Thanks Luan,
I will have a look tomorrow morning and if I can't figure it out I will then give you more clues.
Hi Luan,
Trying to debug this morning, I'm still not sure why but we got a problem with error dialog box. To reproduce : click on the Pay button just after login. I'm using the debug vesion of the jars and I checked out the XUI32 sources. When debuggin, It seems to flow correctly but the error dialog box does not appear and the java instance is still running at max CPU (50% on my Pentium HT on XPsp2). Note that I'm able to pause the debugged instance in Eclipse. I will continue to investigate but I'm not sure how to do now...
Thanks for your help
Forgot to say, that, yes, it's commited in OFBiz trunk
The problem is in the AWT thread. I can suspend and resume but that's all.
Daemon Thread [AWT-Windows] (Suspended)
WToolkit.eventLoop() line: not available [native method]
WToolkit.run() line: 269
Thread.run() line: 595
Daemon Thread [AWT-Windows] (Running)
Is this part of the same styling issue?
No, but it's related to 3.2rc2b I guess
Hi,
I don't think that the problem with an error dialog is related to XUI.
In "org.ofbiz.pos.screen.PosDialog" class you have:
protected void configure() // invoked from the constructor
{
[...]
dialog.addComponentListner(new ComponentListneer() {
public void componentResized(ComponentEvent e) {
this.reset(); // SO INVOKED WHENEVER THE DIALOG CHANGES ITS SIZE
}
[...]
}
}
Invocation of the "reset()" method above eventually results in calling the "pack()" method on the PosDialog instance
( thisPosDialog.checkSize() -> this.pack() ).
The "pack()" method is as follows:
private void pack()
{
// CHANGES THE DIALOG'S SIZE SO COMPONENT LISTENERS GET CALLED WHICH RESULTS
// IN RECURSIVE (AND INFINITE) INVOCATION OF THE "pack()" METHOD.
dialog.pack();
pageSize = page.getSize();
if (pageSize.getHeight() > 0 || pageSize.getWidth() > 0) {
// HERE THE DIALOG'S SIZE IS CHANGED AGAIN
dialog.setSize(page.getSize());
} else {
Container contentPane = dialog.getContentPane();
Point size = this.getMaxCoordinates(contentPane);
// ... OR HERE
this.setSize(size.x + 2 * padding + 2, size.y + 2 * padding + 4);
}
}
Removing the "dialog.pack()" call seems to solve the problem.
I will try to investigate the XTable styling issue tomorrow.
Thanks,
Jakub
Thans a bunch Jakub,
This was working before (ie using XUI 2.07) but obviously you are right and it fixes our issue.
Jakub,
FYI, I will try to have a look at the XTable styling issue this afternoon (if you don't beat me on it ;o)
Hi Jakub,
It seems that the problem comes only from XTable.setBorderStyle which used a content var prior to 3.1 version. This has been commented out. Let me know if you want some help on this issue.
I've logged a bug on this (http://sourceforge.net/tracker/index.php?func=detail&aid=1883588&group_id=76693&atid=547957)
In 2.0.7 the XTable component was a home grown component and XTable2 was a version of Swing's JTable. In XUI 3.0 this changed and XTable was derived from the JTable, so there are significant differences between the two versions.
It may not be so easy to get the L&F of the two versions to match.
Could you send a screenshot of what you want (or the 2.0.7 version) and what you are getting? We try to get it as close as possible.
Luan
BTW the XTable in 2.0.7 was a scroll pane, whereas the 3.0 version needs to be nested within a scroll pane component if you want scrolling.
I've modified the methods as follows
/**
* Set the style of the border
* @param styleName the style name
*/
public void setBorderStyle( String styleName )
{
XStyle style = currentProject.getStyleManager().getStyle( styleName );
Color borderColor = style.getStyleAsColor( XStyle.COLOR_FORE );
setBorder( new LineBorder( borderColor ));
}
Not 100% sure if that will do exactly what you want. Can you build from source or do you want me to generate a build for you?
Thank you Luan, I will try soon (I must go out now)
Luan,
After having struggled a bit with imports missing (I have already added info.clearthought.layout, Junit, Groovy and plugin.jar), I still miss (at least)
org.objectweb.asm
antlr.*
com.thoughtworks.xstream.XStream
com.jgoodies.looks.*
com.kitfox.svg.*
and I'm a bit tired of it. In the meantime could you please send me an updated jar with your changes ?
BTW do you use Netbeans or Eclipse to buld (I suppose Netbeans from build.xml file, I use Eclipse) ?
Thanks
I'll post a build shortly.
All of the libs that are needed (other than the JDKs) are in the libs folder. Some of those you mention
org.objectweb.asm
antlr.*
com.thoughtworks.xstream.XStream
aren't used by XUI, so I don't kow how you get the dependancies. We use NetBeans for the build of the XUI jars, but there are Eclipse projects in the SVN repository for Kalideoscope and XuiPro, both of which include all the XUI source. There are also build instructions (could be better) on the wiki.
http://www.xoetrope.com/wiki/BuildingXUI
http://www.xoetrope.com/wiki/EclipseFAQ
Thanks Luan,
I should have read http://www.xoetrope.com/wiki/EclipseFAQ before, shooted in the foot, lesson learned ;o)
I've just uploaded a debug and non debug build to:
http://xui.sourceforge.net/downloads/nightly/20080201/
Let me know if it solves the style issue.
I just tried both (debug and std) on http://xui.sourceforge.net/downloads/nightly/20080201/ but none solve this issue. I will continue to debug now that I have all the clues.
Thanks Luan