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 |
} |