Author: scabanovich
Date: 2012-01-24 18:14:55 -0500 (Tue, 24 Jan 2012)
New Revision: 38130
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtPlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
Log:
JBIDE-10703
https://issues.jboss.org/browse/JBIDE-10703
CDISeamExtPlugin is modified to follow the common pattern.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtPlugin.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtPlugin.java 2012-01-24
23:11:23 UTC (rev 38129)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/CDISeamExtPlugin.java 2012-01-24
23:14:55 UTC (rev 38130)
@@ -10,23 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.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 CDISeamExtPlugin extends AbstractUIPlugin{
+public class CDISeamExtPlugin extends BaseUIPlugin {
//The shared instance.
private static CDISeamExtPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.text.ext";
//$NON-NLS-1$
-
+ public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.text.ext";
//$NON-NLS-1$
/**
* The constructor.
@@ -42,47 +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= CDISeamExtPlugin.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) {
- CDISeamExtPlugin.getDefault().getLog().log(new Status(Status.INFO, PLUGIN_ID,
Status.OK, msg, null));
- }
-
- public static void log(IStatus status) {
- CDISeamExtPlugin.getDefault().getLog().log(status);
- }
- public static void log(String message, Exception exception) {
- CDISeamExtPlugin.getDefault().getLog().log(new Status(Status.ERROR,
CDISeamExtPlugin.PLUGIN_ID, Status.OK, message, exception));
- }
- static public void log(Exception ex) {
- CDISeamExtPlugin.getDefault().getLog().log(new Status(Status.ERROR,
CDISeamExtPlugin.PLUGIN_ID, Status.OK, CDISeamExtMessages.CDI_SEAM_EXT_PLUGIN_NO_MESSAGE,
ex));
- }
-
-
-
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java 2012-01-24
23:11:23 UTC (rev 38129)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java 2012-01-24
23:14:55 UTC (rev 38130)
@@ -74,9 +74,9 @@
}
}
}catch(CoreException ex){
- CDISeamExtPlugin.log(ex);
+ CDISeamExtPlugin.getDefault().logError(ex);
}catch(BadLocationException ex){
- CDISeamExtPlugin.log(ex);
+ CDISeamExtPlugin.getDefault().logError(ex);
}
return null;
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2012-01-24
23:11:23 UTC (rev 38129)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2012-01-24
23:14:55 UTC (rev 38130)
@@ -101,7 +101,7 @@
try{
elementFile = (IFile)element.getUnderlyingResource();
}catch(JavaModelException ex){
- CDISeamExtPlugin.log(ex);
+ CDISeamExtPlugin.getDefault().logError(ex);
}
if(elementFile != null)