This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99826 - AWT BorderLayout.PAGE_START not compatable with CDC
Summary: AWT BorderLayout.PAGE_START not compatable with CDC
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks: 99508
  Show dependency tree
 
Reported: 2007-04-03 14:47 UTC by luky
Modified: 2010-08-20 12:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description luky 2007-04-03 14:47:50 UTC
AWT Form editor generate code which is not compatible with CDC AWT 
specification - CDC specs doesn't know anything about BorderLayout.PAGE_START
Comment 1 Tomas Pavek 2007-04-03 15:00:56 UTC
We could adjust BorderLayout support to use the "absolute" constraints for AWT 
components, and the "relative" for Swing components. That would fix the problem.
Comment 2 Lukas Hasik 2007-04-03 15:32:03 UTC
is there a more generic way how to specify the generated code?

I assume that there will be other areas when the J2SE form style will not fit
into  J2ME (CDC/PP etc.) style :(
Comment 3 Lukas Hasik 2007-04-26 13:49:23 UTC
I'm increasing the priority. It's important issue for Mobility. The generated
code doesn't work and there is no way how to resolve it.
Comment 4 Lukas Hasik 2007-04-26 15:21:24 UTC
testing project with source code
http://www.netbeans.org/nonav/issues/showattachment.cgi/41739/CdcApplication2.zip

detailed steps:

-create new Mobility > CDC Application on platform Nokia S80 CDC PP SDK
-let the Create Main class selected when creating the project, press finish
-new project is created, form opened, the layout otf the form is BorderLayout
-add label from the palette to top(important) of the empty form.
-go to source
->uncompilable code 
        add(label1, java.awt.BorderLayout.PAGE_START);
Comment 5 Tomas Pavek 2007-04-26 16:36:05 UTC
Fixed.

/cvs/form/src/org/netbeans/modules/form/layoutsupport/delegates/BorderLayoutSupport.java
new revision: 1.10; previous revision: 1.9

Diff:
http://form.netbeans.org/source/browse/form/src/org/netbeans/modules/form/layoutsupport/delegates/BorderLayoutSupport.java?r1=1.9&r2=1.10
Comment 6 Tomas Pavek 2007-04-27 08:27:01 UTC
Integrated to release60-m9 branch.
Comment 7 Lukas Hasik 2007-07-27 09:56:13 UTC
unfortunately, this issue still happens with projects on CDC Toolkit platform which uses AGUI optional package. It
provides Swing components for CDC/PP.

Reproduce:
1, add CDC TK as Java platform to IDE - http://java.sun.com/products/cdctoolkit/download-1_0.html
2, create new project - Mobility > CDC Application. Use the CDC TK as platform. Let it create main class.
3, change the Layout of the Main class to Border layout
4, place a component to NORTH of the layout
5, go to source or compile -> Personal Profile doesn't know java.awt.BorderLayout.PAGE_START
Comment 8 luky 2007-07-27 10:31:24 UTC
Yep, I can see it. Previously it was problem with AWT platform though. But it uses still java.awt.BorderLayout which 
for CDC doesn't support relative positioning.
Comment 9 Tomas Pavek 2007-07-27 11:00:44 UTC
Yes, we could make a distiction for AWT-based components where the component orientation was not that important, but 
for Swing we need to use the relative constants. Now it's problem of AGUI in the first place - it claims it provides 
Swing components but it's obviously missing some features. Unfortunately I see no easy way how to distinguish AGUI from 
Swing and I don't want to do some extensive hacks for this, it's not sustainable in longer time. The GUI builder is for 
Swing in the first place. Please reevaluate the importance of this issue.
Comment 10 luky 2007-07-27 11:04:49 UTC
My 2 cents

1) AGUI is dead horse
2) Default layout (FreeForm) is working fine
3) You can workaround it by selecting position constant in properties dialog
Comment 11 Lukas Hasik 2007-07-27 11:49:45 UTC
ok, I agree with decreasing the priority to P3. It works for CDC/PP but not for AGUI optional package. The AGUI is not
supported by any phone yet (I'm not counting the Savaje's prototype). 

We will need a solution for CDC in long term. IMO, there might be other areas that are influenced by a "small"
difference between CDC/PP x J2SE. 

Anyway, where exactly I can set it to not generate the PAGE_START but the NORTH instead?

Comment 12 Tomas Pavek 2007-07-27 13:00:27 UTC
The layout constraint can be changed in property sheet, there's Direction property in Layout section.
Comment 13 Tomas Pavek 2010-08-20 12:48:03 UTC
I guess we can already close this as won't fix, right?