Search in sources :

Example 1 with StatisticsDialog

use of com.twinsoft.convertigo.eclipse.dialogs.StatisticsDialog in project convertigo by convertigo.

the class CustomStatisticsAction method run.

public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            ProjectTreeObject projectTreeObject = (ProjectTreeObject) explorerView.getFirstSelectedTreeObject();
            if (projectTreeObject != null) {
                StatisticsDialog stats = new StatisticsDialog(shell, projectTreeObject.getName(), projectTreeObject.getObject().getComment(), projectTreeObject.getObject().getVersion());
                stats.open();
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to compute statistics!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) StatisticsDialog(com.twinsoft.convertigo.eclipse.dialogs.StatisticsDialog) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display)

Aggregations

StatisticsDialog (com.twinsoft.convertigo.eclipse.dialogs.StatisticsDialog)1 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)1 ProjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject)1 Cursor (org.eclipse.swt.graphics.Cursor)1 Display (org.eclipse.swt.widgets.Display)1 Shell (org.eclipse.swt.widgets.Shell)1