1 32 33 package it.businesslogic.ireport.gui.sheet; 34 35 import it.businesslogic.ireport.ExpressionContext; 36 import javax.swing.*; 37 38 public class PatternSheetProperty extends SheetProperty { 39 40 private PatternSheetPropertyComponent editor = null; 41 42 public PatternSheetProperty(String key, String name) { 43 super( key, name, SheetProperty.STRING, ""); 44 } 45 46 public JComponent getEditor() 47 { 48 if (editor != null) return editor; 49 editor = new PatternSheetPropertyComponent(); 50 editor.addActionListener( this ); 51 return editor; 52 } 53 54 public Object getEditorValue(JComponent component) 55 { 56 return editor.getExpression(); 57 } 58 59 public void setEditorValue(JComponent component, Object str) 60 { 61 try { 62 getEditor(); 64 if (str != null) 65 { 66 editor.setExpression(""+str); 67 } 68 else 69 { 70 editor.setExpression(""); 71 } 72 } catch (Exception ex) {} 73 } 74 } 75 | Popular Tags |