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 73013 - Invalid layout constants in generated code for MIDP1.0
Summary: Invalid layout constants in generated code for MIDP1.0
Status: CLOSED FIXED
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All Linux
: P1 blocker (vote)
Assignee: Martin Brehovsky
URL:
Keywords:
: 73193 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-24 23:26 UTC by plank
Modified: 2008-09-10 16:00 UTC (History)
2 users (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 plank 2006-02-24 23:26:47 UTC
Hi - I can no longer compile my application after upgrading from 5.0beta2 to
5.0. Actually, I just tested, and the same problem exists for new applications.

In the Midlet screen designer, you can specify a 'layout' property for ImageItem
objects. The choices are NONE, LEFT, RIGHT, CENTER, etc.

In previous Netbeans 5.0beta2, the generated code would contain the actual value
of the constant (eg. 0x301, 0x302).

After upgrading to Netbeans 5.0, all my constants automatically changed to
Item.LAYOUT_DEFAULT, Item.LAYOUT_CENTER etc etc.

Unfortunately, the Item class does not contain these constants, they are in the
ImageItem class - ( ImageItem.LAYOUT_CENTER, etc ).

Is there a quick fix I can make for this to save waiting for a fixed release (or
down-grading to 5.0beta2) ?

Love netbeans otherwise,
regards,
rob.
Comment 1 Lukas Hasik 2006-02-26 00:37:43 UTC
it seems that you are using MIDP 1.0 in your emulator platform.

reassigning to breh - there wasn't any change like this between RC2 and FCS, am
I right?
Comment 2 Lukas Hasik 2006-03-01 16:30:15 UTC
increasing priority to P1. Users cannot work with ImageItem in MIDP 1.0

There isn't any workaround for this issue. It generates code with
Item.LAYOUT_DEFAULT even for MIDP1.0
The code is uncompilable in MIDP1.0!

I thought that I could workaround it in post-init section but I cannot rid of
the Item.LAYOUT_DEFAULT in the guarded section
Comment 3 Lukas Hasik 2006-03-01 17:26:12 UTC
there is one _UGLY_ workaround for people that want to use ImageItem in Mobility
Pack in MIDP1.0

Copy to pre-init section the commands in guarded block of ImageItem and comment
out the commands in guarded block. Ca

E.g.
public ImageItem get_imageItem1() {
       if (imageItem1 == null) {
           // Insert pre-init code here
            imageItem1 = new ImageItem("imageItem1", get_image1(), 
ImageItem.LAYOUT_DEFAULT, null);
           /*
           <GUARDED>imageItem1 = new ImageItem("imageItem1", get_image1(),
Item.LAYOUT_DEFAULT, null); </GUARDED>
           */
           // Insert post-init code here
       }
       return imageItem1;
   } 
Comment 4 David Kaspar 2006-03-01 19:20:45 UTC
This bug is caused that a layout is declared on Item and ImageItem too they are
using the same descriptor and editor.
Solution is to make Image.layout property declared using another descriptor and
editor.
Editor must recognize the MIDP version to filter available options.
Comment 5 David Kaspar 2006-03-02 14:02:12 UTC
Fixed in main trunk. PropertyEditor was not changed because it does not affect
stored data format.

Lukasi, should I resolve this bug as FIXED? Or should I wait until the patch
will be commited into NB 5.5 branch too?
Comment 6 Lukas Hasik 2006-03-02 14:27:08 UTC
the process is:
1, fix in trunk, mark as FIXED, set Target Milestone to dev
2, test, write that it's verified in trunk
3, commit to branch and set TM=5.5

marking as fixed+TM for now
Comment 7 Lukas Hasik 2006-03-02 21:29:14 UTC
*** Issue 73193 has been marked as a duplicate of this issue. ***
Comment 8 Lukas Hasik 2006-03-14 09:31:04 UTC
verified with trunk build. There is used ImageItem.LAYOUT instead of Item.LAYOUT
Comment 9 Fabiola Rios 2006-04-19 13:32:48 UTC
Verified in branch 20060418
Comment 10 Ivan Sidorkin 2008-09-10 16:00:47 UTC
close old issues