Examples of IDestecsProject


Examples of org.destecs.ide.core.resources.IDestecsProject

    this.configuration = configuration;
    try
    {
      loadSettings(configuration);

      IDestecsProject destecsProject = (IDestecsProject) project.getAdapter(IDestecsProject.class);

      Assert.isNotNull(destecsProject, " Project not found: "
          + configuration.getAttribute(IDebugConstants.DESTECS_LAUNCH_CONFIG_PROJECT_NAME, ""));

      IVdmProject vdmProject = (IVdmProject) project.getAdapter(IVdmProject.class);
      if (vdmProject == null
          || (typeCheck && !VdmTypeCheckerUi.typeCheck(vdmProject, monitor)))
      {
        abort("Cannot launch a project (" + vdmProject.getName()
            + ") with type errors, please check the problems view", null);
      }

      if (destecsProject == null
          || (typeCheck && !DestecsTypeCheckerUi.typeCheck(destecsProject, monitor)))
      {
        abort("Cannot launch a project (" + destecsProject.getName()
            + ") with errors, please check the problems view", null);
      }

      this.launch = launch;
      target = new DestecsDebugTarget(launch, project, outputFolder);
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

    } catch (Exception e)
    {
      DestecsDebugPlugin.logError("Failed to load launch configuration attributes (URL's)", e);
    }

    IDestecsProject dProject = (IDestecsProject) project.getAdapter(IDestecsProject.class);
    File base = dProject.getOutputFolder().getLocation().toFile();
    DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
    String tmp = ourputFolderPrefix;
    tmp = tmp.replace('\\', File.separatorChar).replace('/', File.separatorChar);
    if (!tmp.endsWith("" + File.separatorChar))
    {
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

    return model;
  }

  private ModelConfig getDeModelConfig(IProject project2, int port)
  {
    final IDestecsProject p = (IDestecsProject) project2.getAdapter(IDestecsProject.class);
    final DeModelConfig model = new DeModelConfig();
    model.logVariables.addAll(logVariablesVdm);
    if (!model.logVariables.isEmpty())
    {
      model.logFile = new File(outputFolder, "VdmVariables.csv").getAbsolutePath();
    }
    model.arguments.put(DeModelConfig.LOAD_OUTPUT_DIR, outputFolder.getAbsolutePath());
    model.arguments.put(DeModelConfig.LOAD_REPLACE, deReplacePattern);
    model.arguments.put(DeModelConfig.LOAD_DEBUG_PORT, String.valueOf(port));
    model.arguments.put(DeModelConfig.LOAD_BASE_DIR, p.getVdmModelFolder().getLocation().toFile().getAbsolutePath());

    try
    {
      if (!configuration.getAttribute(IDebugConstants.DESTECS_LAUNCH_CONFIG_DE_RT_VALIDATION, false))
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_RT_VALIDATOR, "true");
      }
    } catch (CoreException e)
    {
      DestecsDebugPlugin.logError("Could not get realtime check option from launch configuration", e);
    }

    if (deArchitectureFile != null && deArchitectureFile.exists())
    {
      StringBuffer architecture = new StringBuffer();
      StringBuffer deploy = new StringBuffer();
      try
      {
        BufferedReader in = new BufferedReader(new FileReader(deArchitectureFile));
        String str;
        boolean inArch = false;
        boolean inDeploy = false;
        while ((str = in.readLine()) != null)
        {
          str = str.trim();
          if (str.startsWith("-- ## Architecture ## --"))
          {
            inArch = true;
            inDeploy = false;
          }
          if (str.startsWith("-- ## Deployment ## --"))
          {
            inDeploy = true;
            inArch = false;
          }

          if (inArch)
          {
            architecture.append(str);
            architecture.append("\n");
          }
          if (inDeploy)
          {
            deploy.append(str);
            deploy.append("\n");
          }
        }
        in.close();
      } catch (IOException e)
      {
      }
      model.arguments.put(DeModelConfig.LOAD_ARCHITECTURE, architecture.toString());
      model.arguments.put(DeModelConfig.LOAD_DEPLOY, deploy.toString());

    }

    final IContentType vdmrtFileContentType = Platform.getContentTypeManager().getContentType(IDebugConstants.VDMRT_CONTENT_TYPE_ID);

    try
    {
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PRE_CHECKS, true))// vdmProject.hasPrechecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_PRE, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_POST_CHECKS, true))// vdmProject.hasPostchecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_POST, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_INV_CHECKS, true))// vdmProject.hasInvchecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_INV, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DTC_CHECKS, true))// vdmProject.hasDynamictypechecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_DYNAMIC_TC, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MEASURE_CHECKS, true))// vdmProject.hasMeasurechecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_MEASURE, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_LOG_RT, true))// vdmProject.hasMeasurechecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_RT_LOG, "true");
      }
      if (!configuration.getAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_GENERATE_COVERAGE, true))// vdmProject.hasMeasurechecks())
      {
        model.arguments.put(DeModelConfig.LOAD_SETTING_DISABLE_COVERAGE, "true");
      }

      project2.accept(new IResourceVisitor()
      {

        public boolean visit(IResource resource) throws CoreException
        {
          if (resource instanceof IFile
              && resource.getFileExtension() != null
              && resource.getFileExtension().equals(DeModelConfig.LOAD_LINK))
          {
            model.arguments.put(DeModelConfig.LOAD_LINK, resource.getLocation().toFile().getAbsolutePath());
          }
          return true;
        }
      });

      p.getVdmModelFolder().accept(new IResourceVisitor()
      {

        public boolean visit(IResource resource) throws CoreException
        {
          if (vdmrtFileContentType.isAssociatedWith(resource.getName()))
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

   
    Object o = fStructuredSelection.getFirstElement();
   
    if(o != null && o instanceof IProject){
      IProject p = (IProject) o;     
      IDestecsProject dp = (IDestecsProject) p.getAdapter(IDestecsProject.class);
     
      if(dp != null){
//        this.project = p;
        this.fProjectName = p.getName();
//        this.validSelection = true;
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

      addBuilder(prj, "org.destecs.ide.vdmmetadatabuilder.builder", null, null);
      addBuilder(prj, IDestecsCoreConstants.BUILDER_ID, null, null);
      addBuilder(prj, IDestecsCoreConstants.SCRIPT_BUILDER_ID, null, null);

      IDestecsProject dp = (IDestecsProject) prj.getAdapter(IDestecsProject.class);
      ModelBuildPath modelPath = p.getModelBuildPath();
      modelPath.add(dp.getVdmModelFolder());
      modelPath.remove(prj);
      modelPath.setOutput(dp.getOutputFolder());
      modelPath.setLibrary(dp.getVdmModelFolder().getFolder("lib"));
      modelPath.save();
      p.getModel().clean();
      prj.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());

View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

    Object o = fStructuredSelection.getFirstElement();

    if (o != null && o instanceof IProject)
    {
      IProject p = (IProject) o;
      IDestecsProject dp = (IDestecsProject) p.getAdapter(IDestecsProject.class);

      if (dp != null)
      {
        // this.project = p;
        this.fProjectName = p.getName();
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

      if (model == null)
      {
        if (viewer.getDocument() instanceof DestecsDocument)
        {
          IProject project = ((DestecsDocument) viewer.getDocument()).getFile().getProject();
          IDestecsProject p = (IDestecsProject) project.getAdapter(IDestecsProject.class);
          model = p.getModel();
          loadVdmMetadata(p);
        }
      }

      if (model != null && model.getContract() != null)
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

  protected IDestecsProject getProject()
  {
    IProject project = ((IFile) getEditorInput().getAdapter(IFile.class)).getProject();

    IDestecsProject dp = (IDestecsProject) project.getAdapter(IDestecsProject.class);
    return dp;
  }
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

    }
  }

  public String getOverviewDescription()
  {
    IDestecsProject p = getProject();
    StringBuilder sb = new StringBuilder();
    try
    {
      if (p != null)
      {
View Full Code Here

Examples of org.destecs.ide.core.resources.IDestecsProject

      return ResourceManager.getInstance().getProject(project);
    else
    {
      try
      {
        IDestecsProject vdmProject = new DestecsProject(project);
        return ResourceManager.getInstance().addProject(vdmProject);
      } catch (Exception e)
      {
        if (DestecsCorePlugin.DEBUG)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.