Search in sources :

Example 1 with ShowDashboardAction

use of org.springsource.ide.eclipse.dashboard.ui.actions.ShowDashboardAction in project eclipse-integration-commons by spring-projects.

the class IdeUiPlugin method start.

@Override
public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    // avoid cyclic startup dependency on org.eclipse.mylyn.tasks.ui
    Job startupJob = new UIJob("Spring Tool Suite Initialization") {

        @Override
        public IStatus runInUIThread(IProgressMonitor monitor) {
            migrateBlogFeeds();
            Display.getDefault().asyncExec(new Runnable() {

                public void run() {
                    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                    if (window != null) {
                        // prevent loading if already opened by workspace
                        // restore
                        IEditorReference[] references = window.getActivePage().getEditorReferences();
                        for (IEditorReference reference : references) {
                            if (DashboardEditorInputFactory.FACTORY_ID.equals(reference.getFactoryId())) {
                                return;
                            }
                        }
                        if (getPreferenceStore().getBoolean(IIdeUiConstants.PREF_OPEN_DASHBOARD_STARTUP)) {
                            // don't show if welcome page is visible
                            if (window.getWorkbench().getIntroManager().getIntro() != null) {
                                // scheduleUpdateJob();
                                return;
                            }
                            ShowDashboardAction showDashboard = new ShowDashboardAction();
                            showDashboard.init(window);
                            showDashboard.run(null);
                            return;
                        }
                    }
                // scheduleUpdateJob();
                }
            });
            return Status.OK_STATUS;
        }
    };
    startupJob.setSystem(true);
    startupJob.schedule();
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IEditorReference(org.eclipse.ui.IEditorReference) ShowDashboardAction(org.springsource.ide.eclipse.dashboard.ui.actions.ShowDashboardAction) UIJob(org.eclipse.ui.progress.UIJob) Job(org.eclipse.core.runtime.jobs.Job) UIJob(org.eclipse.ui.progress.UIJob)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 Job (org.eclipse.core.runtime.jobs.Job)1 IEditorReference (org.eclipse.ui.IEditorReference)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 UIJob (org.eclipse.ui.progress.UIJob)1 ShowDashboardAction (org.springsource.ide.eclipse.dashboard.ui.actions.ShowDashboardAction)1