Package eu.admire.dispel.containers

Examples of eu.admire.dispel.containers.CompilationUnit


   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    Package newElement = ContainersFactory.eINSTANCE.createPackage();

    CompilationUnit owner = (CompilationUnit) getElementToEdit();
    owner.getPackages().add(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
View Full Code Here


        if (result == null) result = caseCommentable(dispelRoot);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ContainersPackage.COMPILATION_UNIT: {
        CompilationUnit compilationUnit = (CompilationUnit)theEObject;
        T result = caseCompilationUnit(compilationUnit);
        if (result == null) result = caseDispelRoot(compilationUnit);
        if (result == null) result = caseNamedElement(compilationUnit);
        if (result == null) result = caseNamespaceAwareElement(compilationUnit);
        if (result == null) result = caseImportingElement(compilationUnit);
View Full Code Here

    /**
     * @generated NOT
     */
    public IStatus validate(IValidationContext ctx) {
      CompilationUnit context = (CompilationUnit) ctx.getTarget();
      // TODO: put validation code here
      // Ensure that you remove @generated tag or use @generated NOT
      //
      // To construct approprate return value, use ctx.createSuccessStatus()
      // or ctx.createFailureStatus(...)
View Full Code Here

    //Originally tried this in post-init, but auto-update then gets called
    //before this happens
   
    //Grab the compilationunit and add
    Resource r = Utility.getModel(getDiagram());
    CompilationUnit compUnit = null;
    for (EObject e : r.getContents()) {

      if (e instanceof CompilationUnit) {
        compUnit = (CompilationUnit) e;
      }
    }
   
    //If compUnit is null create a new one
    if (compUnit == null) {
      compUnit =
          ContainersFactory.eINSTANCE.createCompilationUnit();
      r.getContents().add(compUnit);
    }
   
    //Check that the compilationunit has a package, if not add one.
    eu.admire.dispel.containers.Package p = null;
    if (compUnit.getPackages().size() > 0) {
      p = compUnit.getPackages().get(0);
    } else {
      p =  ContainersFactory.eINSTANCE.createPackage();
     
      p.setName("eu.admire.test");
      List<String> namespaces = new ArrayList<String>();
      namespaces.add("eu");
      namespaces.add("admire");
      namespaces.add("test");
      p.getNamespaces().addAll(namespaces);
     
      compUnit.getPackages().add(p);
    }
   
    final eu.admire.dispel.containers.Package pck = p;
    getDiagramEditor().getEditingDomain().getCommandStack().execute(
        new RecordingCommand(getDiagramEditor().getEditingDomain(),
View Full Code Here

    }

    List<EObject> contents = diagramResource.getContents();

    Diagram d = null;
    CompilationUnit compUnit = null;
    String fragment = "";
    for (EObject e : contents) {
      if ((compUnit == null) && (e instanceof CompilationUnit)) {
        compUnit = (CompilationUnit) e;
      }
View Full Code Here

    /**
     * @generated NOT
     */
    public IStatus validate(IValidationContext ctx) {
      CompilationUnit context = (CompilationUnit) ctx.getTarget();
      // TODO: put validation code here
      // Ensure that you remove @generated tag or use @generated NOT
      //
      // To construct approprate return value, use ctx.createSuccessStatus()
      // or ctx.createFailureStatus(...)
View Full Code Here

        Messages.DispelDiagramEditorUtil_CreateDiagramCommandLabel,
        Collections.EMPTY_LIST) {
      protected CommandResult doExecuteWithResult(
          IProgressMonitor monitor, IAdaptable info)
          throws ExecutionException {
        CompilationUnit model = createInitialModel();
        attachModelToResource(model, modelResource);

        Diagram diagram = ViewService.createDiagram(model,
            CompilationUnitEditPart.MODEL_ID,
            DispelDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
View Full Code Here

    /**
     * @generated NOT
     */
    public IStatus validate(IValidationContext ctx) {
      CompilationUnit context = (CompilationUnit) ctx.getTarget();
      // TODO: put validation code here
      // Ensure that you remove @generated tag or use @generated NOT
      //
      // To construct approprate return value, use ctx.createSuccessStatus()
      // or ctx.createFailureStatus(...)
View Full Code Here

  public static List<DispelNodeDescriptor> getCompilationUnit_1000SemanticChildren(
      View view) {
    if (!view.isSetElement()) {
      return Collections.emptyList();
    }
    CompilationUnit modelElement = (CompilationUnit) view.getElement();
    LinkedList<DispelNodeDescriptor> result = new LinkedList<DispelNodeDescriptor>();
    for (Iterator<?> it = modelElement.getPackages().iterator(); it
        .hasNext();) {
      Package childElement = (Package) it.next();
      int visualID = DispelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == PackageEditPart.VISUAL_ID) {
View Full Code Here

  /**
   * @generated
   */
  private String getCompilationUnit_1000Text(View view) {
    CompilationUnit domainModelElement = (CompilationUnit) view
        .getElement();
    if (domainModelElement != null) {
      return domainModelElement.getName();
    } else {
      DispelDiagramEditorPlugin.getInstance().logError(
          "No domain element for view with visualID = " + 1000); //$NON-NLS-1$
      return ""; //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of eu.admire.dispel.containers.CompilationUnit

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.