Bug 99 - Automatic import statements
: Automatic import statements
Status: NEW
: eplugin
source
: 1
: PC Windows
: P5 enhancement
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-12-14 20:17 by
Modified: 2009-03-23 08:59 (History)


Attachments
Screen shots that show the quick fix in action (161.60 KB, application/zip)
2009-01-06 10:56, sinnema313@kenai.com
Details
screendump that show the code and errors (283.06 KB, image/tiff)
2009-03-18 08:45, meuter@kenai.com
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-12-14 20:17:47
Hi, 

please add the possibility to import the necessary import statements
automatically.

For example 

javafx.stage.Stage {
    title : "My first JavaFX program"
    scene: javafx.scene.Scene {
        width: 200
        height: 200
        content: [  Text {

            }
        ]
    }

It would be nice to have the possibility to right mouse click -> Source ->
Organize Imports like in standard Java code.

Best regards, Lars
------- Comment #1 From 2008-12-26 14:11:59 -------
+1
------- Comment #2 From 2009-01-06 10:56:04 -------
Created an attachment (id=26) [details]
Screen shots that show the quick fix in action

Not entirely the solution that was asked for, but I have a patch that
implements a "quick fix" that adds import statements for unknown classes. I
haven't had time to polish/fully test it yet, and I'm sure it can be improved
upon, but maybe you can use it to jump start your efforts?
------- Comment #3 From 2009-01-10 14:34:08 -------
Applied the Quick Fix patch. Will this work for you instead of the Organize
Imports feature?
------- Comment #4 From 2009-01-11 21:01:40 -------
Hi,

sorry that it took me so long to reply, I wasn't sure that you were addressing
me (I'm still not... ;-)).

The quick fix looks very good and is a valid workaround for my reported bug. 

Thank you, Lars
------- Comment #5 From 2009-03-17 20:24:11 -------
Hi,

I tried the quick fix solution on my mac installation and it does not work. The
button is disabled. Any ideas when the organize imports will be operational or
how I enable the quick fix? Thanks!
------- Comment #6 From 2009-03-18 08:13:13 -------
What Java FX code are you using? The Quick Fix is not available for every type
of error, so without some code it's hard to comment on this issue.
------- Comment #7 From 2009-03-18 08:45:47 -------
Created an attachment (id=45) [details]
screendump that show the code and errors

I simply follow the example on the previous screen shots and the quick fix is
disabled. I entered a separate bug for the error icons on the numbers on the
editor pane.

It also appears that the scripts are not automatically saved when one clicks on
the run button. Is this a known bug?
------- Comment #8 From 2009-03-18 14:39:32 -------
(In reply to comment #7)
> Created an attachment (id=45) [details] [details]
> screendump that show the code and errors
> 
> I simply follow the example on the previous screen shots and the quick fix is
> disabled. 

That is the expected behavior, since that error has nothing to do with missing
imports and thus cannot be resolved by adding import statements.


> It also appears that the scripts are not automatically saved when one clicks on
> the run button. Is this a known bug?

This is an Eclipse preference setting. See Window|Preferences, the first option
under the Run/Debug|Launching heading.
------- Comment #9 From 2009-03-18 20:04:54 -------
Sorry... How can this be 'expected behavior'? The first screen shot of the
quick fix in action posted by sinnema313 clearly shows the same error I have
with an enabled option for a quick fix. On my configuration it is disabled. In
my view this is unexpected behavior. For the sake of clarity on the issue I am
referring to the error 'cannot find symbol: class Scene, Font, etc...'. The
screen dump shows also other errors, which are ignored by the compiler. I
posted a separate bug for these error signs.

Thanks on the tip on the automatic save before run.
------- Comment #10 From 2009-03-18 20:15:30 -------
I applied the tip for the save before run on my mac configuration. No such luck
:( Shall I report a separate bug?
------- Comment #11 From 2009-03-20 08:19:43 -------
(In reply to comment #10)
> I applied the tip for the save before run on my mac configuration. No such luck
> :( Shall I report a separate bug?

Not on the JavaFX plug-in, as it has nothing to do with it AFAIK. This
functionality is part of standard Eclipse.
------- Comment #12 From 2009-03-20 08:24:09 -------
(In reply to comment #9)
> Sorry... How can this be 'expected behavior'? The first screen shot of the
> quick fix in action posted by sinnema313 clearly shows the same error I have
> with an enabled option for a quick fix.

My bad, I confused this with the errors on the width and height.


> On my configuration it is disabled.

I don't have a Mac, so I can't try this. On my GNU/Linux box it works. Can
someone from Sun or otherwise try this on a Mac?

Also what version of the JavaFX SDK are you using?
------- Comment #13 From 2009-03-23 08:59:15 -------
(In reply to comment #12)
> Also what version of the JavaFX SDK are you using?

I am using the latest SDK which comes with the Mac netbeans image.

Eclipse runs under java 1.5 while my java default is 1.6. This is the common
set up for 64-bit architectures. 

I am not quite sure if it is a platform problem. I'll make a clean install and
try again. It might be a configuration mismatch with my other plug ins.