Package eu.admire.workbench.pd.packages.diagram.edit.parts

Examples of eu.admire.workbench.pd.packages.diagram.edit.parts.LocalVariableEditPart


  public void run(IAction action) {

    StructuredSelection ss = (StructuredSelection) iSelection;

    LocalVariableEditPart editPart = (LocalVariableEditPart) ss
        .getFirstElement();

    org.eclipse.emf.common.command.Command cmd = null;

    EObject eObj = editPart.resolveSemanticElement();

    if (eObj instanceof LocalVariable) {

      LocalVariable lv = (LocalVariable) editPart
          .resolveSemanticElement();

      PrimitiveTypeReference ptr = ReferencesFactory.eINSTANCE
          .createPrimitiveTypeReference();

      if (action.getId().contains("AnyTypeID"))
        ptr.setPrimitiveType(TypesFactory.eINSTANCE.createAny());
      if (action.getId().contains("StringTypeID"))
        ptr.setPrimitiveType(TypesFactory.eINSTANCE.createString());
      if (action.getId().contains("BooleanTypeID"))
        ptr.setPrimitiveType(TypesFactory.eINSTANCE.createBoolean());
      if (action.getId().contains("IntegerTypeID"))
        ptr.setPrimitiveType(TypesFactory.eINSTANCE.createInteger());
      if (action.getId().contains("RealTypeID"))
        ptr.setPrimitiveType(TypesFactory.eINSTANCE.createReal());

      cmd = SetCommand.create(
          editPart.getEditingDomain(),
          eObj,
          (EStructuralFeature) eObj.eClass().getEStructuralFeature(
              "typeReference"), ptr);

      editPart.getEditingDomain().getCommandStack().execute(cmd);

    }

  }
View Full Code Here


    iSelection = selection;

    StructuredSelection ss = (StructuredSelection) iSelection;

    LocalVariableEditPart editPart = (LocalVariableEditPart) ss
        .getFirstElement();

    if (editPart != null) {

      EObject eObj = editPart.resolveSemanticElement();

      // System.out.println("A " + action.getId() + "  " +
      // action.isChecked());

      action.setChecked(false);

      if (eObj instanceof LocalVariable) {

        LocalVariable lv = (LocalVariable) editPart
            .resolveSemanticElement();

        if (lv.getTypeReference() instanceof PrimitiveTypeReference) {

          PrimitiveTypeReference ptr = (PrimitiveTypeReference) lv
View Full Code Here

TOP

Related Classes of eu.admire.workbench.pd.packages.diagram.edit.parts.LocalVariableEditPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.