Exemplo n.º 1
0
  @Override
  public void createPartControl(Composite parent) {
    Control[] childern = parent.getChildren();
    for (Control control : childern) {
      control.setVisible(false);
    }
    form = new SashForm(parent, 512);
    form.setLayout(new FillLayout());
    folder = new TabFolder(form, 128);
    // theConjectures = new ValidationTable(form, this);
    // form.setWeights(new int[] { 85, 15 });
    theArch = new GenericTabItem("Architecture overview", folder, AllowedOverrunDirection.Both);
    theOverview =
        new GenericTabItem("Execution overview", folder, AllowedOverrunDirection.Vertical);
    cw.clear();
    IFile file = null;
    try {

      file = ((FileEditorInput) getEditorInput()).getFile();

      FileUtility.deleteMarker(file, null, TracefileViewerPlugin.PLUGIN_ID);

      theMarkers = new TracefileMarker(file);

      if (FileUtility.getContent(file).size() == 0) {
        ErrorDialog.openError(
            getSite().getShell(), "Editor open", "File is empty", Status.CANCEL_STATUS);
        return;
      }

    } catch (Exception e) {
      TracefileViewerPlugin.log(e);
    } catch (OutOfMemoryError m) {
      showMessage(
          "The trace file can not be visualized because the Java Virtual Machine ran out of heap space. Try to allow Overture more heap space using Virtual Machine custom arguments (e.g. -Xms40m -Xmx512m).");
      return;
    }

    try {
      parseFile(selectedFile.getAbsolutePath());
    } catch (Exception e) {
      TracefileViewerPlugin.log(e);
    }
    openValidationConjectures(file);
  }
Exemplo n.º 2
0
  public static void addMarkers(String generalMessage, Set<Violation> violations) {
    List<Violation> list = GeneralCodeGenUtils.asSortedList(violations);

    for (Violation violation : list) {
      IFile ifile = convert(violation.getLocation().getFile());
      FileUtility.addMarker(
          ifile,
          generalMessage + ": " + violation.getDescripton(),
          violation.getLocation(),
          IMarker.PRIORITY_NORMAL,
          ICodeGenConstants.PLUGIN_ID,
          -1);
    }
  }
Exemplo n.º 3
0
  public static void addMarkers(VdmNodeInfo nodeInfo, LocationAssistantCG locationAssistant) {
    if (nodeInfo == null) {
      return;
    }

    INode node = nodeInfo.getNode();

    ILexLocation location = locationAssistant.findLocation(node);

    if (location == null) {
      return;
    }

    IFile ifile = convert(location.getFile());

    String reason = nodeInfo.getReason();

    String message = "Code generation support not implemented: " + node.toString();
    message += reason != null ? ". Reason: " + reason : "";

    FileUtility.addMarker(
        ifile, message, location, IMarker.PRIORITY_NORMAL, ICodeGenConstants.PLUGIN_ID, -1);
  }