View Javadoc

1   package org.catacomb.druid.gui.base;
2   
3   
4   import org.catacomb.druid.gui.edit.Effect;
5   import org.catacomb.interlish.structure.Closable;
6   import org.catacomb.report.E;
7   
8   
9   
10  
11  public class DruCloseEffect extends Effect  {
12  
13  
14  
15  
16      public DruCloseEffect(String s) {
17          super(s);
18      }
19  
20  
21  
22      public void apply(boolean b) {
23  
24          Object obj = getTarget();
25          if (obj instanceof Closable) {
26              ((Closable)obj).close();
27  
28  
29          } else {
30              E.warning("non-closable target in close effect " + obj + " " + this);
31          }
32  
33      }
34  
35  
36  
37  }