1 32 33 package it.businesslogic.ireport.gui.library; 34 import it.businesslogic.ireport.gui.*; 35 import it.businesslogic.ireport.*; 36 40 abstract public class AbstractLibraryObject { 41 42 private static javax.swing.ImageIcon defaultIcon; 43 44 static { 45 46 defaultIcon = new javax.swing.ImageIcon (AbstractLibraryObject.class.getResource("/it/businesslogic/ireport/icons/library/default.png")); 47 } 48 49 50 51 public AbstractLibraryObject() { 52 } 53 54 protected JReportFrame getReportFrame() 55 { 56 MainFrame mf = MainFrame.getMainInstance(); 57 return mf.getActiveReportFrame(); 58 } 59 60 protected Report getReport() 61 { 62 return getReportFrame().getReport(); 63 } 64 65 protected void updateAllUI() 66 { 67 MainFrame mf = MainFrame.getMainInstance(); 68 mf.setActiveReportForm( mf.getActiveReportFrame() ); 69 } 70 71 protected void addVariable(JRVariable variable) 72 { 73 getReport().addVariable(variable); 74 } 75 76 protected void addParameter(JRVariable variable) 77 { 78 getReport().addVariable(variable); 79 80 } 81 82 protected void addField(JRVariable variable) 83 { 84 getReport().addVariable(variable); 85 } 86 87 public abstract void drop(java.awt.dnd.DropTargetDropEvent dtde); 88 89 public javax.swing.ImageIcon getIcon() 90 { 91 return defaultIcon; 92 } 93 94 public abstract String getName(); 95 96 public String toString() 97 { 98 return getName(); 99 } 100 } 101 | Popular Tags |