Author: scabanovich
Date: 2012-01-24 18:22:57 -0500 (Tue, 24 Jan 2012)
New Revision: 38132
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeanFilters.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
Log:
JBIDE-10703
https://issues.jboss.org/browse/JBIDE-10703
CDIExtensionsPlugin is modified to follow the common pattern.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsPlugin.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -10,23 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.text.ext;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.jboss.tools.common.log.BaseUIPlugin;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class CDIExtensionsPlugin extends AbstractUIPlugin{
+public class CDIExtensionsPlugin extends BaseUIPlugin {
//The shared instance.
private static CDIExtensionsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
public static final String PLUGIN_ID = "org.jboss.tools.cdi.text.ext";
//$NON-NLS-1$
-
/**
* The constructor.
@@ -42,46 +32,4 @@
return plugin;
}
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle= CDIExtensionsPlugin.getDefault().getResourceBundle();
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- static public void log(String msg) {
- CDIExtensionsPlugin.getDefault().getLog().log(new Status(Status.INFO, PLUGIN_ID,
Status.OK, msg, null));
- }
-
- public static void log(IStatus status) {
- CDIExtensionsPlugin.getDefault().getLog().log(status);
- }
- public static void log(String message, Exception exception) {
- CDIExtensionsPlugin.getDefault().getLog().log(new Status(Status.ERROR,
CDIExtensionsPlugin.PLUGIN_ID, Status.OK, message, exception));
- }
- static public void log(Exception ex) {
- CDIExtensionsPlugin.getDefault().getLog().log(new Status(Status.ERROR,
CDIExtensionsPlugin.PLUGIN_ID, Status.OK, CDIExtensionsMessages.CDI_EXT_PLUGIN_NO_MESSAGE,
ex));
- }
-
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeanFilters.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeanFilters.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeanFilters.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -107,7 +107,7 @@
FilterContributor f =
(FilterContributor)c.createExecutableExtension("class");
s.add(f);
} catch (CoreException e) {
- CDIExtensionsPlugin.getDefault().log(e);
+ CDIExtensionsPlugin.getDefault().logError(e);
}
}
contributors = s.toArray(new FilterContributor[s.size()]);
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/DisposerHyperlink.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -45,9 +45,9 @@
try{
part = JavaUI.openInEditor(method);
}catch(JavaModelException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}catch(PartInitException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}
if (part != null) {
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -126,7 +126,7 @@
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
} catch (JavaModelException jme) {
- CDIExtensionsPlugin.log(jme);
+ CDIExtensionsPlugin.getDefault().logError(jme);
}
return null;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventHyperlink.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -50,9 +50,9 @@
try{
part = JavaUI.openInEditor(event.getClassBean().getBeanClass());
}catch(JavaModelException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}catch(PartInitException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}
IJavaElement element = event.getClassBean().getBeanClass();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -57,9 +57,9 @@
try{
part = JavaUI.openInEditor(bean.getBeanClass());
}catch(JavaModelException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}catch(PartInitException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}
IJavaElement element = getJavaElement();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -103,7 +103,7 @@
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
} catch (JavaModelException jme) {
- CDIExtensionsPlugin.log(jme);
+ CDIExtensionsPlugin.getDefault().logError(jme);
}
return null;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ObserverMethodHyperlink.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -46,9 +46,9 @@
try{
part = JavaUI.openInEditor(observerMethod.getClassBean().getBeanClass());
}catch(JavaModelException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}catch(PartInitException ex){
- CDIExtensionsPlugin.log(ex);
+ CDIExtensionsPlugin.getDefault().logError(ex);
}
IJavaElement element = observerMethod.getMethod();
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2012-01-24
23:21:55 UTC (rev 38131)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2012-01-24
23:22:57 UTC (rev 38132)
@@ -118,7 +118,7 @@
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
} catch (JavaModelException jme) {
- CDIExtensionsPlugin.log(jme);
+ CDIExtensionsPlugin.getDefault().logError(jme);
}
return null;
}