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 242577
Collapse All | Expand All

(-)a/code.analysis/src/org/netbeans/modules/analysis/ui/AnalysisResultTopComponent.java (-15 / +52 lines)
Lines 48-53 Link Here
48
import java.awt.Insets;
48
import java.awt.Insets;
49
import java.beans.PropertyChangeEvent;
49
import java.beans.PropertyChangeEvent;
50
import java.beans.PropertyChangeListener;
50
import java.beans.PropertyChangeListener;
51
import java.net.MalformedURLException;
52
import java.net.URL;
51
import java.util.Collections;
53
import java.util.Collections;
52
import java.util.List;
54
import java.util.List;
53
import java.util.logging.Logger;
55
import java.util.logging.Logger;
Lines 76-82 Link Here
76
import org.openide.explorer.view.BeanTreeView;
78
import org.openide.explorer.view.BeanTreeView;
77
import org.openide.filesystems.FileObject;
79
import org.openide.filesystems.FileObject;
78
import org.openide.filesystems.URLMapper;
80
import org.openide.filesystems.URLMapper;
81
import org.openide.loaders.DataObject;
82
import org.openide.loaders.DataObjectNotFoundException;
79
import org.openide.nodes.Node;
83
import org.openide.nodes.Node;
84
import org.openide.text.Line;
85
import org.openide.text.NbDocument;
86
import org.openide.util.Exceptions;
80
import org.openide.util.Lookup;
87
import org.openide.util.Lookup;
81
import org.openide.util.NbBundle.Messages;
88
import org.openide.util.NbBundle.Messages;
82
import org.openide.util.Utilities;
89
import org.openide.util.Utilities;
Lines 165-189 Link Here
165
        descriptionPanel.addHyperlinkListener(new HyperlinkListener() {
172
        descriptionPanel.addHyperlinkListener(new HyperlinkListener() {
166
            @Override public void hyperlinkUpdate(HyperlinkEvent e) {
173
            @Override public void hyperlinkUpdate(HyperlinkEvent e) {
167
                if (e.getEventType() == EventType.ACTIVATED && e.getURL() != null) {
174
                if (e.getEventType() == EventType.ACTIVATED && e.getURL() != null) {
168
                    if ("file".equals(e.getURL().getProtocol())) {
175
                    //if ("file".equals(e.getURL().getProtocol())||"rfs".equals(e.getURL().getProtocol())) {
169
                        FileObject file = URLMapper.findFileObject(e.getURL());
176
                        if (e.getURL().getRef() == null) {
170
                        
177
                            FileObject file = URLMapper.findFileObject(e.getURL());
171
                        if (file != null) {
172
                            EditCookie ec = file.getLookup().lookup(EditCookie.class);
173
                            
178
                            
174
                            if (ec != null) {
179
                            if (file != null) {
175
                                ec.edit();
180
                                EditCookie ec = file.getLookup().lookup(EditCookie.class);
176
                                return ;
181
182
                                if (ec != null) {
183
                                    ec.edit();
184
                                    return ;
185
                                }
186
187
                                OpenCookie oc = file.getLookup().lookup(OpenCookie.class);
188
189
                                if (oc != null) {
190
                                    oc.open();
191
                                    return ;
192
                                }
177
                            }
193
                            }
178
                            
194
                        } else {
179
                            OpenCookie oc = file.getLookup().lookup(OpenCookie.class);
195
                            try {
180
                            
196
                                int line;
181
                            if (oc != null) {
197
                                if (e.getURL().getRef().startsWith("line")) {
182
                                oc.open();
198
                                    line = Integer.parseInt(e.getURL().getRef().substring(4));
183
                                return ;
199
                                } else {
200
                                    line = Integer.parseInt(e.getURL().getRef());
201
                                }
202
                                String s = e.getURL().toExternalForm();
203
                                URL url;
204
                                if (s.indexOf("#")>0) {
205
                                    s = s.substring(0, s.indexOf("#"));
206
                                    url = new URL(s);
207
                                } else {
208
                                    url=e.getURL();
209
                                }
210
                                FileObject file = URLMapper.findFileObject(url);
211
                                if (file != null) {
212
                                    DataObject dobj = DataObject.find(file);
213
                                    if (dobj != null) {
214
                                        NbDocument.openDocument(dobj, line-1, 0, Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);
215
                                        return;
216
                                    }
217
                                }
218
                            } catch (NumberFormatException ex) {
219
                            } catch (MalformedURLException ex) {
220
                            } catch (DataObjectNotFoundException ex) {
184
                            }
221
                            }
185
                        }
222
                        }
186
                    }
223
                    //}
187
                    URLDisplayer.getDefault().showURL(e.getURL());
224
                    URLDisplayer.getDefault().showURL(e.getURL());
188
                }
225
                }
189
            }
226
            }

Return to bug 242577