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.

View | Details | Raw Unified | Return to bug 125320
Collapse All | Expand All

(-)apichanges.xml (+14 lines)
Lines 107-112 Link Here
107
    <changes>
107
    <changes>
108
108
109
109
110
        <change id="ElementOpenForCPInfoAndHandle">
111
            <api name="general"/>
112
            <summary>Adding ElementOpen.open(ClasspathInfo info, ElementHandle h)</summary>
113
            <version major="1" minor="15"/>
114
            <date day="21" month="1" year="2008"/>
115
            <author login="jlahoda"/>
116
            <compatibility addition="yes">
117
            </compatibility>
118
            <description>
119
                 Adding ElementOpen.open(ClasspathInfo info, ElementHandle h) method.
120
            </description>
121
            <issue number="00000"/>
122
        </change>
123
        
110
        <change id="ScanDialog">
124
        <change id="ScanDialog">
111
            <api name="general"/>
125
            <api name="general"/>
112
            <summary>Added support for notifying user about running background scan.</summary>
126
            <summary>Added support for notifying user about running background scan.</summary>
(-)nbproject/project.properties (-1 / +2 lines)
Lines 1-3 Link Here
1
javadoc.apichanges=${basedir}/apichanges.xml
1
javac.compilerargs=-Xlint -Xlint:-serial
2
javac.compilerargs=-Xlint -Xlint:-serial
2
javac.source=1.5
3
javac.source=1.5
3
spec.version.base=1.4.0
4
spec.version.base=1.5.0
(-)src/org/netbeans/api/java/source/ui/ElementOpen.java (-23 / +28 lines)
Lines 64-91 Link Here
64
    }
64
    }
65
    
65
    
66
    /**
66
    /**
67
     * Opens given {@link Element}.
67
     * Opens {@link Element} corresponding to the given {@link ElementHandle}.
68
     * 
68
     * 
69
     * @param cpInfo ClasspathInfo which should be used for the search
69
     * @param cpInfo ClasspathInfo which should be used for the search
70
     * @param el    declaration to open
70
     * @param el     declaration to open
71
     * @return true if and only if the declaration was correctly opened,
71
     * @return true  if and only if the declaration was correctly opened,
72
     *                false otherwise
72
     *                false otherwise
73
     * @since 1.5
73
     */
74
     */
74
    public static boolean open(final ClasspathInfo cpInfo, final Element el) {
75
    public static boolean open(final ClasspathInfo cpInfo, final ElementHandle<? extends Element> el) {
75
	Object[] openInfo = getOpenInfo (cpInfo, el);
76
        FileObject fo = SourceUtils.getFile(el, cpInfo);
76
	if (openInfo != null) {
77
        Object[] openInfo = fo != null ? getOpenInfo(fo, el) : null;
77
	    assert openInfo[0] instanceof FileObject;
78
        if (openInfo != null) {
78
	    assert openInfo[1] instanceof Integer;
79
            assert openInfo[0] instanceof FileObject;
79
	    return doOpen((FileObject)openInfo[0],(Integer)openInfo[1]);
80
            assert openInfo[1] instanceof Integer;
80
	}
81
            return doOpen((FileObject) openInfo[0], (Integer) openInfo[1]);
81
        
82
        }
83
82
        BinaryElementOpen beo = Lookup.getDefault().lookup(BinaryElementOpen.class);
84
        BinaryElementOpen beo = Lookup.getDefault().lookup(BinaryElementOpen.class);
83
        
85
84
        if (beo != null) {
86
        if (beo != null) {
85
            return beo.open(cpInfo, ElementHandle.create(el));
87
            return beo.open(cpInfo, el);
86
        } else {
88
        } else {
87
            return false;
89
            return false;
88
        }
90
        }        
91
    }
92
    
93
    /**
94
     * Opens given {@link Element}.
95
     * 
96
     * @param cpInfo ClasspathInfo which should be used for the search
97
     * @param el    declaration to open
98
     * @return true if and only if the declaration was correctly opened,
99
     *                false otherwise
100
     */
101
    public static boolean open(final ClasspathInfo cpInfo, final Element el) {
102
        return open(cpInfo, ElementHandle.create(el));
89
    }
103
    }
90
    
104
    
91
    /**
105
    /**
Lines 120-134 Link Here
120
    
134
    
121
    // Private methods ---------------------------------------------------------
135
    // Private methods ---------------------------------------------------------
122
        
136
        
123
    private static Object[] getOpenInfo (final ClasspathInfo cpInfo, final Element el) {
124
        FileObject fo = SourceUtils.getFile(el, cpInfo);
125
        if (fo != null) {
126
            return getOpenInfo(fo, ElementHandle.create(el));
127
        } else {
128
            return null;
129
        }
130
    }
131
    
132
    private static Object[] getOpenInfo(final FileObject fo, final ElementHandle<? extends Element> handle) {
137
    private static Object[] getOpenInfo(final FileObject fo, final ElementHandle<? extends Element> handle) {
133
        assert fo != null;
138
        assert fo != null;
134
        
139
        

Return to bug 125320