Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/bdgp/apps/dagedit/gui/event/TextEditorUpdateEvent.java


1   package org.bdgp.apps.dagedit.gui.event;
2   
3   import java.util.*;
4   import org.bdgp.apps.dagedit.datamodel.*;
5   
6   /**
7    * An update to the text editor. This kind of event is intended for use
8    * with plugins that fetch some additional information about a term and
9    * give the option to fill in the text editor with that info (the change
10   * is not committed until the commit button is clicked).
11   *
12   * This event will eventually allow every aspect of a the text editor to
13   * be updated. For now, only the definition can be updated. This class
14   * has been constructed in such a way that older code will not be broken
15   * as this class grows.
16   *
17   * Fields that are set to null are ignored, NOT reset. To reset a value,
18   * set it to an empty value, such as "" or an empty vector.
19   */
20  
21  public class TextEditorUpdateEvent extends EventObject {
22  
23      protected String newDefinition = null;
24      protected Vector dbxrefChanges;
25  
26      public TextEditorUpdateEvent(Object source) {
27    super(source);
28      }
29  
30      public static class DbxrefUpdate {
31    protected boolean isAdd;
32    protected boolean isDelete;
33    protected Dbxref oldDbxref;
34    protected Dbxref newDbxref;
35  
36    public DbxrefUpdate(Dbxref newDbxref, Dbxref oldDbxref,
37            boolean isAdd, boolean isDelete) {
38        this.isAdd = isAdd;
39        this.isDelete = isDelete;
40        this.newDbxref = newDbxref;
41        this.oldDbxref = oldDbxref;
42    }
43  
44    public Dbxref getOldDbxref() {
45        return oldDbxref;
46    }
47  
48    public Dbxref getNewDbxref() {
49        return newDbxref;
50    }
51  
52    public boolean isAdd() {
53        return isAdd;
54    }
55  
56    public boolean isDelete() {
57        return isDelete;
58    }
59      }
60  
61      public void setDbxrefUpdates(Vector in) {
62    dbxrefChanges = in;
63      }
64  
65      public Vector getDbxrefUpdates() {
66    return dbxrefChanges;
67      }
68  
69      public void setNewDefinition(String newDefinition) {
70    this.newDefinition = newDefinition;
71      }
72  
73      public String getNewDefinition() {
74    return newDefinition;
75      }
76  }
77  
78  
79  
80