Package com.mountainminds.eclemma.core

Examples of com.mountainminds.eclemma.core.ICoverageSession


    }
    menu = new Menu(parent);

    ILabelProvider labelprovider = new WorkbenchLabelProvider();
    final ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession active = manager.getActiveSession();
    int count = 0;
    for (final ICoverageSession session : manager.getSessions()) {
      MenuItem item = new MenuItem(menu, SWT.RADIO);
      Object[] labelparams = new Object[] { Integer.valueOf(++count),
          labelprovider.getText(session) };
View Full Code Here


    setEnabled(false);
  }
 
  public void run() {
    ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession session = manager.getActiveSession();
    if (session != null) {
      ILaunchConfiguration config = session.getLaunchConfiguration();
      if (config != null) {
        DebugUITools.launch(config, CoverageTools.LAUNCH_MODE);
      }
    }   
  }
View Full Code Here

    new Label(parent, SWT.NONE).setText(UIMessages.ExportReportPage1Sessions_label);
    sessionstable = new TableViewer(parent, SWT.BORDER);
    sessionstable.setLabelProvider(new WorkbenchLabelProvider());
    sessionstable.setContentProvider(new ArrayContentProvider());
    sessionstable.setInput(CoverageTools.getSessionManager().getSessions());
    ICoverageSession active = CoverageTools.getSessionManager().getActiveSession();
    if (active != null) {
      sessionstable.setSelection(new StructuredSelection(active));
    }
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = convertHeightInCharsToPixels(8);
View Full Code Here

    }
    return result;
  }

  private boolean createReport() {
    ICoverageSession session = page1.getSelectedSession();
    final ISessionExporter exporter = CoverageTools.getExporter(session);
    exporter.setFormat(page1.getReportFormat());
    exporter.setDestination(page1.getDestination());
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException {
        try {
          exporter.export(monitor);
        } catch (Exception e) {
          throw new InvocationTargetException(e);
        }
      }
    };
    try {
      getContainer().run(true, true, op);
    } catch (InterruptedException e) {
      return false;
    } catch (InvocationTargetException ite) {
      Throwable ex = ite.getTargetException();
      EclEmmaUIPlugin.log(ex);
      String title = UIMessages.ExportReportErrorDialog_title;
      String msg = UIMessages.ExportReportErrorDialog_message;
      msg = NLS.bind(msg, session.getDescription());
      IStatus status;
      if (ex instanceof CoreException) {
        status = ((CoreException) ex).getStatus();
      } else {
        status = EclEmmaUIPlugin.errorStatus(String.valueOf(ex.getMessage()), ex);
View Full Code Here

    return parent;
  }

  private String getSessionDescription() {
    ICoverageSession session = CoverageTools.getSessionManager()
        .getActiveSession();
    return session == null ? UIMessages.CoveragePropertyPageNoSession_value
        : session.getDescription();
  }
View Full Code Here

    String descr = UIMessages.MergeSessionsDialogDescriptionDefault_value;
    descr = MessageFormat.format(descr, new Object[] { new Date() });
    MergeSessionsDialog d = new MergeSessionsDialog(window.getShell(), sessions, descr);
    if (d.open() == IDialogConstants.OK_ID) {
      Object[] result = d.getResult();
      ICoverageSession merged = (ICoverageSession) result[0];
      for (int i = 1; i < result.length; i++) {
        merged = merged.merge((ICoverageSession) result[i], d.getDescription());
      }
      sm.addSession(merged, true, null);
      for (int i = 0; i < result.length; i++) {
        sm.removeSession((ICoverageSession) result[i]);
      }
View Full Code Here

    setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
  }

  public void run() {
    ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession session = manager.getActiveSession();
    if (session != null) {
      manager.removeSession(session);
    }
  }
View Full Code Here

  }

  protected void updateActions() {
    tree.getDisplay().asyncExec(new Runnable() {
      public void run() {
        ICoverageSession active = CoverageTools.getSessionManager()
            .getActiveSession();
        setContentDescription(active == null ? "" : active.getDescription()); //$NON-NLS-1$
        relaunchSessionAction.setEnabled(active != null
            && active.getLaunchConfiguration() != null);
        List<ICoverageSession> sessions = CoverageTools.getSessionManager()
            .getSessions();
        boolean atLeastOne = !sessions.isEmpty();
        removeActiveSessionAction.setEnabled(atLeastOne);
        removeAllSessionsAction.setEnabled(atLeastOne);
View Full Code Here

  }

  protected void updateActions() {
    tree.getDisplay().asyncExec(new Runnable() {
      public void run() {
        ICoverageSession active = CoverageTools.getSessionManager()
            .getActiveSession();
        setContentDescription(active == null ? "" : active.getDescription()); //$NON-NLS-1$
        relaunchSessionAction.setEnabled(active != null
            && active.getLaunchConfiguration() != null);
        ICoverageSession[] sessions = CoverageTools.getSessionManager()
            .getSessions();
        boolean atLeastOne = sessions.length >= 1;
        removeActiveSessionAction.setEnabled(atLeastOne);
        removeAllSessionsAction.setEnabled(atLeastOne);
View Full Code Here

  }
 
  protected void updateActions() {
    tree.getDisplay().asyncExec(new Runnable() {
      public void run() {
        ICoverageSession active = CoverageTools.getSessionManager().getActiveSession();
        setContentDescription(active == null ? "" : active.getDescription()); //$NON-NLS-1$
        relaunchSessionAction.setEnabled(active != null && active.getLaunchConfiguration() != null);
        ICoverageSession[] sessions = CoverageTools.getSessionManager().getSessions();
        boolean atLeastOne = sessions.length >= 1;
        removeActiveSessionAction.setEnabled(atLeastOne);
        removeAllSessionsAction.setEnabled(atLeastOne);
        boolean atLeastTwo = sessions.length >= 2;
View Full Code Here

TOP

Related Classes of com.mountainminds.eclemma.core.ICoverageSession

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.