1 19 package org.openide.text; 20 21 22 import java.awt.Image ; 23 import java.beans.*; 24 import org.openide.util.*; 25 26 27 31 public class PrintSettingsBeanInfo extends SimpleBeanInfo { 32 33 public Image getIcon(int type) { 34 return Utilities.loadImage("org/openide/text/printSettings.gif"); } 36 37 40 public PropertyDescriptor[] getPropertyDescriptors() { 41 try { 42 PropertyDescriptor[] desc = new PropertyDescriptor[] { 43 new PropertyDescriptor(PrintSettings.PROP_WRAP, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_HEADER_FORMAT, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_FOOTER_FORMAT, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_HEADER_FONT, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_FOOTER_FONT, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_HEADER_ALIGNMENT, PrintSettings.class), new PropertyDescriptor(PrintSettings.PROP_FOOTER_ALIGNMENT, PrintSettings.class), 51 new PropertyDescriptor(PrintSettings.PROP_LINE_ASCENT_CORRECTION, PrintSettings.class) }; 54 desc[0].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_WRAP")); 55 desc[0].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_WRAP")); 56 desc[1].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_HEADER_FORMAT")); 57 desc[1].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_HEADER_FORMAT")); 58 desc[2].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_FOOTER_FORMAT")); 59 desc[2].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_FOOTER_FORMAT")); 60 desc[3].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_HEADER_FONT")); 61 desc[3].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_HEADER_FONT")); 62 desc[4].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_FOOTER_FONT")); 63 desc[4].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_FOOTER_FONT")); 64 desc[5].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_HEADER_ALIGNMENT")); 65 desc[5].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_HEADER_ALIGNMENT")); 66 desc[5].setPropertyEditorClass(PrintSettings.AlignmentEditor.class); 67 desc[6].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_FOOTER_ALIGNMENT")); 68 desc[6].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_FOOTER_ALIGNMENT")); 69 desc[6].setPropertyEditorClass(PrintSettings.AlignmentEditor.class); 70 71 76 desc[7].setDisplayName(NbBundle.getMessage(PrintSettings.class, "PROP_LINE_ASCENT_CORRECTION")); 77 desc[7].setShortDescription(NbBundle.getMessage(PrintSettings.class, "HINT_LINE_ASCENT_CORRECTION")); 78 79 return desc; 80 } catch (IntrospectionException ex) { 81 Exceptions.printStackTrace(ex); 82 83 return null; 84 } 85 } 86 } 87 | Popular Tags |