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

(-)manifest.mf (-1 / +3 lines)
Lines 5-11 Link Here
5
OpenIDE-Module-Install: org/netbeans/modules/utilities/Installer.class
5
OpenIDE-Module-Install: org/netbeans/modules/utilities/Installer.class
6
OpenIDE-Module-Layer: org/netbeans/modules/utilities/Layer.xml
6
OpenIDE-Module-Layer: org/netbeans/modules/utilities/Layer.xml
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.23
7
OpenIDE-Module-IDE-Dependencies: IDE/1 > 2.23
8
OpenIDE-Module-Module-Dependencies: org.openidex.util/2
8
OpenIDE-Module-Module-Dependencies: 
9
 org.openidex.util/2,
10
 org.netbeans.modules.settings/1 > 1.0
9
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
11
OpenIDE-Module-Package-Dependencies: org.apache.regexp[RE]
10
Main-Class: org.netbeans.modules.openfile.Main
12
Main-Class: org.netbeans.modules.openfile.Main
11
13
(-)src/org/netbeans/modules/pdf/Bundle.properties (-4 / +1 lines)
Lines 12-20 Link Here
12
# PDFDataLoader
12
# PDFDataLoader
13
LBL_loaderName=PDF Document Objects
13
LBL_loaderName=PDF Document Objects
14
14
15
# PDFSettings
16
LBL_settings=PDF Settings
17
18
# PDFSettingsBeanInfo
15
# PDFSettingsBeanInfo
19
PROP_pdfviewer=Path to PDF Viewer
16
PROP_pdfviewer=Path to PDF Viewer
20
HINT_pdfviewer=Should be an executable path to the PDF viewer you wish to use.
17
HINT_pdfviewer=Should be an executable path to the PDF viewer you wish to use.
Lines 39-42 Link Here
39
ACS_LBL_choose=N/A
36
ACS_LBL_choose=N/A
40
37
41
# filenames
38
# filenames
42
Services/org-netbeans-modules-pdf-PDFSettings.settings=PDF Settings
39
Services/org-netbeans-modules-pdf-Settings.settings=PDF Settings
(-)src/org/netbeans/modules/pdf/PDF.settings (-8 / +8 lines)
Lines 1-9 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0"?>
2
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
2
3
<settings version="1.0">
3
<!DOCTYPE settings PUBLIC
4
    <module name="org.netbeans.modules.utilities"/>
4
    "-//NetBeans org.netbeans.modules.pdf//DTD XML PDFSettings 1.0//EN"
5
    <instanceof class="org.openide.util.SharedClassObject"/>
5
    "http://www.netbeans.org/dtds/properties-1_0.dtd">
6
    <instanceof class="org.openide.options.SystemOption"/>
6
7
    <instanceof class="org.netbeans.modules.pdf.PDFSettings"/>
7
<properties>
8
    <instance class="org.netbeans.modules.pdf.PDFSettings"/>
8
    <property name="PDFViewer" value="acroread"/>
9
</settings>
9
</properties>
(-)src/org/netbeans/modules/pdf/PDFOpenSupport.java (-1 / +1 lines)
Lines 41-47 Link Here
41
    }
41
    }
42
    
42
    
43
    public void open () {
43
    public void open () {
44
        PDFSettings sett = PDFSettings.getDefault ();
44
        Settings sett = Settings.getDefault ();
45
        try {
45
        try {
46
            Process p = Runtime.getRuntime ().exec (new String[] {
46
            Process p = Runtime.getRuntime ().exec (new String[] {
47
                sett.getPDFViewer ().getAbsolutePath (), f.getAbsolutePath ()
47
                sett.getPDFViewer ().getAbsolutePath (), f.getAbsolutePath ()
(-)src/org/netbeans/modules/pdf/PDFSettings.java (-20 / +5 lines)
Lines 16-26 Link Here
16
import java.io.File;
16
import java.io.File;
17
17
18
import org.openide.options.SystemOption;
18
import org.openide.options.SystemOption;
19
import org.openide.util.HelpCtx;
20
import org.openide.util.NbBundle;
21
19
22
/** PDF viewing options.
20
/**
23
 * @author Jesse Glick
21
 * @deprecated Old settings class, use <code>Settings</code> class instead.
24
 */
22
 */
25
public class PDFSettings extends SystemOption {
23
public class PDFSettings extends SystemOption {
26
24
Lines 28-52 Link Here
28
26
29
    private static final long serialVersionUID = -4792208769849769376L;
27
    private static final long serialVersionUID = -4792208769849769376L;
30
    
28
    
31
    protected void initialize () {
29
    /** */
32
        super.initialize();
33
34
        setPDFViewer (new File ("acroread")); // NOI18N
35
    }
36
37
    public String displayName () {
30
    public String displayName () {
38
        return NbBundle.getMessage (PDFSettings.class, "LBL_settings");
31
        return "Old PDF Settings"; //NOI18N
39
    }
40
41
    public HelpCtx getHelpCtx () {
42
        return new HelpCtx (PDFSettings.class);
43
    }
44
45
    public static PDFSettings getDefault () {
46
        return (PDFSettings) findObject (PDFSettings.class, true);
47
    }
32
    }
48
33
49
    public File getPDFViewer () {
34
    private File getPDFViewer () {
50
        return (File) getProperty (PROP_PDF_VIEWER);
35
        return (File) getProperty (PROP_PDF_VIEWER);
51
    }
36
    }
52
37
(-)src/org/netbeans/modules/pdf/PDFSettingsBeanInfo.java (-76 lines)
Removed Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
15
package org.netbeans.modules.pdf;
16
17
18
import java.awt.Image;
19
import java.beans.BeanInfo;
20
import java.beans.BeanDescriptor;
21
import java.beans.IntrospectionException;
22
import java.beans.PropertyDescriptor;
23
import java.beans.SimpleBeanInfo;
24
25
import org.openide.TopManager;
26
import org.openide.util.NbBundle;
27
import org.openide.util.Utilities;
28
29
30
/** BeanInfo for PDF viewer settings.
31
 *
32
 * @author Jesse Glick
33
 */
34
public class PDFSettingsBeanInfo extends SimpleBeanInfo {
35
36
    /** Gets property descriptors. */
37
    public PropertyDescriptor[] getPropertyDescriptors () {
38
        try {
39
            PropertyDescriptor pdfviewer = new PropertyDescriptor ("PDFViewer", PDFSettings.class);
40
            pdfviewer.setDisplayName (NbBundle.getMessage (PDFSettingsBeanInfo.class, "PROP_pdfviewer"));
41
            pdfviewer.setShortDescription (NbBundle.getMessage (PDFSettingsBeanInfo.class, "HINT_pdfviewer"));
42
            return new PropertyDescriptor[] { pdfviewer };
43
        } catch (IntrospectionException ie) {
44
            TopManager.getDefault().getErrorManager().notify(ie);
45
            
46
            return null;
47
        }
48
    }
49
    
50
    /** Gets the bean descriptor, hiding it.
51
     * Users probably do not want to change this setting
52
     * except once, which is why they are prompted to set it
53
     * if their current setting does not work. 
54
     *
55
     * <em>Note:</em> The above is changed now due to bug #12015, 
56
     * maybe that's not the right way since there 
57
     * is a need to have less options than now.
58
     *
59
     * @return descriptor
60
     */    
61
    public BeanDescriptor getBeanDescriptor () {
62
        BeanDescriptor desc = new BeanDescriptor (PDFSettings.class);
63
64
        return desc;
65
    }
66
67
    /** Gets icon. */
68
    public Image getIcon (int type) {
69
        if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
70
            return Utilities.loadImage("org/netbeans/modules/pdf/PDFDataIcon.gif"); // NOI18N
71
        } else {
72
            return Utilities.loadImage("org/netbeans/modules/pdf/PDFDataIcon32.gif"); // NOI18N
73
        }
74
    }
75
76
}
(-)src/org/netbeans/modules/pdf/ReconfigureReaderPanel.java (-2 / +2 lines)
Lines 26-38 Link Here
26
public class ReconfigureReaderPanel extends javax.swing.JPanel {
26
public class ReconfigureReaderPanel extends javax.swing.JPanel {
27
27
28
    private String exceptionType, exceptionMessage;
28
    private String exceptionType, exceptionMessage;
29
    private PDFSettings settings;
29
    private Settings settings;
30
    private ResourceBundle bundle = NbBundle.getBundle (ReconfigureReaderPanel.class);
30
    private ResourceBundle bundle = NbBundle.getBundle (ReconfigureReaderPanel.class);
31
    
31
    
32
    public ReconfigureReaderPanel (String exceptionType, String exceptionMessage) {
32
    public ReconfigureReaderPanel (String exceptionType, String exceptionMessage) {
33
        this.exceptionType = exceptionType;
33
        this.exceptionType = exceptionType;
34
        this.exceptionMessage = exceptionMessage;
34
        this.exceptionMessage = exceptionMessage;
35
        settings = PDFSettings.getDefault ();
35
        settings = Settings.getDefault ();
36
        initComponents ();
36
        initComponents ();
37
        initAccessibility ();            
37
        initAccessibility ();            
38
    }
38
    }
(-)src/org/netbeans/modules/pdf/Settings.java (+72 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
package org.netbeans.modules.pdf;
14
15
import java.io.File;
16
import java.util.Properties;
17
import java.beans.PropertyChangeSupport;
18
import java.beans.PropertyChangeListener;
19
20
import org.openide.util.Lookup;
21
22
23
/** New PDF settings.
24
 *
25
 * @author Libor Kramolis
26
 */
27
public class Settings {
28
    public static final String PROP_PDF_VIEWER = "PDFViewer"; // NOI18N
29
    private File viewer = new File ("acroread");
30
    private PropertyChangeSupport supp = new PropertyChangeSupport (this);
31
32
33
    public static Settings getDefault () {
34
        return (Settings) Lookup.getDefault().lookup (Settings.class);
35
    }
36
37
38
    public File getPDFViewer () {
39
        return viewer;
40
    }
41
42
    public void setPDFViewer (File viewer) {
43
        File old = this.viewer;
44
        this.viewer = viewer;
45
        supp.firePropertyChange (PROP_PDF_VIEWER, old, viewer);
46
    }
47
48
49
    /**
50
     * @see http://www.netbeans.org/download/dev/javadoc/SettingsAPIs/org/netbeans/spi/settings/doc-files/api.html#xmlprops
51
     */
52
    private void readProperties (Properties p) {
53
        viewer = new File (p.getProperty (PROP_PDF_VIEWER, viewer.toString()));
54
    }
55
56
    /**
57
     * @see http://www.netbeans.org/download/dev/javadoc/SettingsAPIs/org/netbeans/spi/settings/doc-files/api.html#xmlprops
58
     */
59
    private void writeProperties (Properties p) {
60
        p.setProperty (PROP_PDF_VIEWER, viewer.toString());
61
    }
62
63
64
    public void addPropertyChangeListener (PropertyChangeListener l) {
65
        supp.addPropertyChangeListener (l);
66
    }
67
68
    public void removePropertyChangeListener (PropertyChangeListener l) {
69
        supp.removePropertyChangeListener (l);
70
    }
71
72
}
(-)src/org/netbeans/modules/pdf/SettingsBeanInfo.java (+76 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 * 
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 * 
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
15
package org.netbeans.modules.pdf;
16
17
18
import java.awt.Image;
19
import java.beans.BeanInfo;
20
import java.beans.BeanDescriptor;
21
import java.beans.IntrospectionException;
22
import java.beans.PropertyDescriptor;
23
import java.beans.SimpleBeanInfo;
24
25
import org.openide.TopManager;
26
import org.openide.util.NbBundle;
27
import org.openide.util.Utilities;
28
29
30
/** BeanInfo for PDF viewer settings.
31
 *
32
 * @author Jesse Glick
33
 */
34
public class SettingsBeanInfo extends SimpleBeanInfo {
35
36
    /** Gets property descriptors. */
37
    public PropertyDescriptor[] getPropertyDescriptors () {
38
        try {
39
            PropertyDescriptor pdfviewer = new PropertyDescriptor ("PDFViewer", Settings.class);
40
            pdfviewer.setDisplayName (NbBundle.getMessage (SettingsBeanInfo.class, "PROP_pdfviewer"));
41
            pdfviewer.setShortDescription (NbBundle.getMessage (SettingsBeanInfo.class, "HINT_pdfviewer"));
42
            return new PropertyDescriptor[] { pdfviewer };
43
        } catch (IntrospectionException ie) {
44
            TopManager.getDefault().getErrorManager().notify(ie);
45
            
46
            return null;
47
        }
48
    }
49
    
50
    /** Gets the bean descriptor, hiding it.
51
     * Users probably do not want to change this setting
52
     * except once, which is why they are prompted to set it
53
     * if their current setting does not work. 
54
     *
55
     * <em>Note:</em> The above is changed now due to bug #12015, 
56
     * maybe that's not the right way since there 
57
     * is a need to have less options than now.
58
     *
59
     * @return descriptor
60
     */    
61
    public BeanDescriptor getBeanDescriptor () {
62
        BeanDescriptor desc = new BeanDescriptor (Settings.class);
63
64
        return desc;
65
    }
66
67
    /** Gets icon. */
68
    public Image getIcon (int type) {
69
        if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
70
            return Utilities.loadImage("org/netbeans/modules/pdf/PDFDataIcon.gif"); // NOI18N
71
        } else {
72
            return Utilities.loadImage("org/netbeans/modules/pdf/PDFDataIcon32.gif"); // NOI18N
73
        }
74
    }
75
76
}
(-)src/org/netbeans/modules/utilities/Layer.xml (-10 / +46 lines)
Lines 161-175 Link Here
161
                <!-- public ID for pdf link xml -->
161
                <!-- public ID for pdf link xml -->
162
                <file name="DTD_PDF_Document_Menu_Link_1_0" url="nbrescurr:/org/netbeans/modules/pdf/pdf_link.dtd"/>
162
                <file name="DTD_PDF_Document_Menu_Link_1_0" url="nbrescurr:/org/netbeans/modules/pdf/pdf_link.dtd"/>
163
            </folder>
163
            </folder>
164
        </folder>
164
165
            <folder name="NetBeans_org_netbeans_modules_pdf">
166
                <file name="DTD_XML_PDFSettings_1_0"
167
                      url="nbresboot:/org/netbeans/modules/settings/resources/properties-1_0.dtd">
168
                    <attr name="hint.originalPublicID"
169
                          stringvalue="-//NetBeans org.netbeans.modules.pdf//DTD XML PDFSettings 1.0//EN"/>
170
                </file>
171
            </folder> <!-- NetBeans_org_netbeans_modules_pdf -->
172
173
        </folder> <!-- entities -->
174
165
        <folder name="lookups">
175
        <folder name="lookups">
166
          <folder name="NetBeans">
176
            <folder name="NetBeans">
167
               <!-- public ID for pdf link xml -->
177
                <!-- public ID for pdf link xml -->
168
               <file name="DTD_PDF_Document_Menu_Link_1_0.instance">
178
                <file name="DTD_PDF_Document_Menu_Link_1_0.instance">
169
                    <attr name="instanceCreate" newvalue="org.netbeans.modules.pdf.LinkProcessor" />
179
                    <attr name="instanceCreate" newvalue="org.netbeans.modules.pdf.LinkProcessor" />
170
               </file>
180
                </file>
171
          </folder>
181
            </folder>
172
        </folder>
182
183
            <folder name="NetBeans_org_netbeans_modules_pdf">
184
                <file name="DTD_XML_PDFSettings_1_0.instance">
185
                    <attr name="instanceCreate"         methodvalue="org.netbeans.api.settings.Factory.create"/>
186
                    <attr name="settings.convertor"     methodvalue="org.netbeans.api.settings.Factory.properties"/>
187
                    <attr name="settings.instanceClass" stringvalue="org.netbeans.modules.pdf.Settings"/>
188
                    <attr name="settings.instanceOf"    stringvalue="org.netbeans.modules.pdf.Settings"/>
189
                </file>
190
            </folder> <!-- NetBeans_org_netbeans_modules_pdf -->
191
192
        </folder> <!-- lookups -->
193
194
        <folder name="memory">
195
            <folder name="org">
196
                <folder name="netbeans">
197
                    <folder name="modules">
198
                        <folder name="pdf">
199
                            <file name="Settings">
200
                                <attr name="settings.providerPath"
201
                                      stringvalue="xml/lookups/NetBeans_org_netbeans_modules_pdf/DTD_XML_PDFSettings_1_0.instance"/>
202
                            </file>
203
                        </folder>
204
                    </folder>
205
                </folder>
206
            </folder>
207
        </folder> <!-- memory -->
173
    </folder>
208
    </folder>
174
    
209
    
175
    <folder name="Services">
210
    <folder name="Services">
Lines 180-189 Link Here
180
            <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/modules/openfile/openFile.gif"/>
215
            <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/modules/openfile/openFile.gif"/>
181
        </file>
216
        </file>
182
        <!-- PDF Settings -->
217
        <!-- PDF Settings -->
183
        <file name="org-netbeans-modules-pdf-PDFSettings.settings" url="../pdf/PDF.settings">
218
        <file name="org-netbeans-modules-pdf-Settings.settings" url="../pdf/PDF.settings">
184
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.pdf.Bundle"/>
219
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.pdf.Bundle"/>
185
            <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/modules/pdf/PDFDataIcon.gif"/>
220
            <attr name="SystemFileSystem.icon" urlvalue="nbres:/org/netbeans/modules/pdf/PDFDataIcon.gif"/>
186
        </file>
221
        </file>
222
187
        <!-- Bookmarks Node -->
223
        <!-- Bookmarks Node -->
188
        <file name="org-netbeans-modules-url-BookmarksNode.instance">
224
        <file name="org-netbeans-modules-url-BookmarksNode.instance">
189
            <attr name="instanceClass" stringvalue="org.netbeans.modules.url.BookmarksNode" />
225
            <attr name="instanceClass" stringvalue="org.netbeans.modules.url.BookmarksNode" />
Lines 235-242 Link Here
235
                    <file name="org-netbeans-modules-openfile-Settings.shadow">
271
                    <file name="org-netbeans-modules-openfile-Settings.shadow">
236
                        <attr name="originalFile" stringvalue="Services/org-netbeans-modules-openfile-Settings.settings"/>
272
                        <attr name="originalFile" stringvalue="Services/org-netbeans-modules-openfile-Settings.settings"/>
237
                    </file>
273
                    </file>
238
                    <file name="org-netbeans-modules-pdf-PDFSettings.shadow">
274
                    <file name="org-netbeans-modules-pdf-Settings.shadow">
239
                        <attr name="originalFile" stringvalue="Services/org-netbeans-modules-pdf-PDFSettings.settings"/>
275
                        <attr name="originalFile" stringvalue="Services/org-netbeans-modules-pdf-Settings.settings"/>
240
                    </file>
276
                    </file>
241
                </folder>
277
                </folder>
242
                <folder name="System">
278
                <folder name="System">

Return to bug 27584