Exemplo n.º 1
0
  public void setDirty(boolean value) {
    modified = value;
    for (LeafListener<DataItem> l : listeners) {
      l.leafStateChanged(this);
    }

    if (modified && parent != null && !parent.isDirty()) ((Folder) parent).setDirty();
  }
Exemplo n.º 2
0
  @Override
  public void setParent(Branch<DataItem> parent, boolean addToParent) {
    if (this.parent == parent) return;

    if (this.parent != null) this.parent.removeItem(this);

    this.parent = parent;
    if (addToParent) parent.addItem(this);

    setDirty();
  }
Exemplo n.º 3
0
  @Override
  public void setName(String name) {
    if (this.name != name) {
      String oldName = this.name;
      this.name = name;
      for (LeafListener<DataItem> l : listeners) {
        l.leafNameChanged(this, oldName);
      }

      if (parent != null) parent.registerNameChange(oldName, name);

      setDirty();
    }
  }