Author: scabanovich
Date: 2012-01-24 18:53:53 -0500 (Tue, 24 Jan 2012)
New Revision: 38137
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/JSFExtensionsPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
Log:
JBIDE-10703
https://issues.jboss.org/browse/JBIDE-10703
JSFExtensionsPlugin is modified to follow the common pattern.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/JSFExtensionsPlugin.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/JSFExtensionsPlugin.java 2012-01-24
23:49:36 UTC (rev 38136)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/JSFExtensionsPlugin.java 2012-01-24
23:53:53 UTC (rev 38137)
@@ -17,17 +17,15 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
/**
* @author Jeremy
*
*/
-public class JSFExtensionsPlugin extends AbstractUIPlugin {
+public class JSFExtensionsPlugin extends BaseUIPlugin {
//The shared instance.
private static JSFExtensionsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
public static final String PLUGIN_ID = "org.jboss.tools.jsf.text.ext";
//$NON-NLS-1$
@@ -37,11 +35,6 @@
*/
public JSFExtensionsPlugin() {
plugin = this;
- try {
- resourceBundle=
ResourceBundle.getBundle("org.jboss.tools.jsf.text.ext.JSFExtensionsPlugin");
//$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
}
/**
@@ -51,45 +44,8 @@
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= JSFExtensionsPlugin.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) {
- JSFExtensionsPlugin.getDefault().getLog().log(new Status(Status.INFO, PLUGIN_ID,
Status.OK, msg, null));
- }
-
- public static void log(IStatus status) {
- JSFExtensionsPlugin.getDefault().getLog().log(status);
- }
public static void log(String message, Exception exception) {
- JSFExtensionsPlugin.getDefault().getLog().log(new Status(Status.ERROR,
JSFExtensionsPlugin.PLUGIN_ID, Status.OK, message, exception));
+ JSFExtensionsPlugin.getDefault().logError(message, exception);
}
- static public void log(Exception ex) {
- JSFExtensionsPlugin.getDefault().getLog().log(new Status(Status.ERROR,
JSFExtensionsPlugin.PLUGIN_ID, Status.OK,
JSFTextExtMessages.JSFExtensionsPlugin_NoMessage, ex));
- }
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2012-01-24
23:49:36 UTC (rev 38136)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2012-01-24
23:53:53 UTC (rev 38137)
@@ -108,7 +108,7 @@
return new Region(propStart,propLength);
} catch (BadLocationException x) {
- JSFExtensionsPlugin.log(x);
+ JSFExtensionsPlugin.getDefault().logError(x);
return null;
} finally {
smw.dispose();