1 package thinlet.drafts; 2 3 import thinlet.*; 4 import java.io.*; 5 6 9 public class Widgets { 10 11 public void perform() { } 12 public void ok() { } 13 public void cancel() { } 14 public void cut() { } 15 public void copy() { } 16 public void paste() { } 17 public void delete() { } 18 19 public void loadText(Thinlet thinlet, Object textarea) throws Exception { 20 StringBuffer helpText = new StringBuffer (); 21 BufferedReader reader = new BufferedReader( 22 new FileReader(new File("src/thinlet/drafts/Widgets.java"))); 23 String line = null; 24 while ((line = reader.readLine()) != null) { 25 helpText.append(line + "\n"); 26 } 27 thinlet.setString(textarea, "text", helpText.toString()); 28 } 29 30 public void setLine(Thinlet thinlet, Object component, boolean line) { 31 thinlet.setBoolean(component, "line", line); 32 } 33 34 public void showDialog(Thinlet thinlet) throws Exception { 35 Object dialog = Thinlet.create("dialog"); 36 thinlet.setString(dialog, "text", "Dialog"); 37 thinlet.setBoolean(dialog, "scrollable", true); 38 thinlet.setInteger(dialog, "width", 180); thinlet.setInteger(dialog, "height", 180); 39 thinlet.add(dialog, thinlet.parse("/thinlet/drafts/widgets.xml", this)); 40 thinlet.add(dialog); 41 } 42 } | Popular Tags |