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 185537 - [69cat] Autofix for Import Does Not Include Options for Project Dependencies
Summary: [69cat] Autofix for Import Does Not Include Options for Project Dependencies
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 16:51 UTC by rationalpi
Modified: 2010-06-16 10:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Zip Containing Two Zips of NetBeans Projects (12.83 KB, application/zip)
2010-05-05 17:22 UTC, rationalpi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rationalpi 2010-05-05 16:51:26 UTC
[ JDK VERSION : 1.6.* ]

The quick fix for "cannot find symbol" does not include an option to import a
class from a project that is included as a dependency.

If you create two JavaFX projects and make one project dependent on another and
then use a class from the second project in the first project  without adding
the import statement, the quick fix for the missing class does not include an
option to add the class from the first project.

Steps to reproduce:
1. Create a TempJfx2 project.
2. Create a tempjfx2 package in the TempJfx2 project.
3. Create a SpecialCircle.fx class in the TempJfx2 project with the following
content:
package tempjfx2;
import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.shape.Circle;
import javafx.scene.paint.Color;

public class SpecialCircle extends CustomNode {
    public override function create(): Node {
        return Circle {
            radius: 100
            fill: Color.RED
        }
    }
}

4. Create a TempJfx1 project
5. Create a tempjfx1 package in the TempJfx1 project.
6. Right-click on the Libraries node for TempJfx1 in the Projects tab and add
7. TempJfx2 as a dependency using the Add Project option
8. Create a Main.fx class in the TempJfx1 project with the following content:
package tempjfx1;

import javafx.stage.Stage;
import javafx.scene.Scene;

Stage {
    title: "TempJfx1"
    scene: Scene {
        width: 300
        height: 300
        content: [
            SpecialCircle {
                translateX: 150
                translateY: 150
        }
        ]
    }
}

9. Click your mouse on the light-bulb that is next to the SpecialCircle line.
It gives you options for "Create class SpecialCircle in package tempjfx1" and
Create class SpecialCircle in file tempjfx1.Main". It should also give you an
option to import SpecialCircle since it's on the classpath as part of the
TempJfx2 project.
Comment 1 rationalpi 2010-05-05 17:22:55 UTC
Created attachment 98510 [details]
Zip Containing Two Zips of NetBeans Projects
Comment 2 J Bachorik 2010-05-07 11:41:02 UTC
This should have been fixed recently. I am not able to reproduce it on the trunk build (201005050200)
Comment 3 Alexandr Scherbatiy 2010-06-16 10:58:12 UTC
verified in NetBeans IDE Dev (Build 201006160001)