Author: akazakov
Date: 2012-08-24 20:27:50 -0400 (Fri, 24 Aug 2012)
New Revision: 43231
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java
Log:
https://issues.jboss.org/browse/JBIDE-12480 "startup class must implement
org.eclipse.ui.IStartup" message in ErrorLog for org.jboss.tools.common.validation
plugin
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java 2012-08-25
00:25:47 UTC (rev 43230)
+++
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java 2012-08-25
00:27:50 UTC (rev 43231)
@@ -15,7 +15,10 @@
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.validation.java.JavaEditorTracker;
import org.osgi.framework.BundleContext;
@@ -23,7 +26,7 @@
/**
* @author Alexey Kazakov
*/
-public class CommonValidationPlugin extends BaseUIPlugin {
+public class CommonValidationPlugin extends BaseUIPlugin implements IStartup {
public static final String PLUGIN_ID = "org.jboss.tools.common.validation";
//$NON-NLS-1$
protected static CommonValidationPlugin plugin;
@@ -73,10 +76,18 @@
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- JavaEditorTracker.getInstance();
- }
- });
}
+
+ @Override
+ public void earlyStartup() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ workbench.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ if (window != null) {
+ JavaEditorTracker.getInstance();
+ }
+ }
+ });
+ }
}
\ No newline at end of file