1 2 package org.catacomb.druid.gui.edit; 3 4 5 6 import org.catacomb.druid.event.LabelActor; 7 import org.catacomb.druid.swing.DTextArea; 8 import org.catacomb.report.E; 9 10 11 public class ExpandingTextAreaController implements LabelActor { 12 13 14 DTextArea dTextArea; 15 16 public ExpandingTextAreaController(DTextArea dta) { 17 dTextArea = dta; 18 } 19 20 21 public void labelAction(String s, boolean b) { 22 if (s.equals("add")) { 23 add(); 24 } else if (s.equals("remove")) { 25 remove(); 26 } else { 27 E.error("cant act on " + s); 28 } 29 } 30 31 public void add() { 32 dTextArea.addLine(); 33 dTextArea.revalidate(); 34 35 } 36 37 public void remove() { 38 dTextArea.removeLine(); 39 dTextArea.revalidate(); 40 } 41 42 43 44 }