예제 #1
0
  public void realizeParent(CompoundCommand tgtCmd) {
    // logger.info("realizeParent: " + this);
    // logger.info(this.getClass().getName() + " .realizeParent() - parent: " + parent
    //        + " / findEditPart(parent): " + findEditPart(parent));

    if (getModel() instanceof DerivedArtifact) return;

    final Artifact parentArt =
        getArtifact().getArt().queryParentArtifact(getBrowseModel().getRepo());
    if (parentArt == null) return;

    final ReloController rc = getRootController();

    ArtifactEditPart parentEP = (ArtifactEditPart) findEditPart(parentArt);
    if (parentEP != null) {
      parentEP.assertParenthood(tgtCmd);
      return;
    }

    if (!rc.artCreatable(parentArt)) return; // check if browse model will allow

    // parentEP = null and it is creatable

    tgtCmd.add(new CreateParentCommand(this, "create parent and assert parenthood", parentArt, rc));
    return;
  }
예제 #2
0
 /** Asserts parenthood for this AEP */
 public void assertParenthood() {
   CompoundCommand cc = new CompoundCommand();
   assertParenthood(cc);
   cc.execute();
 }