public static void createSemanticBranchStyles(View view) {

    org.eclipse.gmf.runtime.notation.EObjectValueStyle semanticbranchStyle =
        NotationFactory.eINSTANCE.createEObjectValueStyle();
    semanticbranchStyle.setName(MultiAssociationHelper.SEMANTIC_BRANCH);
    view.getStyles().add(semanticbranchStyle);
  }
 @Override
 public void undo() {
   EList currentList = (EList) (style.eGet(styleFeature));
   command.undo();
   if (needsCreate) {
     view.getStyles().remove(style);
   }
 }
  public void execute() {
    // FIXME: Related to CompoundCommand vs StrictCompoundCommand.
    // Sometimes, canExecute() is not called, and the command is not prepared
    if (!isPrepared) {
      prepare();
      isPrepared = true;
    }

    if (needsCreate) {
      view.getStyles().add(style);
    }
    command.execute();
  }
Пример #4
0
  protected Map<Declaration, Boolean> handleStyles(View view) {
    Map<Declaration, Boolean> declarations = new LinkedHashMap<Declaration, Boolean>();

    for (Object styleObject : view.getStyles()) {
      Style style = (Style) styleObject;
      declarations.putAll(handleStyle(style));
    }

    if (view instanceof Style) {
      declarations.putAll(handleStyle((Style) view));
    }

    if (view instanceof CustomStyle) {
      declarations.putAll(handleCustomStyle((CustomStyle) view, view));
    }

    return declarations;
  }