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

(-)a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/Bundle.properties (+1 lines)
Lines 105-107 Link Here
105
AD_DownContent=N/A
105
AD_DownContent=N/A
106
106
107
TXT_BrokenFile=The specified file does not exist.
107
TXT_BrokenFile=The specified file does not exist.
108
J2SEVolumeCustomizer.addURLButton.text=Add UR&L...
(-)a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SEVolumeCustomizer.form (-5 / +21 lines)
Lines 1-17 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AccessibilityProperties>
4
  <AccessibilityProperties>
5
    <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
5
    <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
6
      <ResourceString bundle="org/netbeans/modules/java/j2seplatform/libraries/Bundle.properties" key="AD_J2SEVolumeCustomizer" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
6
      <ResourceString bundle="org/netbeans/modules/java/j2seplatform/libraries/Bundle.properties" key="AD_J2SEVolumeCustomizer" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
7
    </Property>
7
    </Property>
8
  </AccessibilityProperties>
8
  </AccessibilityProperties>
9
  <AuxValues>
9
  <AuxValues>
10
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
10
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
11
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
11
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
12
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
13
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
13
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
14
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
14
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
15
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
15
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
16
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
16
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
17
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
17
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
18
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
Lines 70-76 Link Here
70
      </AuxValues>
71
      </AuxValues>
71
      <Constraints>
72
      <Constraints>
72
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
73
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
73
          <GridBagConstraints gridX="1" gridY="1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="6" insetsRight="6" anchor="18" weightX="0.0" weightY="0.0"/>
74
          <GridBagConstraints gridX="1" gridY="1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="18" weightX="0.0" weightY="0.0"/>
75
        </Constraint>
76
      </Constraints>
77
    </Component>
78
    <Component class="javax.swing.JButton" name="addURLButton">
79
      <Properties>
80
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
81
          <ResourceString bundle="org/netbeans/modules/java/j2seplatform/libraries/Bundle.properties" key="J2SEVolumeCustomizer.addURLButton.text" replaceFormat="NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
82
        </Property>
83
      </Properties>
84
      <Events>
85
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addURLButtonActionPerformed"/>
86
      </Events>
87
      <Constraints>
88
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
89
          <GridBagConstraints gridX="-1" gridY="-1" gridWidth="0" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="6" insetsBottom="6" insetsRight="6" anchor="10" weightX="0.0" weightY="0.0"/>
74
        </Constraint>
90
        </Constraint>
75
      </Constraints>
91
      </Constraints>
76
    </Component>
92
    </Component>
(-)a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SEVolumeCustomizer.java (-46 / +49 lines)
Lines 57-63 Link Here
57
import java.util.Collections;
57
import java.util.Collections;
58
import javax.swing.AbstractAction;
58
import javax.swing.AbstractAction;
59
import javax.swing.DefaultListCellRenderer;
59
import javax.swing.DefaultListCellRenderer;
60
import javax.swing.JButton;
61
import javax.swing.JComponent;
60
import javax.swing.JComponent;
62
import javax.swing.JFileChooser;
61
import javax.swing.JFileChooser;
63
import javax.swing.JList;
62
import javax.swing.JList;
Lines 77-82 Link Here
77
import org.netbeans.spi.project.libraries.LibraryImplementation;
76
import org.netbeans.spi.project.libraries.LibraryImplementation;
78
import org.netbeans.spi.project.libraries.LibraryStorageArea;
77
import org.netbeans.spi.project.libraries.LibraryStorageArea;
79
import org.netbeans.spi.project.libraries.support.LibrariesSupport;
78
import org.netbeans.spi.project.libraries.support.LibrariesSupport;
79
import org.openide.DialogDescriptor;
80
80
81
/**
81
/**
82
 *
82
 *
Lines 90-96 Link Here
90
    private VolumeContentModel model;
90
    private VolumeContentModel model;
91
    private Boolean allowRelativePaths = null;
91
    private Boolean allowRelativePaths = null;
92
92
93
    /** Creates new form J2SEVolumeCustomizer */
94
    J2SEVolumeCustomizer (String volumeType) {
93
    J2SEVolumeCustomizer (String volumeType) {
95
        this.volumeType = volumeType;
94
        this.volumeType = volumeType;
96
        initComponents();
95
        initComponents();
Lines 107-115 Link Here
107
    public void setEnabled(boolean enabled) {
106
    public void setEnabled(boolean enabled) {
108
        super.setEnabled(enabled);
107
        super.setEnabled(enabled);
109
        this.addButton.setEnabled(enabled);
108
        this.addButton.setEnabled(enabled);
110
        if (this.addURLButton != null) {
109
        addURLButton.setEnabled(volumeType.equals(J2SELibraryTypeProvider.VOLUME_TYPE_JAVADOC));
111
            this.addURLButton.setEnabled(enabled);
112
        }
113
        int[] indices = content.getSelectedIndices();
110
        int[] indices = content.getSelectedIndices();
114
        this.removeButton.setEnabled(enabled && indices.length > 0);
111
        this.removeButton.setEnabled(enabled && indices.length > 0);
115
        this.downButton.setEnabled(enabled && indices.length > 0 && indices[indices.length-1]<model.getSize()-1);
112
        this.downButton.setEnabled(enabled && indices.length > 0 && indices[indices.length-1]<model.getSize()-1);
Lines 188-194 Link Here
188
     * WARNING: Do NOT modify this code. The content of this method is
185
     * WARNING: Do NOT modify this code. The content of this method is
189
     * always regenerated by the Form Editor.
186
     * always regenerated by the Form Editor.
190
     */
187
     */
191
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
188
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
192
    private void initComponents() {
189
    private void initComponents() {
193
        java.awt.GridBagConstraints gridBagConstraints;
190
        java.awt.GridBagConstraints gridBagConstraints;
194
191
Lines 196-210 Link Here
196
        jScrollPane1 = new javax.swing.JScrollPane();
193
        jScrollPane1 = new javax.swing.JScrollPane();
197
        content = new javax.swing.JList();
194
        content = new javax.swing.JList();
198
        addButton = new javax.swing.JButton();
195
        addButton = new javax.swing.JButton();
196
        addURLButton = new javax.swing.JButton();
199
        removeButton = new javax.swing.JButton();
197
        removeButton = new javax.swing.JButton();
200
        upButton = new javax.swing.JButton();
198
        upButton = new javax.swing.JButton();
201
        downButton = new javax.swing.JButton();
199
        downButton = new javax.swing.JButton();
202
200
203
        setLayout(new java.awt.GridBagLayout());
201
        setLayout(new java.awt.GridBagLayout());
204
202
205
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_J2SEVolumeCustomizer"));
206
        message.setLabelFor(content);
203
        message.setLabelFor(content);
207
        org.openide.awt.Mnemonics.setLocalizedText(message, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_ContentMessage"));
204
        org.openide.awt.Mnemonics.setLocalizedText(message, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_ContentMessage")); // NOI18N
208
        gridBagConstraints = new java.awt.GridBagConstraints();
205
        gridBagConstraints = new java.awt.GridBagConstraints();
209
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
206
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
210
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
207
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
Lines 225-254 Link Here
225
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 6, 6);
222
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 6, 6);
226
        add(jScrollPane1, gridBagConstraints);
223
        add(jScrollPane1, gridBagConstraints);
227
224
228
        org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_AddContent"));
225
        org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_AddContent")); // NOI18N
229
        addButton.addActionListener(new java.awt.event.ActionListener() {
226
        addButton.addActionListener(new java.awt.event.ActionListener() {
230
            public void actionPerformed(java.awt.event.ActionEvent evt) {
227
            public void actionPerformed(java.awt.event.ActionEvent evt) {
231
                addResource(evt);
228
                addResource(evt);
232
            }
229
            }
233
        });
230
        });
234
235
        gridBagConstraints = new java.awt.GridBagConstraints();
231
        gridBagConstraints = new java.awt.GridBagConstraints();
236
        gridBagConstraints.gridx = 1;
232
        gridBagConstraints.gridx = 1;
237
        gridBagConstraints.gridy = 1;
233
        gridBagConstraints.gridy = 1;
238
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
234
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
239
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
235
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
240
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
236
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
241
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 6, 6);
237
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
242
        add(addButton, gridBagConstraints);
238
        add(addButton, gridBagConstraints);
243
        addButton.getAccessibleContext().setAccessibleDescription(null);
239
        addButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_addButton")); // NOI18N
244
240
245
        org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_RemoveContent"));
241
        org.openide.awt.Mnemonics.setLocalizedText(addURLButton, NbBundle.getMessage(J2SEVolumeCustomizer.class, "J2SEVolumeCustomizer.addURLButton.text")); // NOI18N
242
        addURLButton.addActionListener(new java.awt.event.ActionListener() {
243
            public void actionPerformed(java.awt.event.ActionEvent evt) {
244
                addURLButtonActionPerformed(evt);
245
            }
246
        });
247
        gridBagConstraints = new java.awt.GridBagConstraints();
248
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
249
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
250
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 6, 6);
251
        add(addURLButton, gridBagConstraints);
252
253
        org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_RemoveContent")); // NOI18N
246
        removeButton.addActionListener(new java.awt.event.ActionListener() {
254
        removeButton.addActionListener(new java.awt.event.ActionListener() {
247
            public void actionPerformed(java.awt.event.ActionEvent evt) {
255
            public void actionPerformed(java.awt.event.ActionEvent evt) {
248
                removeResource(evt);
256
                removeResource(evt);
249
            }
257
            }
250
        });
258
        });
251
252
        gridBagConstraints = new java.awt.GridBagConstraints();
259
        gridBagConstraints = new java.awt.GridBagConstraints();
253
        gridBagConstraints.gridx = 1;
260
        gridBagConstraints.gridx = 1;
254
        gridBagConstraints.gridy = 3;
261
        gridBagConstraints.gridy = 3;
Lines 257-271 Link Here
257
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
264
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
258
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 6, 6);
265
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 6, 6);
259
        add(removeButton, gridBagConstraints);
266
        add(removeButton, gridBagConstraints);
260
        removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_RemoveContent"));
267
        removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_RemoveContent")); // NOI18N
261
268
262
        org.openide.awt.Mnemonics.setLocalizedText(upButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_UpContent"));
269
        org.openide.awt.Mnemonics.setLocalizedText(upButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_UpContent")); // NOI18N
263
        upButton.addActionListener(new java.awt.event.ActionListener() {
270
        upButton.addActionListener(new java.awt.event.ActionListener() {
264
            public void actionPerformed(java.awt.event.ActionEvent evt) {
271
            public void actionPerformed(java.awt.event.ActionEvent evt) {
265
                upResource(evt);
272
                upResource(evt);
266
            }
273
            }
267
        });
274
        });
268
269
        gridBagConstraints = new java.awt.GridBagConstraints();
275
        gridBagConstraints = new java.awt.GridBagConstraints();
270
        gridBagConstraints.gridx = 1;
276
        gridBagConstraints.gridx = 1;
271
        gridBagConstraints.gridy = 4;
277
        gridBagConstraints.gridy = 4;
Lines 274-288 Link Here
274
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
280
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
275
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 6);
281
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 6);
276
        add(upButton, gridBagConstraints);
282
        add(upButton, gridBagConstraints);
277
        upButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_UpContent"));
283
        upButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_UpContent")); // NOI18N
278
284
279
        org.openide.awt.Mnemonics.setLocalizedText(downButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_DownContent"));
285
        org.openide.awt.Mnemonics.setLocalizedText(downButton, org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("CTL_DownContent")); // NOI18N
280
        downButton.addActionListener(new java.awt.event.ActionListener() {
286
        downButton.addActionListener(new java.awt.event.ActionListener() {
281
            public void actionPerformed(java.awt.event.ActionEvent evt) {
287
            public void actionPerformed(java.awt.event.ActionEvent evt) {
282
                downResource(evt);
288
                downResource(evt);
283
            }
289
            }
284
        });
290
        });
285
286
        gridBagConstraints = new java.awt.GridBagConstraints();
291
        gridBagConstraints = new java.awt.GridBagConstraints();
287
        gridBagConstraints.gridx = 1;
292
        gridBagConstraints.gridx = 1;
288
        gridBagConstraints.gridy = 5;
293
        gridBagConstraints.gridy = 5;
Lines 291-300 Link Here
291
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
296
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
292
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 6, 6);
297
        gridBagConstraints.insets = new java.awt.Insets(5, 6, 6, 6);
293
        add(downButton, gridBagConstraints);
298
        add(downButton, gridBagConstraints);
294
        downButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_DownContent"));
299
        downButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_DownContent")); // NOI18N
295
300
296
    }
301
        getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(J2SEVolumeCustomizer.class).getString("AD_J2SEVolumeCustomizer")); // NOI18N
297
    // </editor-fold>//GEN-END:initComponents
302
    }// </editor-fold>//GEN-END:initComponents
298
303
299
    private void downResource(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downResource
304
    private void downResource(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downResource
300
        int[] indices = this.content.getSelectedIndices();
305
        int[] indices = this.content.getSelectedIndices();
Lines 396-422 Link Here
396
        }
401
        }
397
    }//GEN-LAST:event_addResource
402
    }//GEN-LAST:event_addResource
398
403
399
404
    private void addURLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addURLButtonActionPerformed
400
//    private void addURLResource () {
405
        DialogDescriptor.InputLine input = new DialogDescriptor.InputLine(
401
//        DialogDescriptor.InputLine input = new DialogDescriptor.InputLine (
406
                NbBundle.getMessage(J2SEVolumeCustomizer.class, "CTL_AddJavadocURLMessage"),
402
//                NbBundle.getMessage(J2SEVolumeCustomizer.class,"CTL_AddJavadocURLMessage"),
407
                NbBundle.getMessage(J2SEVolumeCustomizer.class, "CTL_AddJavadocURLTitle"));
403
//                NbBundle.getMessage(J2SEVolumeCustomizer.class,"CTL_AddJavadocURLTitle"));
408
        if (DialogDisplayer.getDefault().notify(input) == DialogDescriptor.OK_OPTION) {
404
//        if (DialogDisplayer.getDefault().notify(input) == DialogDescriptor.OK_OPTION) {
409
            try {
405
//            try {
410
                String value = input.getInputText();
406
//                String value = input.getInputText();
411
                URL url = new URL(value);
407
//                URL url = new URL (value);
412
                model.addResource(url);
408
//                this.model.addResource(url);
413
                content.setSelectedIndex(model.getSize() - 1);
409
//                this.content.setSelectedIndex(this.model.getSize()-1);
414
            } catch (MalformedURLException mue) {
410
//            } catch (MalformedURLException mue) {
415
                DialogDisplayer.getDefault().notify(new DialogDescriptor.Message(
411
//                DialogDescriptor.Message message = new DialogDescriptor.Message (
416
                        NbBundle.getMessage(J2SEVolumeCustomizer.class, "CTL_InvalidURLFormat"),
412
//                        NbBundle.getMessage(J2SEVolumeCustomizer.class,"CTL_InvalidURLFormat"),
417
                        DialogDescriptor.ERROR_MESSAGE));
413
//                        DialogDescriptor.ERROR_MESSAGE
418
            }
414
//                );
419
        }
415
//                DialogDisplayer.getDefault().notify(message);
420
    }//GEN-LAST:event_addURLButtonActionPerformed
416
//            }
417
//        }
418
//    }
419
420
421
421
    private void addFiles (String[] fileNames, URL libraryLocation, String volume) throws MalformedURLException, URISyntaxException {
422
    private void addFiles (String[] fileNames, URL libraryLocation, String volume) throws MalformedURLException, URISyntaxException {
422
        int firstIndex = this.model.getSize();
423
        int firstIndex = this.model.getSize();
Lines 579-584 Link Here
579
580
580
    // Variables declaration - do not modify//GEN-BEGIN:variables
581
    // Variables declaration - do not modify//GEN-BEGIN:variables
581
    private javax.swing.JButton addButton;
582
    private javax.swing.JButton addButton;
583
    private javax.swing.JButton addURLButton;
582
    private javax.swing.JList content;
584
    private javax.swing.JList content;
583
    private javax.swing.JButton downButton;
585
    private javax.swing.JButton downButton;
584
    private javax.swing.JScrollPane jScrollPane1;
586
    private javax.swing.JScrollPane jScrollPane1;
Lines 586-592 Link Here
586
    private javax.swing.JButton removeButton;
588
    private javax.swing.JButton removeButton;
587
    private javax.swing.JButton upButton;
589
    private javax.swing.JButton upButton;
588
    // End of variables declaration//GEN-END:variables
590
    // End of variables declaration//GEN-END:variables
589
    private JButton addURLButton;
590
591
591
    private static class ContentRenderer extends DefaultListCellRenderer {
592
    private static class ContentRenderer extends DefaultListCellRenderer {
592
593
Lines 605-611 Link Here
605
                    Exceptions.printStackTrace(ex);
606
                    Exceptions.printStackTrace(ex);
606
                }
607
                }
607
            }
608
            }
608
            if (uri != null) {
609
            if (uri != null && uri.toString().startsWith("http")) {
610
                displayName = uri.toString();
611
            } else if (uri != null) {
609
                if (uri.toString().contains("!/")) {   //NOI18N
612
                if (uri.toString().contains("!/")) {   //NOI18N
610
                    uri = LibrariesSupport.getArchiveFile(uri);
613
                    uri = LibrariesSupport.getArchiveFile(uri);
611
                }
614
                }
(-)a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformCustomizer.java (-73 / +83 lines)
Lines 40-47 Link Here
40
 */
40
 */
41
package org.netbeans.modules.java.j2seplatform.platformdefinition;
41
package org.netbeans.modules.java.j2seplatform.platformdefinition;
42
42
43
43
import java.awt.GridBagConstraints;
44
import java.awt.*;
44
import java.awt.GridBagLayout;
45
import java.awt.Insets;
45
import java.awt.event.ActionListener;
46
import java.awt.event.ActionListener;
46
import java.awt.event.ActionEvent;
47
import java.awt.event.ActionEvent;
47
import java.io.File;
48
import java.io.File;
Lines 51-57 Link Here
51
import java.net.URL;
52
import java.net.URL;
52
import java.net.URI;
53
import java.net.URI;
53
import java.net.MalformedURLException;
54
import java.net.MalformedURLException;
54
import javax.swing.*;
55
import javax.swing.AbstractListModel;
56
import javax.swing.JButton;
57
import javax.swing.JComponent;
58
import javax.swing.JFileChooser;
59
import javax.swing.JLabel;
60
import javax.swing.JList;
61
import javax.swing.JPanel;
62
import javax.swing.JScrollPane;
63
import javax.swing.JTabbedPane;
64
import javax.swing.JTextField;
55
import javax.swing.filechooser.FileFilter;
65
import javax.swing.filechooser.FileFilter;
56
import javax.swing.event.ListSelectionListener;
66
import javax.swing.event.ListSelectionListener;
57
import javax.swing.event.ListSelectionEvent;
67
import javax.swing.event.ListSelectionEvent;
Lines 61-70 Link Here
61
import org.netbeans.api.java.classpath.ClassPath;
71
import org.netbeans.api.java.classpath.ClassPath;
62
import org.netbeans.spi.java.classpath.PathResourceImplementation;
72
import org.netbeans.spi.java.classpath.PathResourceImplementation;
63
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
73
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
74
import org.openide.DialogDescriptor;
75
import org.openide.DialogDisplayer;
64
import org.openide.util.Exceptions;
76
import org.openide.util.Exceptions;
65
77
66
67
68
public class J2SEPlatformCustomizer extends JTabbedPane {
78
public class J2SEPlatformCustomizer extends JTabbedPane {
69
79
70
    private static final int CLASSPATH = 0;
80
    private static final int CLASSPATH = 0;
Lines 97-103 Link Here
97
107
98
        private JList resources;
108
        private JList resources;
99
        private JButton addButton;
109
        private JButton addButton;
100
//        private JButton addURLButton;
110
        private JButton addURLButton;
101
        private JButton removeButton;
111
        private JButton removeButton;
102
        private JButton moveUpButton;
112
        private JButton moveUpButton;
103
        private JButton moveDownButton;
113
        private JButton moveDownButton;
Lines 197-220 Link Here
197
                c.insets = new Insets (0,6,0,6);
207
                c.insets = new Insets (0,6,0,6);
198
                ((GridBagLayout)this.getLayout()).setConstraints(addButton,c);
208
                ((GridBagLayout)this.getLayout()).setConstraints(addButton,c);
199
                this.add (addButton);
209
                this.add (addButton);
200
//                if (this.type == JAVADOC) {
210
                if (this.type == JAVADOC) {
201
//                    addURLButton  = new JButton (NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_AddURL"));
211
                    addURLButton = new JButton(NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_AddURL"));
202
//                    addURLButton.setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_AddURL").charAt(0));
212
                    addURLButton.setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_AddURL").charAt(0));
203
//                    addURLButton.addActionListener(new ActionListener () {
213
                    addURLButton.addActionListener(new ActionListener() {
204
//                        public void actionPerformed(ActionEvent e) {
214
                        public void actionPerformed(ActionEvent e) {
205
//                            addURLElement ();
215
                            addURLElement();
206
//                        }
216
                        }
207
//                    });
217
                    });
208
//                    c = new GridBagConstraints();
218
                    c = new GridBagConstraints();
209
//                    c.gridx = 1;
219
                    c.gridx = 1;
210
//                    c.gridy = 2;
220
                    c.gridy = 2;
211
//                    c.gridwidth = GridBagConstraints.REMAINDER;
221
                    c.gridwidth = GridBagConstraints.REMAINDER;
212
//                    c.fill = GridBagConstraints.HORIZONTAL;
222
                    c.fill = GridBagConstraints.HORIZONTAL;
213
//                    c.anchor = GridBagConstraints.NORTHWEST;
223
                    c.anchor = GridBagConstraints.NORTHWEST;
214
//                    c.insets = new Insets (0,6,6,12);
224
                    c.insets = new Insets(0, 6, 6, 12);
215
//                    ((GridBagLayout)this.getLayout()).setConstraints(addURLButton,c);
225
                    ((GridBagLayout) this.getLayout()).setConstraints(addURLButton, c);
216
//                    this.add (addURLButton);
226
                    this.add(addURLButton);
217
//                }
227
                }
218
                removeButton = new JButton (NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_Remove"));
228
                removeButton = new JButton (NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_Remove"));
219
                removeButton.setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_Remove").charAt(0));
229
                removeButton.setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_Remove").charAt(0));
220
                removeButton.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(J2SEPlatformCustomizer.class,"AD_Remove"));
230
                removeButton.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(J2SEPlatformCustomizer.class,"AD_Remove"));
Lines 272-326 Link Here
272
            }
282
            }
273
        }
283
        }
274
284
275
//        private void addURLElement() {
285
        private void addURLElement() {
276
//            JPanel p = new JPanel ();
286
            JPanel p = new JPanel();
277
//            GridBagLayout lm = new GridBagLayout();
287
            GridBagLayout lm = new GridBagLayout();
278
//            p.setLayout (lm);
288
            p.setLayout(lm);
279
//            GridBagConstraints c = new GridBagConstraints ();
289
            GridBagConstraints c = new GridBagConstraints();
280
//            c.gridx = c.gridy = GridBagConstraints.RELATIVE;
290
            c.gridx = c.gridy = GridBagConstraints.RELATIVE;
281
//            c.insets = new Insets (12,12,12,6);
291
            c.insets = new Insets(12, 12, 12, 6);
282
//            c.anchor = GridBagConstraints.NORTHWEST;
292
            c.anchor = GridBagConstraints.NORTHWEST;
283
//            JLabel label = new JLabel (NbBundle.getMessage(J2SEPlatformCustomizer.class,"CTL_AddJavadocURLMessage"));
293
            JLabel label = new JLabel(NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_AddJavadocURLMessage"));
284
//            label.setDisplayedMnemonic ('U');
294
            label.setDisplayedMnemonic('U');
285
//            lm.setConstraints(label,c);
295
            lm.setConstraints(label, c);
286
//            p.add (label);
296
            p.add(label);
287
//            c = new GridBagConstraints ();
297
            c = new GridBagConstraints();
288
//            c.gridx = c.gridy = GridBagConstraints.RELATIVE;
298
            c.gridx = c.gridy = GridBagConstraints.RELATIVE;
289
//            c.gridwidth = GridBagConstraints.REMAINDER;
299
            c.gridwidth = GridBagConstraints.REMAINDER;
290
//            c.insets = new Insets (12,0,12,6);
300
            c.insets = new Insets(12, 0, 12, 6);
291
//            c.fill = GridBagConstraints.HORIZONTAL;
301
            c.fill = GridBagConstraints.HORIZONTAL;
292
//            c.anchor = GridBagConstraints.NORTHWEST;
302
            c.anchor = GridBagConstraints.NORTHWEST;
293
//            JTextField text = new JTextField ();
303
            JTextField text = new JTextField();
294
//            text.setColumns(30);
304
            text.setColumns(30);
295
//            text.setText (NbBundle.getMessage(J2SEPlatformCustomizer.class,"TXT_DefaultProtocol"));
305
            text.setText(NbBundle.getMessage(J2SEPlatformCustomizer.class, "TXT_DefaultProtocol"));
296
//            text.selectAll();
306
            text.selectAll();
297
//            label.setLabelFor(text);
307
            label.setLabelFor(text);
298
//            lm.setConstraints(text,c);
308
            lm.setConstraints(text, c);
299
//            p.add (text);            
309
            p.add(text);
300
//            JButton[] options = new JButton[] {
310
            JButton[] options = new JButton[] {
301
//                new JButton (NbBundle.getMessage(J2SEPlatformCustomizer.class,"CTL_AddJavadocURLTitle")),
311
                new JButton(NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_AddJavadocURLTitle")),
302
//                new JButton (NbBundle.getMessage(J2SEPlatformCustomizer.class,"CTL_Cancel"))
312
                new JButton(NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_Cancel"))
303
//            };
313
            };
304
//            options[0].setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class,"MNE_Add").charAt(0));
314
            options[0].setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_Add").charAt(0));
305
//            options[1].setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class,"MNE_Cancel").charAt(0));
315
            options[1].setMnemonic(NbBundle.getMessage(J2SEPlatformCustomizer.class, "MNE_Cancel").charAt(0));
306
//            DialogDescriptor input = new DialogDescriptor (
316
            DialogDescriptor input = new DialogDescriptor(
307
//                p,
317
                    p,
308
//                NbBundle.getMessage(J2SEPlatformCustomizer.class,"CTL_AddJavadocURLTitle"),
318
                    NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_AddJavadocURLTitle"),
309
//                true, options, options[0], DialogDescriptor.DEFAULT_ALIGN, null, null);            
319
                    true, options, options[0], DialogDescriptor.DEFAULT_ALIGN, null, null);
310
//            if (DialogDisplayer.getDefault().notify(input) == options[0]) {
320
            if (DialogDisplayer.getDefault().notify(input) == options[0]) {
311
//                try {
321
                try {
312
//                    String value = text.getText();
322
                    String value = text.getText();
313
//                    URL url = new URL (value);
323
                    URL url = new URL(value);
314
//                    ((PathModel)this.resources.getModel()).addPath(url);
324
                    ((PathModel) this.resources.getModel()).addPath(url);
315
//                    this.resources.setSelectedIndex (this.resources.getModel().getSize()-1);
325
                    this.resources.setSelectedIndex(this.resources.getModel().getSize() - 1);
316
//                } catch (MalformedURLException mue) {
326
                } catch (MalformedURLException mue) {
317
//                    DialogDescriptor.Message message = new DialogDescriptor.Message (
327
                    DialogDescriptor.Message message = new DialogDescriptor.Message(
318
//                        NbBundle.getMessage(J2SEPlatformCustomizer.class,"CTL_InvalidURLFormat"),
328
                            NbBundle.getMessage(J2SEPlatformCustomizer.class, "CTL_InvalidURLFormat"),
319
//                        DialogDescriptor.ERROR_MESSAGE);
329
                            DialogDescriptor.ERROR_MESSAGE);
320
//                    DialogDisplayer.getDefault().notify(message);
330
                    DialogDisplayer.getDefault().notify(message);
321
//                }
331
                }
322
//            }
332
            }
323
//        }
333
        }
324
334
325
        private void addPathElement () {
335
        private void addPathElement () {
326
            JFileChooser chooser = new JFileChooser ();
336
            JFileChooser chooser = new JFileChooser ();
(-)a/java.source/src/org/netbeans/api/java/source/SourceUtils.java (-33 / +27 lines)
Lines 648-692 Link Here
648
                    }
648
                    }
649
                }
649
                }
650
            }
650
            }
651
            CharSequence fragment = buildFragment ? getFragment(element) : null;
651
            for (URL binary : binaries) {
652
            for (URL binary : binaries) {
652
                Result javadocResult = JavadocForBinaryQuery.findJavadoc(binary);
653
                Result javadocResult = JavadocForBinaryQuery.findJavadoc(binary);
653
                URL[] result = javadocResult.getRoots();
654
                URL[] result = javadocResult.getRoots();
654
                for (int cntr = 0; cntr < result.length; cntr++) {
655
                for (URL root : result) {
655
                    if (!result[cntr].toExternalForm().endsWith("/")) { // NOI18N
656
                    if (!root.toExternalForm().endsWith("/")) { // NOI18N
656
                        Logger.getLogger(SourceUtils.class.getName()).log(Level.WARNING, "JavadocForBinaryQuery.Result: {0} returned non-folder URL: {1}, ignoring", new Object[] {javadocResult.getClass(), result[cntr].toExternalForm()});
657
                        Logger.getLogger(SourceUtils.class.getName()).log(Level.WARNING, "JavadocForBinaryQuery.Result: {0} returned non-folder URL: {1}, ignoring", new Object[] {javadocResult.getClass(), root.toExternalForm()});
657
                        result[cntr] = null;
658
                        continue;
658
                    }
659
                    }
659
                }
660
                    URL url = new URL(root, pkgName + "/" + pageName + ".html");
660
                ClassPath cp = ClassPathSupport.createClassPath(result);
661
                    try {
661
                FileObject fo = cp.findResource(pkgName);
662
                        url.openStream().close();
662
                if (fo != null) {
663
                    } catch (IOException x) {
663
                    for (FileObject child : fo.getChildren()) {
664
                        continue;
664
                        if (pageName.equals(child.getName()) && FileObjects.HTML.equalsIgnoreCase(child.getExt())) {
665
                    }
665
                            URL url = child.getURL();
666
                    if (fragment != null && fragment.length() > 0) {
666
                            CharSequence fragment = null;
667
                        try {
667
                            if (url != null && buildFragment) {
668
                            // Javadoc fragments may contain chars that must be escaped to comply with RFC 2396.
668
                                fragment = getFragment(element);
669
                            // Unfortunately URLEncoder escapes almost everything but
669
                            }
670
                            // spaces replaces with '+' char which is wrong so it is
670
                            if (fragment != null && fragment.length() > 0) {
671
                            // replaced with "%20"escape sequence here.
671
                                try {
672
                            String encodedfragment = URLEncoder.encode(fragment.toString(), "UTF-8"); // NOI18N
672
                                    // Javadoc fragments may contain chars that must be escaped to comply with RFC 2396.
673
                            encodedfragment = encodedfragment.replace("+", "%20"); // NOI18N
673
                                    // Unfortunately URLEncoder escapes almost everything but
674
                            return new URI(url.toExternalForm() + '#' + encodedfragment).toURL();
674
                                    // spaces replaces with '+' char which is wrong so it is
675
                        } catch (URISyntaxException ex) {
675
                                    // replaced with "%20"escape sequence here.
676
                            Exceptions.printStackTrace(ex);
676
                                    String encodedfragment = URLEncoder.encode(fragment.toString(), "UTF-8"); // NOI18N
677
                        } catch (UnsupportedEncodingException ex) {
677
                                    encodedfragment = encodedfragment.replace("+", "%20"); // NOI18N
678
                            Exceptions.printStackTrace(ex);
678
                                    return new URI(url.toExternalForm() + '#' + encodedfragment).toURL();
679
                        } catch (MalformedURLException ex) {
679
                                } catch (URISyntaxException ex) {
680
                            Exceptions.printStackTrace(ex);
680
                                    Exceptions.printStackTrace(ex);
681
                                } catch (UnsupportedEncodingException ex) {
682
                                    Exceptions.printStackTrace(ex);
683
                                } catch (MalformedURLException ex) {
684
                                    Exceptions.printStackTrace(ex);
685
                                }
686
                            }
687
                            return url;
688
                        }
681
                        }
689
                    }
682
                    }
683
                    return url;
690
                }
684
                }
691
            }
685
            }
692
            
686
            
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java (-32 / +24 lines)
Lines 48-53 Link Here
48
import java.io.InputStreamReader;
48
import java.io.InputStreamReader;
49
import java.lang.ref.Reference;
49
import java.lang.ref.Reference;
50
import java.lang.ref.WeakReference;
50
import java.lang.ref.WeakReference;
51
import java.net.URL;
51
import java.text.Collator;
52
import java.text.Collator;
52
import java.util.ArrayList;
53
import java.util.ArrayList;
53
import java.util.Collections;
54
import java.util.Collections;
Lines 58-70 Link Here
58
import javax.swing.event.ChangeEvent;
59
import javax.swing.event.ChangeEvent;
59
import javax.swing.event.ChangeListener;
60
import javax.swing.event.ChangeListener;
60
import org.openide.ErrorManager;
61
import org.openide.ErrorManager;
61
import org.openide.filesystems.FileObject;
62
import org.openide.filesystems.FileUtil;
63
import org.openide.util.NbBundle;
62
import org.openide.util.NbBundle;
64
import org.openide.util.RequestProcessor;
63
import org.openide.util.RequestProcessor;
65
64
66
/**
65
/**
67
 * Builds index of Javadoc filesystems.
66
 * Builds index of Javadoc sets.
68
 * @author Svata Dedic, Jesse Glick
67
 * @author Svata Dedic, Jesse Glick
69
 */
68
 */
70
public class IndexBuilder implements Runnable, ChangeListener {
69
public class IndexBuilder implements Runnable, ChangeListener {
Lines 87-95 Link Here
87
    private JavadocRegistry jdocRegs;
86
    private JavadocRegistry jdocRegs;
88
87
89
    /**
88
    /**
90
     * information extracted from filesystems.
89
     * information extracted from Javadoc.
91
     */
90
     */
92
    Map<FileObject,Info> filesystemInfo = Collections.emptyMap();
91
    Map<URL,Info> filesystemInfo = Collections.emptyMap();
93
92
94
    private static class Info {
93
    private static class Info {
95
        /**
94
        /**
Lines 137-144 Link Here
137
    public static final class Index implements Comparable<Index> {
136
    public static final class Index implements Comparable<Index> {
138
        private static final Collator c = Collator.getInstance();
137
        private static final Collator c = Collator.getInstance();
139
        public final String display;
138
        public final String display;
140
        public final FileObject fo;
139
        public final URL fo;
141
        private Index(String display, FileObject fo) {
140
        private Index(String display, URL fo) {
142
            this.display = display;
141
            this.display = display;
143
            this.fo = fo;
142
            this.fo = fo;
144
        }
143
        }
Lines 147-156 Link Here
147
                return false;
146
                return false;
148
            }
147
            }
149
            final Index other = (Index) obj;
148
            final Index other = (Index) obj;
150
            return display.equals(other.display) && fo == other.fo;
149
            return display.equals(other.display) && fo.toString().equals(other.fo.toString());
151
        }
150
        }
152
        public @Override int hashCode() {
151
        public @Override int hashCode() {
153
            return display.hashCode() ^ fo.hashCode();
152
            return display.hashCode() ^ fo.toString().hashCode();
154
        }
153
        }
155
        public @Override int compareTo(Index o) {
154
        public @Override int compareTo(Index o) {
156
            return c.compare(display, o.display);
155
            return c.compare(display, o.display);
Lines 179-187 Link Here
179
        }
178
        }
180
        err.log("getIndices");
179
        err.log("getIndices");
181
        List<Index> data = new ArrayList<Index>();
180
        List<Index> data = new ArrayList<Index>();
182
        for (Map.Entry<FileObject,Info> entry : filesystemInfo.entrySet()) {
181
        for (Map.Entry<URL,Info> entry : filesystemInfo.entrySet()) {
183
            Info info = entry.getValue();
182
            Info info = entry.getValue();
184
            FileObject fo = entry.getKey().getFileObject(info.indexFileName);
183
            URL fo = URLUtils.findOpenable(entry.getKey(), info.indexFileName);
185
            if (fo == null) {
184
            if (fo == null) {
186
                continue;
185
                continue;
187
            }
186
            }
Lines 196-213 Link Here
196
        if (err.isLoggable(ErrorManager.INFORMATIONAL)) {
195
        if (err.isLoggable(ErrorManager.INFORMATIONAL)) {
197
            err.log("refreshIndex");
196
            err.log("refreshIndex");
198
        }
197
        }
199
        Map<FileObject,Info> oldMap;
198
        Map<URL,Info> oldMap;
200
        synchronized (this) {
199
        synchronized (this) {
201
            oldMap = this.filesystemInfo;
200
            oldMap = this.filesystemInfo;
202
        }
201
        }
203
        //Enumeration e = FileSystemCapability.DOC.fileSystems();
202
        URL[] docRoots = jdocRegs.getDocRoots();
204
        FileObject docRoots[] = jdocRegs.getDocRoots();
205
        // XXX needs to be able to listen to result; when it changes, call scheduleTask()
203
        // XXX needs to be able to listen to result; when it changes, call scheduleTask()
206
        Map<FileObject,Info> m = new WeakHashMap<FileObject,Info>();
204
        Map<URL,Info> m = new WeakHashMap<URL,Info>();
207
//        long startTime = System.nanoTime();
205
//        long startTime = System.nanoTime();
208
206
209
        for ( int ifCount = 0; ifCount < docRoots.length; ifCount++ ) {
207
        for ( int ifCount = 0; ifCount < docRoots.length; ifCount++ ) {
210
            FileObject fo = docRoots[ifCount];
208
            URL fo = docRoots[ifCount];
211
            Info oldInfo = oldMap.get(fo);
209
            Info oldInfo = oldMap.get(fo);
212
            if (oldInfo != null) {
210
            if (oldInfo != null) {
213
                // No need to reparse.
211
                // No need to reparse.
Lines 215-244 Link Here
215
                continue;
213
                continue;
216
            }
214
            }
217
            
215
            
218
            FileObject index = null;
216
            URL index = URLUtils.findOpenable(fo, INDEX_FILE_NAMES);
219
            for (int i = 0; i < INDEX_FILE_NAMES.length; i++) {
217
            if (index == null || index.toString().endsWith("index.html")) { // NOI18N
220
                if ((index = fo.getFileObject(INDEX_FILE_NAMES[i])) != null) {
221
                    break;
222
                }
223
            }
224
            if (index == null || index.getName().equals("index")) { // NOI18N
225
                // For single-package doc sets, overview-summary.html is not present,
218
                // For single-package doc sets, overview-summary.html is not present,
226
                // and index.html is less suitable (it is framed). Look for a package
219
                // and index.html is less suitable (it is framed). Look for a package
227
                // summary.
220
                // summary.
228
                // [PENDING] Display name is not ideal, e.g. "org.openide.windows (NetBeans Input/Output API)"
221
                // [PENDING] Display name is not ideal, e.g. "org.openide.windows (NetBeans Input/Output API)"
229
                // where simply "NetBeans Input/Output API" is preferable... but standard title filter
222
                // where simply "NetBeans Input/Output API" is preferable... but standard title filter
230
                // regexps are not so powerful (to avoid matching e.g. "Servlets (Main Documentation)").
223
                // regexps are not so powerful (to avoid matching e.g. "Servlets (Main Documentation)").
231
                FileObject packageList = fo.getFileObject("package-list"); // NOI18N
224
                InputStream is = URLUtils.open(fo, "package-list"); // NOI18N
232
                if (packageList != null) {
225
                if (is != null) {
233
                    try {
226
                    try {
234
                        InputStream is = packageList.getInputStream();
235
                        try {
227
                        try {
236
                            BufferedReader r = new BufferedReader(new InputStreamReader(is));
228
                            BufferedReader r = new BufferedReader(new InputStreamReader(is));
237
                            String line = r.readLine();
229
                            String line = r.readLine();
238
                            if (line != null && r.readLine() == null) {
230
                            if (line != null && r.readLine() == null) {
239
                                // Good, exactly one line as expected. A package name.
231
                                // Good, exactly one line as expected. A package name.
240
                                String resName = line.replace('.', '/') + "/package-summary.html"; // NOI18N
232
                                String resName = line.replace('.', '/') + "/package-summary.html"; // NOI18N
241
                                FileObject pindex = fo.getFileObject(resName);
233
                                URL pindex = URLUtils.findOpenable(fo, resName);
242
                                if (pindex != null) {
234
                                if (pindex != null) {
243
                                    index = pindex;
235
                                    index = pindex;
244
                                }
236
                                }
Lines 264-270 Link Here
264
                    title = st.getOverviewTitleBase(title);
256
                    title = st.getOverviewTitleBase(title);
265
                }
257
                }
266
                if (title == null || "".equals(title)) { // NOI18N
258
                if (title == null || "".equals(title)) { // NOI18N
267
                    String filename = FileUtil.getFileDisplayName(index);
259
                    String filename = URLUtils.getDisplayName(index);
268
                    if (filename.length() > 54) {
260
                    if (filename.length() > 54) {
269
                        // trim to display 54 chars
261
                        // trim to display 54 chars
270
                        filename = filename.substring(0, 10) + "[...]" // NOI18N
262
                        filename = filename.substring(0, 10) + "[...]" // NOI18N
Lines 274-281 Link Here
274
                            "FMT_NoOverviewTitle", new Object[] { filename }); // NOI18N
266
                            "FMT_NoOverviewTitle", new Object[] { filename }); // NOI18N
275
                }
267
                }
276
                Info info = new Info();
268
                Info info = new Info();
277
                info.title = title == null ? fo.getName() : title;
269
                info.title = title;
278
                info.indexFileName = FileUtil.getRelativePath(fo, index);
270
                info.indexFileName = index.toString().substring(fo.toString().length());
279
                m.put(fo, info);
271
                m.put(fo, info);
280
            }
272
            }
281
            synchronized (this) {
273
            synchronized (this) {
Lines 291-297 Link Here
291
     * Attempt to find the title of an HTML file object.
283
     * Attempt to find the title of an HTML file object.
292
     * May return null if there is no title tag, or "" if it is empty.
284
     * May return null if there is no title tag, or "" if it is empty.
293
     */
285
     */
294
    private String parseTitle(FileObject html) {
286
    private String parseTitle(URL html) {
295
        String title = null;
287
        String title = null;
296
        try {
288
        try {
297
            // #71979: html parser used again to fix encoding issues.
289
            // #71979: html parser used again to fix encoding issues.
Lines 299-305 Link Here
299
            // is used (#32551).
291
            // is used (#32551).
300
            // In case the parser is stopped as soon as it finds the title it is
292
            // In case the parser is stopped as soon as it finds the title it is
301
            // even faster than the previous fix.
293
            // even faster than the previous fix.
302
            InputStream is = new BufferedInputStream(html.getInputStream(), 1024);
294
            InputStream is = new BufferedInputStream(html.openStream(), 1024);
303
            SimpleTitleParser tp = new SimpleTitleParser(is);
295
            SimpleTitleParser tp = new SimpleTitleParser(is);
304
            try {
296
            try {
305
                tp.parse();
297
                tp.parse();
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/IndexOverviewAction.java (-21 / +4 lines)
Lines 53-63 Link Here
53
import org.openide.ErrorManager;
53
import org.openide.ErrorManager;
54
import org.openide.awt.HtmlBrowser;
54
import org.openide.awt.HtmlBrowser;
55
import org.openide.awt.Mnemonics;
55
import org.openide.awt.Mnemonics;
56
import org.openide.filesystems.FileObject;
57
import org.openide.util.HelpCtx;
56
import org.openide.util.HelpCtx;
58
import org.openide.util.NbBundle;
57
import org.openide.util.NbBundle;
59
import org.openide.awt.DynamicMenuContent;
58
import org.openide.awt.DynamicMenuContent;
60
import org.openide.filesystems.URLMapper;
61
import org.openide.util.actions.SystemAction;
59
import org.openide.util.actions.SystemAction;
62
import org.openide.util.actions.Presenter;
60
import org.openide.util.actions.Presenter;
63
61
Lines 183-212 Link Here
183
     */
181
     */
184
    private final class IndexMenuItem extends JMenuItem implements ActionListener, HelpCtx.Provider {
182
    private final class IndexMenuItem extends JMenuItem implements ActionListener, HelpCtx.Provider {
185
        
183
        
186
        /** cached url */
184
        private final URL loc;
187
        private URL u;
188
        /** a reference to org.openide.filesystems.FileSystem */
189
        private final FileObject fsRef;
190
        
185
        
191
        @SuppressWarnings("LeakingThisInConstructor")
186
        @SuppressWarnings("LeakingThisInConstructor")
192
        public IndexMenuItem(String display, FileObject index) {
187
        public IndexMenuItem(String display, URL index) {
193
            super(display);
188
            super(display);
194
            fsRef = index;
189
            loc = index;
195
            addActionListener(this);
190
            addActionListener(this);
196
        }
191
        }
197
        
192
        
198
        public @Override void actionPerformed(ActionEvent ev) {
193
        public @Override void actionPerformed(ActionEvent ev) {
199
            URL loc = getURL();
200
            HtmlBrowser.URLDisplayer.getDefault().showURL(loc);
194
            HtmlBrowser.URLDisplayer.getDefault().showURL(loc);
201
        }
195
        }
202
        
196
        
203
        private URL getURL() {
204
            if (u == null) {
205
                u = URLMapper.findURL(fsRef, URLMapper.EXTERNAL);
206
            }
207
            return u;
208
        }
209
        
210
        public @Override HelpCtx getHelpCtx() {
197
        public @Override HelpCtx getHelpCtx() {
211
            return IndexOverviewAction.this.getHelpCtx();
198
            return IndexOverviewAction.this.getHelpCtx();
212
        }
199
        }
Lines 222-232 Link Here
222
        }
209
        }
223
210
224
        public @Override void actionPerformed(ActionEvent e) {
211
        public @Override void actionPerformed(ActionEvent e) {
225
            FileObject fsRef = ReferencesPanel.showInWindow();
212
            URL u = ReferencesPanel.showInWindow();
226
            URL u = null;
227
            if (fsRef != null) {
228
                u = URLMapper.findURL(fsRef, URLMapper.EXTERNAL);
229
            }
230
            if (u != null) {
213
            if (u != null) {
231
                HtmlBrowser.URLDisplayer.getDefault().showURL(u);
214
                HtmlBrowser.URLDisplayer.getDefault().showURL(u);
232
            }
215
            }
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/IndexSearchThread.java (-3 / +3 lines)
Lines 41-50 Link Here
41
41
42
package org.netbeans.modules.javadoc.search;
42
package org.netbeans.modules.javadoc.search;
43
43
44
import java.net.URL;
44
import java.util.StringTokenizer;
45
import java.util.StringTokenizer;
45
46
46
import org.openide.util.RequestProcessor;
47
import org.openide.util.RequestProcessor;
47
import org.openide.filesystems.FileObject;
48
48
49
/** Abstract class for thread which searches for documentation
49
/** Abstract class for thread which searches for documentation
50
 *
50
 *
Lines 59-65 Link Here
59
    //protected String                toFind;
59
    //protected String                toFind;
60
60
61
    // documentation index file (or foldee for splitted index)
61
    // documentation index file (or foldee for splitted index)
62
    protected FileObject            indexRoot;
62
    protected URL            indexRoot;
63
    private   DocIndexItemConsumer  ddiConsumer;
63
    private   DocIndexItemConsumer  ddiConsumer;
64
    private final RequestProcessor.Task rpTask;
64
    private final RequestProcessor.Task rpTask;
65
    private boolean isFinished = false;
65
    private boolean isFinished = false;
Lines 77-83 Link Here
77
    abstract void stopSearch();
77
    abstract void stopSearch();
78
78
79
    @SuppressWarnings("LeakingThisInConstructor")
79
    @SuppressWarnings("LeakingThisInConstructor")
80
    public IndexSearchThread( String toFind, FileObject fo, DocIndexItemConsumer ddiConsumer, boolean caseSensitive ) {
80
    public IndexSearchThread(String toFind, URL fo, DocIndexItemConsumer ddiConsumer, boolean caseSensitive) {
81
        this.ddiConsumer = ddiConsumer;
81
        this.ddiConsumer = ddiConsumer;
82
        this.indexRoot = fo;
82
        this.indexRoot = fo;
83
        this.caseSensitive = caseSensitive;
83
        this.caseSensitive = caseSensitive;
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/JavadocRegistry.java (-37 / +31 lines)
Lines 58-63 Link Here
58
import java.io.IOException;
58
import java.io.IOException;
59
import java.io.BufferedReader;
59
import java.io.BufferedReader;
60
import java.io.InputStreamReader;
60
import java.io.InputStreamReader;
61
import java.util.logging.Level;
62
import java.util.logging.Logger;
61
import javax.swing.event.ChangeEvent;
63
import javax.swing.event.ChangeEvent;
62
64
63
import javax.swing.event.ChangeListener;
65
import javax.swing.event.ChangeListener;
Lines 69-75 Link Here
69
import org.netbeans.api.java.classpath.ClassPath;
71
import org.netbeans.api.java.classpath.ClassPath;
70
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
72
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
71
73
72
import org.openide.filesystems.FileObject;
73
74
74
import org.netbeans.api.java.classpath.GlobalPathRegistry;
75
import org.netbeans.api.java.classpath.GlobalPathRegistry;
75
import org.netbeans.api.java.classpath.GlobalPathRegistryEvent;
76
import org.netbeans.api.java.classpath.GlobalPathRegistryEvent;
Lines 77-83 Link Here
77
import org.netbeans.api.java.classpath.GlobalPathRegistryListener;
78
import org.netbeans.api.java.classpath.GlobalPathRegistryListener;
78
79
79
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
80
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
80
import org.openide.ErrorManager;
81
import org.openide.util.ChangeSupport;
81
import org.openide.util.ChangeSupport;
82
import org.openide.util.Lookup;
82
import org.openide.util.Lookup;
83
83
Lines 89-95 Link Here
89
public class JavadocRegistry implements GlobalPathRegistryListener, ChangeListener, PropertyChangeListener  {
89
public class JavadocRegistry implements GlobalPathRegistryListener, ChangeListener, PropertyChangeListener  {
90
        
90
        
91
    private static JavadocRegistry INSTANCE;
91
    private static JavadocRegistry INSTANCE;
92
92
    private static final Logger LOG = Logger.getLogger(JavadocRegistry.class.getName());
93
    
93
    
94
    private GlobalPathRegistry regs;    
94
    private GlobalPathRegistry regs;    
95
    private final ChangeSupport cs = new ChangeSupport(this);
95
    private final ChangeSupport cs = new ChangeSupport(this);
Lines 112-121 Link Here
112
112
113
    /** Returns Array of the Javadoc Index roots
113
    /** Returns Array of the Javadoc Index roots
114
     */
114
     */
115
    public FileObject[] getDocRoots() {
115
    public URL[] getDocRoots() {
116
        synchronized (this) {
116
        synchronized (this) {
117
            if (this.docRoots != null) {
117
            if (this.docRoots != null) {
118
                return this.docRoots.getRoots();
118
                return docRoots();
119
            }
119
            }
120
        }        
120
        }        
121
        //XXX must be called out of synchronized block to prevent
121
        //XXX must be called out of synchronized block to prevent
Lines 131-142 Link Here
131
                this.results = _results;
131
                this.results = _results;
132
                registerListeners(this, _classpaths, _results, this.docRoots);
132
                registerListeners(this, _classpaths, _results, this.docRoots);
133
            }
133
            }
134
            return this.docRoots.getRoots();
134
            return docRoots();
135
        }
135
        }
136
    }
136
    }
137
    private URL[] docRoots() {
138
        List<ClassPath.Entry> entries = docRoots.entries();
139
        URL[] roots = new URL[entries.size()];
140
        for (int i = 0; i < roots.length; i++) {
141
            roots[i] = entries.get(i).getURL();
142
        }
143
        return roots;
144
    }
137
    
145
    
138
    
146
    
139
    public JavadocSearchType findSearchType( FileObject apidocRoot ) {
147
    public JavadocSearchType findSearchType(URL apidocRoot) {
140
        String encoding = getDocEncoding (apidocRoot);
148
        String encoding = getDocEncoding (apidocRoot);
141
        for (JavadocSearchType jdst : Lookup.getDefault().lookupAll(JavadocSearchType.class)) {
149
        for (JavadocSearchType jdst : Lookup.getDefault().lookupAll(JavadocSearchType.class)) {
142
            if (jdst.accepts(apidocRoot, encoding)) {
150
            if (jdst.accepts(apidocRoot, encoding)) {
Lines 246-286 Link Here
246
    }
254
    }
247
255
248
256
249
    private String getDocEncoding (FileObject root) {
257
    private String getDocEncoding(URL root) {
250
         assert root != null && root.isFolder();
258
        assert root != null && root.toString().endsWith("/") : root;
251
        FileObject fo = root.getFileObject("index-all.html");   //NOI18N
259
        InputStream is = URLUtils.open(root, "index-all.html", "index-files/index-1.html");
252
        if (fo == null) {
260
        if (is != null) {
253
            fo = root.getFileObject("index-files"); //NOI18N
261
            try {
254
            if (fo == null) {
262
                try {
255
                return null;
263
                    ParserDelegator pd = new ParserDelegator();
264
                    BufferedReader in = new BufferedReader(new InputStreamReader(is));
265
                    EncodingCallback ecb = new EncodingCallback(in);
266
                    pd.parse(in, ecb, true);
267
                    return ecb.getEncoding();
268
                } finally {
269
                    is.close();
270
                }
271
            } catch (IOException x) {
272
                LOG.log(Level.FINE, "Getting encoding from " + root, x);
256
            }
273
            }
257
            fo = fo.getFileObject("index-1.html");  //NOI18N
258
            if (fo == null) {
259
                return null;
260
            }
261
        }
262
        ParserDelegator pd = new ParserDelegator();
263
        try {
264
            InputStream is = fo.getInputStream();
265
            try {                
266
                BufferedReader in = new BufferedReader(new InputStreamReader(is));
267
                EncodingCallback ecb = new EncodingCallback(in);
268
                pd.parse(in, ecb, true);
269
                return ecb.getEncoding();
270
            } catch (IOException ioe) {                
271
                //Do nothing
272
            } finally {
273
                is.close();
274
            }
275
        } catch (IOException ioe) {
276
            ErrorManager.getDefault().annotate(ioe, fo.toString());
277
            ErrorManager.getDefault().notify (ioe);
278
        }
274
        }
279
        return null;
275
        return null;
280
    }
276
    }
281
277
282
283
284
    private static class EncodingCallback extends HTMLEditorKit.ParserCallback {
278
    private static class EncodingCallback extends HTMLEditorKit.ParserCallback {
285
279
286
280
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/JavadocSearchEngineImpl.java (-3 / +3 lines)
Lines 41-52 Link Here
41
41
42
package org.netbeans.modules.javadoc.search;
42
package org.netbeans.modules.javadoc.search;
43
43
44
import java.net.URL;
44
import java.util.ArrayList;
45
import java.util.ArrayList;
45
import java.util.List;
46
import java.util.List;
46
import java.util.logging.Level;
47
import java.util.logging.Level;
47
import org.openide.ErrorManager;
48
import org.openide.ErrorManager;
48
49
49
import org.openide.filesystems.FileObject;
50
50
51
/**
51
/**
52
 * @author  Petr Suchomel
52
 * @author  Petr Suchomel
Lines 80-86 Link Here
80
                          }
80
                          }
81
                      };
81
                      };
82
                      
82
                      
83
        FileObject[] docRoots = JavadocRegistry.getDefault().getDocRoots();
83
        URL[] docRoots = JavadocRegistry.getDefault().getDocRoots();
84
        synchronized(this) {
84
        synchronized(this) {
85
            if (isStopped) {
85
            if (isStopped) {
86
                return;
86
                return;
Lines 100-106 Link Here
100
                ErrorManager.getDefault().log ("NO Search type for " + docRoots[i]);
100
                ErrorManager.getDefault().log ("NO Search type for " + docRoots[i]);
101
                continue;
101
                continue;
102
            }
102
            }
103
            FileObject indexFo = st.getDocFileObject( docRoots[i] );
103
            URL indexFo = st.getDocFileObject( docRoots[i] );
104
            if (indexFo == null) {
104
            if (indexFo == null) {
105
                ErrorManager.getDefault().log ("NO Index files fot " + docRoots[i] );
105
                ErrorManager.getDefault().log ("NO Index files fot " + docRoots[i] );
106
                continue;
106
                continue;
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/JavadocSearchType.java (-4 / +4 lines)
Lines 41-53 Link Here
41
41
42
package org.netbeans.modules.javadoc.search;
42
package org.netbeans.modules.javadoc.search;
43
43
44
import java.net.URL;
44
import java.util.LinkedList;
45
import java.util.LinkedList;
45
import java.util.List;
46
import java.util.List;
46
import java.util.StringTokenizer;
47
import java.util.StringTokenizer;
47
import java.util.regex.Matcher;
48
import java.util.regex.Matcher;
48
import java.util.regex.Pattern;
49
import java.util.regex.Pattern;
49
import java.util.regex.PatternSyntaxException;
50
import java.util.regex.PatternSyntaxException;
50
import org.openide.filesystems.FileObject;
51
import org.openide.util.NbBundle;
51
import org.openide.util.NbBundle;
52
import org.openide.ErrorManager;
52
import org.openide.ErrorManager;
53
53
Lines 64-70 Link Here
64
     * @return File object containing index-files e.g index-files directory
64
     * @return File object containing index-files e.g index-files directory
65
     *         or index-all.html.
65
     *         or index-all.html.
66
     */
66
     */
67
    public abstract FileObject getDocFileObject( FileObject apidocRoot );
67
    public abstract URL getDocFileObject(URL apidocRoot);
68
    
68
    
69
    private Pattern[]  overviewLabelFilters;
69
    private Pattern[]  overviewLabelFilters;
70
70
Lines 114-120 Link Here
114
     * @param diiConsumer consumer for parse events
114
     * @param diiConsumer consumer for parse events
115
     * @return IndexSearchThread
115
     * @return IndexSearchThread
116
     */    
116
     */    
117
    public abstract IndexSearchThread getSearchThread( String toFind, FileObject fo, IndexSearchThread.DocIndexItemConsumer diiConsumer );
117
    public abstract IndexSearchThread getSearchThread(String toFind, URL fo, IndexSearchThread.DocIndexItemConsumer diiConsumer);
118
    
118
    
119
119
120
    /**
120
    /**
Lines 122-127 Link Here
122
     * @param apidocRoot root of the javadoc
122
     * @param apidocRoot root of the javadoc
123
     * @param encoding of the javadoc, may be null if the javadoc has no encoding
123
     * @param encoding of the javadoc, may be null if the javadoc has no encoding
124
     */
124
     */
125
    public abstract boolean accepts (FileObject apidocRoot, String encoding);
125
    public abstract boolean accepts(URL apidocRoot, String encoding);
126
126
127
}
127
}
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/Jdk12SearchType.java (-15 / +12 lines)
Lines 41-47 Link Here
41
41
42
package org.netbeans.modules.javadoc.search;
42
package org.netbeans.modules.javadoc.search;
43
43
44
import org.openide.filesystems.FileObject;
44
import java.net.MalformedURLException;
45
import java.net.URL;
46
import org.openide.util.Exceptions;
45
import org.openide.util.lookup.ServiceProvider;
47
import org.openide.util.lookup.ServiceProvider;
46
48
47
/* Base class providing search for JDK1.2/1.3 documentation
49
/* Base class providing search for JDK1.2/1.3 documentation
Lines 72-90 Link Here
72
//        this.firePropertyChange("caseSensitive", oldVal ? Boolean.TRUE : Boolean.FALSE, caseSensitive ? Boolean.TRUE : Boolean.FALSE);   //NOI18N
74
//        this.firePropertyChange("caseSensitive", oldVal ? Boolean.TRUE : Boolean.FALSE, caseSensitive ? Boolean.TRUE : Boolean.FALSE);   //NOI18N
73
    }
75
    }
74
76
75
    public @Override FileObject getDocFileObject(FileObject apidocRoot) {
77
    public @Override URL getDocFileObject(URL apidocRoot) {
76
    
78
        URL u = URLUtils.findOpenable(apidocRoot, "index-files/index-1.html"); // NOI18N
77
        FileObject fo = apidocRoot.getFileObject( "index-files" ); // NOI18N
79
        try {
78
        if ( fo != null ) {
80
            return u != null ? new URL(apidocRoot, "index-files/") : URLUtils.findOpenable(apidocRoot, "index-all.html"); // NOI18N
79
            return fo;
81
        } catch (MalformedURLException ex) {
82
            Exceptions.printStackTrace(ex);
83
            return null;
80
        }
84
        }
81
82
        fo = apidocRoot.getFileObject( "index-all.html" ); // NOI18N
83
        if ( fo != null ) {
84
            return fo;
85
        }
86
87
        return null;
88
    }    
85
    }    
89
    
86
    
90
    /** Returns Java doc search thread for doument
87
    /** Returns Java doc search thread for doument
Lines 94-105 Link Here
94
     * @return IndexSearchThread
91
     * @return IndexSearchThread
95
     * @see IndexSearchThread
92
     * @see IndexSearchThread
96
     */    
93
     */    
97
    public @Override IndexSearchThread getSearchThread(String toFind, FileObject fo, IndexSearchThread.DocIndexItemConsumer diiConsumer) {
94
    public @Override IndexSearchThread getSearchThread(String toFind, URL fo, IndexSearchThread.DocIndexItemConsumer diiConsumer) {
98
        return new SearchThreadJdk12 ( toFind, fo, diiConsumer, isCaseSensitive() );
95
        return new SearchThreadJdk12 ( toFind, fo, diiConsumer, isCaseSensitive() );
99
    }
96
    }
100
97
101
98
102
    public @Override boolean accepts(FileObject apidocRoot, String encoding) {
99
    public @Override boolean accepts(URL apidocRoot, String encoding) {
103
        //XXX returns always true, must be the last JavadocType
100
        //XXX returns always true, must be the last JavadocType
104
        return true;
101
        return true;
105
    }
102
    }
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/Jdk12SearchType_japan.java (-6 / +5 lines)
Lines 46-53 Link Here
46
import java.io.IOException;
46
import java.io.IOException;
47
import java.io.InputStream;
47
import java.io.InputStream;
48
import java.io.InputStreamReader;
48
import java.io.InputStreamReader;
49
import java.net.URL;
49
import org.openide.util.Exceptions;
50
import org.openide.util.Exceptions;
50
import org.openide.filesystems.FileObject;
51
import org.openide.util.lookup.ServiceProvider;
51
import org.openide.util.lookup.ServiceProvider;
52
52
53
/* Base class providing search for JDK1.2/1.3 documentation
53
/* Base class providing search for JDK1.2/1.3 documentation
Lines 89-101 Link Here
89
     * @see IndexSearchThread
89
     * @see IndexSearchThread
90
     */    
90
     */    
91
    @Override
91
    @Override
92
    public IndexSearchThread getSearchThread( String toFind, FileObject fo, IndexSearchThread.DocIndexItemConsumer diiConsumer ){
92
    public IndexSearchThread getSearchThread(String toFind, URL fo, IndexSearchThread.DocIndexItemConsumer diiConsumer) {
93
        //here you can send one more parameter .. getJapanEncoding
93
        //here you can send one more parameter .. getJapanEncoding
94
        return new SearchThreadJdk12_japan ( toFind, fo, diiConsumer, isCaseSensitive(), getJapanEncoding() );
94
        return new SearchThreadJdk12_japan ( toFind, fo, diiConsumer, isCaseSensitive(), getJapanEncoding() );
95
    }    
95
    }    
96
96
97
    @Override
97
    @Override
98
    public boolean accepts(org.openide.filesystems.FileObject root, String encoding) {
98
    public boolean accepts(URL root, String encoding) {
99
        if (encoding == null) {
99
        if (encoding == null) {
100
            return false;
100
            return false;
101
        }
101
        }
Lines 112-122 Link Here
112
        
112
        
113
        if ("utf-8".equals(encoding)) { // NOI18N
113
        if ("utf-8".equals(encoding)) { // NOI18N
114
            try {
114
            try {
115
                FileObject fo = root.getFileObject("allclasses-frame.html"); // NOI18N
115
                InputStream is = URLUtils.open(root, "allclasses-frame.html"); // NOI18N
116
                if (fo == null) {
116
                if (is == null) {
117
                    return false;
117
                    return false;
118
                }
118
                }
119
                InputStream is = fo.getInputStream();
120
                boolean jazip = false;
119
                boolean jazip = false;
121
                try {
120
                try {
122
                    BufferedReader r = new BufferedReader(new InputStreamReader(is, encoding));
121
                    BufferedReader r = new BufferedReader(new InputStreamReader(is, encoding));
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/ReferencesPanel.java (-9 / +8 lines)
Lines 41-46 Link Here
41
41
42
import java.awt.Dialog;
42
import java.awt.Dialog;
43
import java.awt.EventQueue;
43
import java.awt.EventQueue;
44
import java.net.URL;
44
import java.util.List;
45
import java.util.List;
45
import javax.swing.AbstractButton;
46
import javax.swing.AbstractButton;
46
import javax.swing.JButton;
47
import javax.swing.JButton;
Lines 51-58 Link Here
51
import org.openide.DialogDescriptor;
52
import org.openide.DialogDescriptor;
52
import org.openide.DialogDisplayer;
53
import org.openide.DialogDisplayer;
53
import org.openide.awt.Mnemonics;
54
import org.openide.awt.Mnemonics;
54
import org.openide.filesystems.FileObject;
55
import org.openide.filesystems.FileUtil;
56
import org.openide.util.HelpCtx;
55
import org.openide.util.HelpCtx;
57
import org.openide.util.NbBundle;
56
import org.openide.util.NbBundle;
58
import org.openide.util.RequestProcessor;
57
import org.openide.util.RequestProcessor;
Lines 86-92 Link Here
86
        this.openBtn = openBtn;
85
        this.openBtn = openBtn;
87
    }
86
    }
88
87
89
    public static FileObject showInWindow() {
88
    public static URL showInWindow() {
90
        JButton openBtn = new JButton();
89
        JButton openBtn = new JButton();
91
        Mnemonics.setLocalizedText(openBtn, NbBundle.getMessage(ReferencesPanel.class, "ReferencesPanel.ok.text"));
90
        Mnemonics.setLocalizedText(openBtn, NbBundle.getMessage(ReferencesPanel.class, "ReferencesPanel.ok.text"));
92
        openBtn.getAccessibleContext().setAccessibleDescription(openBtn.getText());
91
        openBtn.getAccessibleContext().setAccessibleDescription(openBtn.getText());
Lines 163-177 Link Here
163
    }
162
    }
164
163
165
    public @Override void valueChanged(ListSelectionEvent e) {
164
    public @Override void valueChanged(ListSelectionEvent e) {
166
        FileObject item = getSelectedItem();
165
        URL item = getSelectedItem();
167
        String s = item == null
166
        String s = item == null
168
                ? EMPTY_LOCATION
167
                ? EMPTY_LOCATION
169
                : FileUtil.getFileDisplayName(item);
168
                : URLUtils.getDisplayName(item);
170
        locationField.setText(s);
169
        locationField.setText(s);
171
        openBtn.setEnabled(item != null);
170
        openBtn.setEnabled(item != null);
172
    }
171
    }
173
172
174
    FileObject getSelectedItem() {
173
    URL getSelectedItem() {
175
        int index = refList.getSelectedIndex();
174
        int index = refList.getSelectedIndex();
176
        synchronized (LOCK) {
175
        synchronized (LOCK) {
177
            return index < 0 || items == null || items.length == 0
176
            return index < 0 || items == null || items.length == 0
Lines 254-269 Link Here
254
        private static ItemDesc NO_ITEM;
253
        private static ItemDesc NO_ITEM;
255
        String name;
254
        String name;
256
        String locationName;
255
        String locationName;
257
        FileObject location;
256
        URL location;
258
257
259
        public ItemDesc(String name, FileObject location) {
258
        public ItemDesc(String name, URL location) {
260
            this.name = name;
259
            this.name = name;
261
            this.location = location;
260
            this.location = location;
262
        }
261
        }
263
262
264
        String getLocationName() {
263
        String getLocationName() {
265
            if (locationName == null) {
264
            if (locationName == null) {
266
                locationName = FileUtil.getFileDisplayName(location);
265
                locationName = URLUtils.getDisplayName(location);
267
            }
266
            }
268
            return locationName;
267
            return locationName;
269
        }
268
        }
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12.java (-22 / +7 lines)
Lines 55-61 Link Here
55
55
56
import org.openide.ErrorManager;
56
import org.openide.ErrorManager;
57
import org.openide.util.NbBundle;
57
import org.openide.util.NbBundle;
58
import org.openide.filesystems.FileObject;
59
58
60
/** This class implements the index search through documenation
59
/** This class implements the index search through documenation
61
 * generated by Jdk 1.2 standard doclet
60
 * generated by Jdk 1.2 standard doclet
Lines 70-86 Link Here
70
69
71
    private boolean splitedIndex = false;
70
    private boolean splitedIndex = false;
72
    private int currentIndexNumber;
71
    private int currentIndexNumber;
73
    private FileObject folder = null;
72
    private URL folder = null;
74
    private final Object LOCK = new Object();
73
    private final Object LOCK = new Object();
75
    
74
    
76
    public SearchThreadJdk12 ( String toFind,
75
    public SearchThreadJdk12 ( String toFind,
77
                               FileObject fo,
76
                               URL fo,
78
                               IndexSearchThread.DocIndexItemConsumer diiConsumer, boolean caseSensitive ) {
77
                               IndexSearchThread.DocIndexItemConsumer diiConsumer, boolean caseSensitive ) {
79
78
80
        super( toFind, fo, diiConsumer, caseSensitive);
79
        super( toFind, fo, diiConsumer, caseSensitive);
81
        //this.caseSensitive = caseSensitive;
80
        //this.caseSensitive = caseSensitive;
82
        
81
        
83
        if ( fo.isFolder() ) {
82
        if (fo.toString().endsWith("/")) {
84
            // Documentation uses splited index - resolve the right file            
83
            // Documentation uses splited index - resolve the right file            
85
            
84
            
86
            // This is just a try in most cases the fileNumber should be
85
            // This is just a try in most cases the fileNumber should be
Lines 106-119 Link Here
106
            splitedIndex = true;
105
            splitedIndex = true;
107
        }
106
        }
108
        else {
107
        else {
109
            try {
108
            contextURL = indexRoot;
110
                contextURL = this.indexRoot.getURL();
111
                //contextURL = this.fo.getParent().getURL();
112
            }
113
            catch ( org.openide.filesystems.FileStateInvalidException e ) {
114
                throw new InternalError( "Can't create documentation folder URL - file state invalid" ); // NOI18N
115
            }
116
            
117
            splitedIndex = false;
109
            splitedIndex = false;
118
        }
110
        }
119
    }
111
    }
Lines 167-173 Link Here
167
                    if (stopSearch) {
159
                    if (stopSearch) {
168
                        break;
160
                        break;
169
                    }
161
                    }
170
                    in = new BufferedReader( new InputStreamReader( indexRoot.getInputStream () ));
162
                    in = new BufferedReader(new InputStreamReader(indexRoot.openStream()));
171
                }
163
                }
172
                pd.parse( in, sc = new SearchCallbackJdk12( splitedIndex, caseSensitive ), true );
164
                pd.parse( in, sc = new SearchCallbackJdk12( splitedIndex, caseSensitive ), true );
173
            }
165
            }
Lines 213-234 Link Here
213
                return;
205
                return;
214
            }
206
            }
215
207
216
            String fileName = "index-" + currentIndexNumber; // NOI18N
217
218
            if ( folder == null ) {
208
            if ( folder == null ) {
219
                indexRoot = null;
209
                indexRoot = null;
220
                return;
210
                return;
221
            }
211
            }
222
212
223
            indexRoot = folder.getFileObject( fileName, "html" ); // NOI18N
213
            indexRoot = URLUtils.findOpenable(folder, "index-" + currentIndexNumber + ".html"); // NOI18N
224
214
225
            if ( indexRoot != null ) {
215
            if ( indexRoot != null ) {
226
                try {
216
                contextURL = indexRoot;
227
                    contextURL = this.indexRoot.getURL();
228
                }
229
                catch ( org.openide.filesystems.FileStateInvalidException e ) {
230
                    throw new InternalError( "Can't create documentation folder URL - file state invalid" ); // NOI18N
231
                }
232
            }
217
            }
233
            else {
218
            else {
234
                
219
                
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12_japan.java (-22 / +7 lines)
Lines 56-62 Link Here
56
56
57
import org.openide.ErrorManager;
57
import org.openide.ErrorManager;
58
import org.openide.util.NbBundle;
58
import org.openide.util.NbBundle;
59
import org.openide.filesystems.FileObject;
60
59
61
/** This class implements the index search through documenation
60
/** This class implements the index search through documenation
62
 * generated by Jdk 1.2 standard doclet
61
 * generated by Jdk 1.2 standard doclet
Lines 71-86 Link Here
71
70
72
    private boolean splitedIndex = false;
71
    private boolean splitedIndex = false;
73
    private int currentIndexNumber;
72
    private int currentIndexNumber;
74
    private FileObject folder = null;
73
    private URL folder = null;
75
    private String JapanEncoding;
74
    private String JapanEncoding;
76
    private final Object LOCK = new Object();
75
    private final Object LOCK = new Object();
77
    
76
    
78
    public SearchThreadJdk12_japan(String toFind, FileObject fo, IndexSearchThread.DocIndexItemConsumer diiConsumer, boolean caseSensitive, String JapanEncoding) {
77
    public SearchThreadJdk12_japan(String toFind, URL fo, IndexSearchThread.DocIndexItemConsumer diiConsumer, boolean caseSensitive, String JapanEncoding) {
79
78
80
        super( toFind, fo, diiConsumer, caseSensitive );        
79
        super( toFind, fo, diiConsumer, caseSensitive );        
81
	this.JapanEncoding = JapanEncoding;
80
	this.JapanEncoding = JapanEncoding;
82
        
81
        
83
        if ( fo.isFolder() ) {
82
        if (fo.toString().endsWith("/")) {
84
            // Documentation uses splited index - resolve the right file
83
            // Documentation uses splited index - resolve the right file
85
            
84
            
86
            
85
            
Lines 107-120 Link Here
107
            splitedIndex = true;
106
            splitedIndex = true;
108
        }
107
        }
109
        else {
108
        else {
110
            try {
109
            contextURL = this.indexRoot;
111
                contextURL = this.indexRoot.getURL();
112
                //contextURL = this.fo.getParent().getURL();
113
            }
114
            catch ( org.openide.filesystems.FileStateInvalidException e ) {
115
                throw new InternalError( "Can't create documentation folder URL - file state invalid" ); // NOI18N
116
            }
117
            
118
            splitedIndex = false;
110
            splitedIndex = false;
119
        }
111
        }
120
    }
112
    }
Lines 168-174 Link Here
168
                    if (stopSearch) {
160
                    if (stopSearch) {
169
                        break;
161
                        break;
170
                    }
162
                    }
171
                    in = new BufferedReader( new InputStreamReader( indexRoot.getInputStream (), JapanEncoding ));        
163
                    in = new BufferedReader(new InputStreamReader(indexRoot.openStream(), JapanEncoding));
172
                }
164
                }
173
		// System.out.println("Encoding: " + JapanEncoding);
165
		// System.out.println("Encoding: " + JapanEncoding);
174
                pd.parse( in, sc = new SearchCallbackJdk12_japan( splitedIndex, caseSensitive ), true );
166
                pd.parse( in, sc = new SearchCallbackJdk12_japan( splitedIndex, caseSensitive ), true );
Lines 213-234 Link Here
213
                return;
205
                return;
214
            }
206
            }
215
207
216
            String fileName = "index-" + currentIndexNumber; // NOI18N
217
218
            if ( folder == null ) {
208
            if ( folder == null ) {
219
                indexRoot = null;
209
                indexRoot = null;
220
                return;
210
                return;
221
            }
211
            }
222
212
223
            indexRoot = folder.getFileObject( fileName, "html" ); // NOI18N
213
            indexRoot = URLUtils.findOpenable(folder, "index-" + currentIndexNumber + ".html"); // NOI18N
224
214
225
            if ( indexRoot != null ) {
215
            if ( indexRoot != null ) {
226
                try {
216
                contextURL = indexRoot;
227
                    contextURL = this.indexRoot.getURL();
228
                }
229
                catch ( org.openide.filesystems.FileStateInvalidException e ) {
230
                    throw new InternalError( "Can't create documentation folder URL - file state invalid" ); // NOI18N
231
                }
232
            }
217
            }
233
            else {
218
            else {
234
                
219
                
(-)a/javadoc/src/org/netbeans/modules/javadoc/search/URLUtils.java (+122 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2010 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.javadoc.search;
41
42
import java.io.IOException;
43
import java.io.InputStream;
44
import java.net.MalformedURLException;
45
import java.net.URL;
46
import java.util.logging.Level;
47
import java.util.logging.Logger;
48
import org.openide.filesystems.FileObject;
49
import org.openide.filesystems.FileUtil;
50
import org.openide.filesystems.URLMapper;
51
52
/**
53
 * Convenience methods for looking up available URLs such as Javadoc HTML pages.
54
 */
55
class URLUtils {
56
57
    private URLUtils() {}
58
59
    private static final Logger LOG = Logger.getLogger(URLUtils.class.getName());
60
61
    /**
62
     * Attempts to {@linkplain URL#openStream open} some URLs in turn.
63
     * If opening a URL fails, it is skipped.
64
     * It is the caller's responsibility to close any non-null result.
65
     * @param base a base URL
66
     * @param specs relative paths
67
     * @return a stream from one of the constructed URLs, or null if none could be opened
68
     */
69
    public static InputStream open(URL base, String... specs) {
70
        for (String spec : specs) {
71
            try {
72
                URL url = new URL(base, spec);
73
                try {
74
                    return url.openStream();
75
                } catch (IOException x) {
76
                    LOG.log(Level.FINE, "Could not open " + url, x);
77
                }
78
            } catch (MalformedURLException x) {
79
                LOG.log(Level.INFO, "Could not construct " + base + spec, x);
80
            }
81
        }
82
        return null;
83
    }
84
85
    /**
86
     * Like {@link #open} but just returns the URL that worked.
87
     * Any opened stream is closed again.
88
     * @param base a base URL
89
     * @param specs relative paths
90
     * @return the constructed URL, or null if none cannot be opened
91
     */
92
    public static URL findOpenable(URL base, String... specs) {
93
        for (String spec : specs) {
94
            try {
95
                URL url = new URL(base, spec);
96
                try {
97
                    url.openStream().close();
98
                    return url;
99
                } catch (IOException x) {
100
                    LOG.log(Level.FINE, "Could not open " + url, x);
101
                } catch (Exception x) {
102
                    LOG.log(Level.INFO, "Could not open " + url, x);
103
                }
104
            } catch (MalformedURLException x) {
105
                LOG.log(Level.INFO, "Could not construct " + base + spec, x);
106
            }
107
        }
108
        return null;
109
    }
110
111
    /**
112
     * Produces a display name appropriate to a URL.
113
     * @param url a URL
114
     * @return some display name, e.g. file path
115
     * @see FileUtil#getFileDisplayName
116
     */
117
    public static String getDisplayName(URL url) {
118
        FileObject fo = URLMapper.findFileObject(url);
119
        return fo != null ? FileUtil.getFileDisplayName(fo) : url.toString();
120
    }
121
122
}
(-)a/javadoc/test/unit/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12Test.java (-27 / +14 lines)
Lines 42-52 Link Here
42
package org.netbeans.modules.javadoc.search;
42
package org.netbeans.modules.javadoc.search;
43
43
44
import java.io.File;
44
import java.io.File;
45
import java.net.URL;
45
import java.util.List;
46
import java.util.List;
46
import java.util.LinkedList;
47
import java.util.LinkedList;
47
import org.netbeans.junit.NbTestCase;
48
import org.netbeans.junit.NbTestCase;
48
import org.openide.filesystems.LocalFileSystem;
49
import org.openide.filesystems.LocalFileSystem;
49
import org.openide.filesystems.FileObject;
50
50
51
/**
51
/**
52
 *
52
 *
Lines 70-77 Link Here
70
    }
70
    }
71
71
72
    public void testSearchInJDK14_Class() throws Exception {
72
    public void testSearchInJDK14_Class() throws Exception {
73
        FileObject idxFolder = fs.findResource(JDK14_INDEX_PATH);
73
        URL idxFolder = fs.findResource(JDK14_INDEX_PATH).getURL();
74
        assertNotNull(idxFolder);
75
        
74
        
76
        String toFind = "DataFlavor";
75
        String toFind = "DataFlavor";
77
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
76
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 97-104 Link Here
97
    }
96
    }
98
    
97
    
99
    public void testSearchInJDK14_Interface() throws Exception {
98
    public void testSearchInJDK14_Interface() throws Exception {
100
        FileObject idxFolder = fs.findResource(JDK14_INDEX_PATH);
99
        URL idxFolder = fs.findResource(JDK14_INDEX_PATH).getURL();
101
        assertNotNull(idxFolder);
102
        
100
        
103
        String toFind = "DatabaseMetaData";
101
        String toFind = "DatabaseMetaData";
104
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
102
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 117-124 Link Here
117
    }
115
    }
118
116
119
    public void testSearchInJDK14_Exception() throws Exception {
117
    public void testSearchInJDK14_Exception() throws Exception {
120
        FileObject idxFolder = fs.findResource(JDK14_INDEX_PATH);
118
        URL idxFolder = fs.findResource(JDK14_INDEX_PATH).getURL();
121
        assertNotNull(idxFolder);
122
        
119
        
123
        String toFind = "DataFormatException";
120
        String toFind = "DataFormatException";
124
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
121
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 145-152 Link Here
145
    }
142
    }
146
143
147
    public void testSearchInJDK14_Method() throws Exception {
144
    public void testSearchInJDK14_Method() throws Exception {
148
        FileObject idxFolder = fs.findResource(JDK14_INDEX_PATH);
145
        URL idxFolder = fs.findResource(JDK14_INDEX_PATH).getURL();
149
        assertNotNull(idxFolder);
150
        
146
        
151
        String toFind = "damageLineRange";
147
        String toFind = "damageLineRange";
152
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
148
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 165-172 Link Here
165
    }
161
    }
166
162
167
    public void testSearchInJDK14_Variables() throws Exception {
163
    public void testSearchInJDK14_Variables() throws Exception {
168
        FileObject idxFolder = fs.findResource(JDK14_INDEX_PATH);
164
        URL idxFolder = fs.findResource(JDK14_INDEX_PATH).getURL();
169
        assertNotNull(idxFolder);
170
        
165
        
171
        String toFind = "darkShadow";
166
        String toFind = "darkShadow";
172
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
167
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 193-200 Link Here
193
    }
188
    }
194
189
195
    public void testSearchInJDK15_Class() throws Exception {
190
    public void testSearchInJDK15_Class() throws Exception {
196
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
191
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
197
        assertNotNull(idxFolder);
198
        
192
        
199
        String toFind = "DataFlavor";
193
        String toFind = "DataFlavor";
200
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
194
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 221-228 Link Here
221
215
222
    public void testSearchInJDK15_GenericClass_54244() throws Exception {
216
    public void testSearchInJDK15_GenericClass_54244() throws Exception {
223
        // see issue #54244
217
        // see issue #54244
224
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
218
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
225
        assertNotNull(idxFolder);
226
        
219
        
227
        String toFind = "DemoHashMap";
220
        String toFind = "DemoHashMap";
228
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
221
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 248-255 Link Here
248
    }
241
    }
249
242
250
    public void testSearchInJDK15_Method() throws Exception {
243
    public void testSearchInJDK15_Method() throws Exception {
251
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
244
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
252
        assertNotNull(idxFolder);
253
        
245
        
254
        String toFind = "damageLineRange";
246
        String toFind = "damageLineRange";
255
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
247
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 268-275 Link Here
268
    }
260
    }
269
261
270
    public void testSearchInJDK15_Variables() throws Exception {
262
    public void testSearchInJDK15_Variables() throws Exception {
271
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
263
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
272
        assertNotNull(idxFolder);
273
        
264
        
274
        String toFind = "darkShadow";
265
        String toFind = "darkShadow";
275
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
266
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 296-303 Link Here
296
    }
287
    }
297
288
298
    public void testSearchInJDK15_Exception() throws Exception {
289
    public void testSearchInJDK15_Exception() throws Exception {
299
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
290
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
300
        assertNotNull(idxFolder);
301
        
291
        
302
        String toFind = "DataFormatException";
292
        String toFind = "DataFormatException";
303
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
293
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 324-331 Link Here
324
    }
314
    }
325
    
315
    
326
    public void testSearchInJDK15_Interface() throws Exception {
316
    public void testSearchInJDK15_Interface() throws Exception {
327
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
317
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
328
        assertNotNull(idxFolder);
329
        
318
        
330
        String toFind = "DatabaseMetaData";
319
        String toFind = "DatabaseMetaData";
331
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
320
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 344-351 Link Here
344
    }
333
    }
345
    
334
    
346
    public void testSearchInJDK15_Enum() throws Exception {
335
    public void testSearchInJDK15_Enum() throws Exception {
347
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
336
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
348
        assertNotNull(idxFolder);
349
        
337
        
350
        String toFind = "DemoMemoryType";
338
        String toFind = "DemoMemoryType";
351
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
339
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
Lines 364-371 Link Here
364
    }
352
    }
365
    
353
    
366
    public void testSearchInJDK15_AnnotationType() throws Exception {
354
    public void testSearchInJDK15_AnnotationType() throws Exception {
367
        FileObject idxFolder = fs.findResource(JDK15_INDEX_PATH);
355
        URL idxFolder = fs.findResource(JDK15_INDEX_PATH).getURL();
368
        assertNotNull(idxFolder);
369
        
356
        
370
        String toFind = "Deprecated";
357
        String toFind = "Deprecated";
371
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();
358
        MyDocIndexItemConsumer diiConsumer = new MyDocIndexItemConsumer();

Return to bug 41443