*** empty log message ***
diff --git a/org.eclipse.ui.cheatsheets/plugin.properties b/org.eclipse.ui.cheatsheets/plugin.properties
index 4226679..ba6e938 100644
--- a/org.eclipse.ui.cheatsheets/plugin.properties
+++ b/org.eclipse.ui.cheatsheets/plugin.properties
@@ -22,115 +22,4 @@
CHEAT_SHEET_CONTENT = Cheat Sheet Content
CHEAT_SHEET_ITEM_EXTENSION = Cheat Sheet Item Extension
CHEAT_SHEETS = Cheat Sheets
-CHEAT_SHEETS_MENU = &Cheat Sheets...
-
-
-# ----------------------------------------------------------------------
-# Properties used by cheat sheet Java code
-# ----------------------------------------------------------------------
-# CheatSheetPlugin
-ERROR_READING_STATE_FILE = Unable to read state information.
-ERROR_WRITING_STATE_FILE = Unable to store state information.
-
-# CheatSheetCategoryBasedSelectionDialog, CheatSheetSelectionDialog
-CHEAT_SHEET_SELECTION_DIALOG_TITLE = Cheat Sheet Selection
-CHEAT_SHEET_SELECTION_DIALOG_MSG = Select the cheat sheet to open:
-
-# CheatSheetExapndRestoreAction, CheatSheetView
-COLLAPSE_ALL_BUT_CURRENT_TOOLTIP = Collapse All Items But Current
-
-# CheatSheetExapndRestoreAction
-RESTORE_ALL_TOOLTIP = Expand To Previous Expansion States
-
-# CheatSheetMenu
-CHEAT_SHEET_OTHER_MENU = Other...
-
-# CoreItem
-PERFORM_TASK_TOOLTIP = Click to Perform
-SKIP_TASK_TOOLTIP = Click to Skip
-COMPLETE_TASK_TOOLTIP = Click to Complete
-RESTART_TASK_TOOLTIP = Click to Redo
-LESS_THAN_2_SUBITEMS = Less than 2 sub items found for the next item. This is not allowed. Contact the cheat sheet provider for assistance.
-ERROR_FINDING_PLUGIN_FOR_ACTION = The action could not be run because the plugin ''{0}'' could not be located.
-ERROR_DATA_MISSING = An error occured while executing the cheat sheet due to missing data. Contact the cheat sheet provider for assistance.
-ERROR_DATA_MISSING_LOG = The data for variable ''{0}'' is not initialized properly before it is attempted to be used.
-ERROR_CONDITIONAL_DATA_MISSING_LOG = No subitem matched the condition ''{0}'' specified for the conditional-subitem ''{1}''.
-ERROR_LOADING_CLASS_FOR_ACTION = The action could not be run because the class ''{0}'' could not be loaded.
-ERROR_CREATING_CLASS_FOR_ACTION = The action could not be run because an instance of the class ''{0}'' could not be created.
-
-# IntroItem
-START_CHEATSHEET_TOOLTIP = Click to Begin
-RESTART_CHEATSHEET_TOOLTIP = Click to Restart
-
-# ViewItem
-HELP_BUTTON_TOOLTIP = Open Related Help
-
-# CheatSheetViewer
-ERROR_RUNNING_ACTION = The action could not be run. Contact the cheat sheet provider for assistance.
-ERROR_INVALID_CHEATSHEET_ID = The cheat sheet ''{0}'' does not exist. Contact the cheat sheet provider for assistance.
-ERROR_CHEATSHEET_DOESNOT_EXIST = The cheat sheet specified does not exist. Contact the cheat sheet provider for assistance.
-ERROR_APPLYING_STATE_DATA = The saved state for the cheat sheet current not applied. Contact the cheat sheet provider for assistance.
-ERROR_APPLYING_STATE_DATA_LOG = The saved state from file ''{0}'' for the ''{1}'' cheat sheet current not applied.
-INITIAL_VIEW_DIRECTIONS = To display a cheat sheet, select one from the Help menu or from the menu of the view's local toolbar.
-
-# ErrorPage
-ERROR_LOADING_CHEATSHEET_CONTENT = Error loading cheat sheet content.
-ERROR_PAGE_MESSAGE = An error occurred loading the cheat sheet content file. Contact the cheat sheet provider for assistance.
-
-# CheatSheetElement, CheatSheetItemExtensionElement
-ERROR_LOADING_CLASS = The class ''{0}'' could not be loaded. Contact the cheat sheet provider for assistance.
-ERROR_CREATING_CLASS = An instance of the class ''{0}'' could not be created. Contact the cheat sheet provider for assistance.
-
-# CheatSheetRegistryReader
-CHEAT_SHEET_OTHER_CATEGORY = Other
-
-# OpenCheatSheetAction
-LAUNCH_SHEET_ERROR = Error loading the cheat sheet view
-CHEAT_SHEET_ERROR_OPENING = Error opening cheat sheet
-
-# actions.OpenPerspective
-ERROR_OPENING_PERSPECTIVE = Error opening perspective.
-
-# CheatSheetSaveHelper
-ERROR_CREATING_STATEFILE_URL = Error creating state file url, ''{0}''.
-ERROR_SAVING_STATEFILE_URL = Error saving state file for the ''{0}'' cheat sheet.
-ERROR_READING_MANAGERDATA_FROM_STATEFILE = Error reading CheatSheetManager data for key ''{0}'' from state file for the ''{1}'' cheat sheet.
-
-
-# CheatSheetParser, regaular messages
-CHEAT_SHEET_INTRO_TITLE = Introduction
-
-# CheatSheetParser, general error messages
-ERROR_TITLE = Cheat Sheet Error
-
-# CheatSheetParser - init, file I/O and XML parsing error messages
-ERROR_CREATING_DOCUMENT_BUILDER = Error occured creating DocumentBuilder, verify that the JRE is properly setup.
-ERROR_DOCUMENT_BUILDER_NOT_INIT = The DocumentBuilder was not initialized, verify that the JRE is properly setup.
-ERROR_OPENING_FILE = Could not open the cheat sheet content file, {0}.
-ERROR_OPENING_FILE_IN_PARSER = Cheat sheet content file ''{0}'' not found by parser.
-ERROR_SAX_PARSING = Cheat sheet content file ''{0}'' could not be parsed.
-ERROR_SAX_PARSING_WITH_LOCATION = Cheat sheet content file ''{0}'' could not be parsed, error at line ''{1}'', column ''{2}''.
-
-# CheatSheetParser, content error messages
-ERROR_PARSING_CHEATSHEET_CONTENTS = Error parsing the cheat sheet DOM.
-ERROR_PARSING_CHEATSHEET_ELEMENT = The <cheatsheet> element must be the root node of the cheat sheet content file.
-ERROR_PARSING_NO_INTRO = The cheat sheet content file must contain an <intro> element.
-ERROR_PARSING_MORE_THAN_ONE_INTRO = The cheat sheet content file can only contain one <intro> element.
-ERROR_PARSING_NO_ITEM = The cheat sheet content file must contain at least one <item> element.
-ERROR_PARSING_PARAM_INVALIDRANGE = The action has a parameter ''{0}'' which specified an invalid range ''{1}''.
-ERROR_PARSING_PARAM_INVALIDNUMBER = The action has a parameter which specified an invalid parameter number.
-ERROR_PARSING_NO_DESCRIPTION = The description for element ''{0}'' was not defined.
-ERROR_PARSING_NO_SUBITEM = The ''{0}'' element must specify a subitem element.
-ERROR_PARSING_NO_ACTION = The ''{0}'' elment must specify an action element.
-ERROR_PARSING_NO_TITLE = The ''{0}'' elment must specify a title attribute.
-ERROR_PARSING_NO_CLASS = The ''{0}'' elment must specify a class attribute.
-ERROR_PARSING_NO_PLUGINID = The ''{0}'' elment must specify a pluginId attribute.
-ERROR_PARSING_NO_CONDITION = The ''{0}'' elment must specify a condition attribute.
-ERROR_PARSING_NO_VALUES = The ''{0}'' elment must specify a values attribute.
-ERROR_PARSING_NO_LABEL = The ''{0}'' elment must specify a label attribute.
-
-# CheatSheetParser, content warning messages
-WARNING_PARSING_UNKNOWN_ATTRIBUTE = Unknown attribute ''{0}'' specified for element ''{1}''.
-WARNING_PARSING_UNKNOWN_ELEMENT = Unknown element ''{0}'' specified for element ''{1}''.
-WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT = The description for element ''{0}'' contains an unknown element ''{1}''.
-
+CHEAT_SHEETS_MENU = &Cheat Sheets...
\ No newline at end of file
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
index e21bebe..b7caeea 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/cheatsheets/OpenCheatSheetAction.java
@@ -21,6 +21,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
import org.eclipse.ui.internal.cheatsheets.ICheatSheetResource;
+import org.eclipse.ui.internal.cheatsheets.Messages;
import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
/**
@@ -103,10 +104,10 @@
view.setInput(id, name, url);
}
} catch (PartInitException pie) {
- String message = CheatSheetPlugin.getResourceString(ICheatSheetResource.LAUNCH_SHEET_ERROR);
+ String message = Messages.LAUNCH_SHEET_ERROR;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, pie);
CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(window.getShell(), CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_ERROR_OPENING), null, pie.getStatus());
+ org.eclipse.jface.dialogs.ErrorDialog.openError(window.getShell(), Messages.CHEAT_SHEET_ERROR_OPENING, null, pie.getStatus());
return;
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
index aa043b3..09fc3d8 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
@@ -12,7 +12,6 @@
import java.io.*;
import java.net.URL;
-import java.text.MessageFormat;
import java.util.*;
import javax.xml.parsers.*;
@@ -35,7 +34,7 @@
public class CheatSheetPlugin extends AbstractUIPlugin {
//The shared instance of this plugin.
- private static CheatSheetPlugin plugin;
+ static CheatSheetPlugin plugin;
//Resource bundle.
private boolean resourceBundleInitialized = false;
@@ -57,20 +56,6 @@
}
/**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- try {
- if(plugin != null) {
- return Platform.getResourceString(plugin.getBundle(), key);
- }
- } catch (MissingResourceException e) {
- }
- return key;
- }
-
- /**
* Returns the shared instance.
*/
public static CheatSheetPlugin getPlugin() {
@@ -78,18 +63,6 @@
}
/**
- * Returns the formatted message for the given key in
- * the resource bundle.
- *
- * @param key the resource name
- * @param args the message arguments
- * @return the string
- */
- public static String formatResourceString(String key, Object[] args) {
- return MessageFormat.format(getResourceString(key), args);
- }
-
- /**
* Returns the image in Cheat Sheet's image registry with the given key,
* or <code>null</code> if none.
* Convenience method equivalent to
@@ -135,7 +108,7 @@
try {
documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
} catch (Exception e) {
- IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_CREATING_DOCUMENT_BUILDER), e);
+ IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_CREATING_DOCUMENT_BUILDER, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
}
@@ -212,7 +185,7 @@
} catch (FileNotFoundException e) {
// Do nothing, the file will not exist the first time the workbench in used.
} catch (Exception e) {
- String message = getResourceString(ICheatSheetResource.ERROR_READING_STATE_FILE);
+ String message = Messages.ERROR_READING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
} finally {
@@ -221,14 +194,14 @@
reader.close();
} catch (IOException e) {
// Not much to do, just catch the exception and keep going.
- String message = getResourceString(ICheatSheetResource.ERROR_READING_STATE_FILE);
+ String message = Messages.ERROR_READING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
}
}
public void handleException(Throwable e) {
- String message = getResourceString(ICheatSheetResource.ERROR_READING_STATE_FILE);
+ String message = Messages.ERROR_READING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
@@ -258,7 +231,7 @@
memento.save(writer);
} catch (IOException e) {
stateFile.delete();
- String message = getResourceString(ICheatSheetResource.ERROR_WRITING_STATE_FILE);
+ String message = Messages.ERROR_WRITING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
} finally {
@@ -266,14 +239,14 @@
if (writer != null)
writer.close();
} catch (IOException e) {
- String message = getResourceString(ICheatSheetResource.ERROR_WRITING_STATE_FILE);
+ String message = Messages.ERROR_WRITING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
}
}
public void handleException(Throwable e) {
- String message = getResourceString(ICheatSheetResource.ERROR_WRITING_STATE_FILE);
+ String message = Messages.ERROR_WRITING_STATE_FILE;
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ICheatSheetResource.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ICheatSheetResource.java
index e7fe8b5..e1965cc 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ICheatSheetResource.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/ICheatSheetResource.java
@@ -42,112 +42,5 @@
public static final String CHEATSHEET_ITEM_BUTTON_SKIP = "CHEATSHEET_ITEM_BUTTON_SKIP"; //$NON-NLS-1$
public static final String CHEATSHEET_ITEM_BUTTON_COMPLETE = "CHEATSHEET_ITEM_BUTTON_COMPLETE"; //$NON-NLS-1$
public static final String CHEATSHEET_ITEM_BUTTON_RESTART = "CHEATSHEET_ITEM_BUTTON_RESTART"; //$NON-NLS-1$
-
-
- //
- // Constants used to retrieve strings from the cheatsheet resource bundle.
- //
-
- // CheatSheetPlugin
- public static final String ERROR_READING_STATE_FILE = "%ERROR_READING_STATE_FILE"; //$NON-NLS-1$
- public static final String ERROR_WRITING_STATE_FILE = "%ERROR_WRITING_STATE_FILE"; //$NON-NLS-1$
-
- // CheatSheetCategoryBasedSelectionDialog, CheatSheetSelectionDialog
- public static final String CHEAT_SHEET_SELECTION_DIALOG_TITLE = "%CHEAT_SHEET_SELECTION_DIALOG_TITLE"; //$NON-NLS-1$
- public static final String CHEAT_SHEET_SELECTION_DIALOG_MSG = "%CHEAT_SHEET_SELECTION_DIALOG_MSG"; //$NON-NLS-1$
-
- // CheatSheetExapndRestoreAction, CheatSheetView
- public static final String COLLAPSE_ALL_BUT_CURRENT_TOOLTIP = "%COLLAPSE_ALL_BUT_CURRENT_TOOLTIP"; //$NON-NLS-1$
-
- // CheatSheetExapndRestoreAction
- public static final String RESTORE_ALL_TOOLTIP = "%RESTORE_ALL_TOOLTIP"; //$NON-NLS-1$
-
- // CheatSheetMenu
- public static final String CHEAT_SHEET_OTHER_MENU = "%CHEAT_SHEET_OTHER_MENU"; //$NON-NLS-1$
-
- // CoreItem
- public static final String PERFORM_TASK_TOOLTIP = "%PERFORM_TASK_TOOLTIP"; //$NON-NLS-1$
- public static final String SKIP_TASK_TOOLTIP = "%SKIP_TASK_TOOLTIP"; //$NON-NLS-1$
- public static final String COMPLETE_TASK_TOOLTIP = "%COMPLETE_TASK_TOOLTIP"; //$NON-NLS-1$
- public static final String RESTART_TASK_TOOLTIP = "%RESTART_TASK_TOOLTIP"; //$NON-NLS-1$
- public static final String LESS_THAN_2_SUBITEMS = "%LESS_THAN_2_SUBITEMS";//$NON-NLS-1$
- public static final String ERROR_FINDING_PLUGIN_FOR_ACTION = "%ERROR_FINDING_PLUGIN_FOR_ACTION"; //$NON-NLS-1$
- public static final String ERROR_DATA_MISSING = "%ERROR_DATA_MISSING"; //$NON-NLS-1$
- public static final String ERROR_DATA_MISSING_LOG = "%ERROR_DATA_MISSING_LOG"; //$NON-NLS-1$
- public static final String ERROR_CONDITIONAL_DATA_MISSING_LOG = "%ERROR_CONDITIONAL_DATA_MISSING_LOG"; //$NON-NLS-1$
- public static final String ERROR_LOADING_CLASS_FOR_ACTION = "%ERROR_LOADING_CLASS_FOR_ACTION"; //$NON-NLS-1$
- public static final String ERROR_CREATING_CLASS_FOR_ACTION = "%ERROR_CREATING_CLASS_FOR_ACTION"; //$NON-NLS-1$
- // IntroItem
- public static final String START_CHEATSHEET_TOOLTIP = "%START_CHEATSHEET_TOOLTIP"; //$NON-NLS-1$
- public static final String RESTART_CHEATSHEET_TOOLTIP = "%RESTART_CHEATSHEET_TOOLTIP"; //$NON-NLS-1$
- // ViewItem
- public static final String HELP_BUTTON_TOOLTIP = "%HELP_BUTTON_TOOLTIP";//$NON-NLS-1$
-
- // CheatSheetViewer
- public static final String ERROR_RUNNING_ACTION = "%ERROR_RUNNING_ACTION"; //$NON-NLS-1$
- public static final String ERROR_INVALID_CHEATSHEET_ID = "%ERROR_INVALID_CHEATSHEET_ID"; //$NON-NLS-1$
- public static final String ERROR_CHEATSHEET_DOESNOT_EXIST = "%ERROR_CHEATSHEET_DOESNOT_EXIST"; //$NON-NLS-1$
- public static final String ERROR_APPLYING_STATE_DATA = "%ERROR_APPLYING_STATE_DATA"; //$NON-NLS-1$
- public static final String ERROR_APPLYING_STATE_DATA_LOG = "%ERROR_APPLYING_STATE_DATA_LOG"; //$NON-NLS-1$
- public static final String INITIAL_VIEW_DIRECTIONS = "%INITIAL_VIEW_DIRECTIONS"; //$NON-NLS-1$
-
- // ErrorPage
- public static final String ERROR_LOADING_CHEATSHEET_CONTENT = "%ERROR_LOADING_CHEATSHEET_CONTENT"; //$NON-NLS-1$
- public static final String ERROR_PAGE_MESSAGE = "%ERROR_PAGE_MESSAGE"; //$NON-NLS-1$
-
-
- // CheatSheetElement, CheatSheetItemExtensionElement
- public static final String ERROR_LOADING_CLASS = "%ERROR_LOADING_CLASS"; //$NON-NLS-1$
- public static final String ERROR_CREATING_CLASS = "%ERROR_CREATING_CLASS"; //$NON-NLS-1$
-
- // CheatSheetRegistryReader
- public static final String CHEAT_SHEET_OTHER_CATEGORY = "%CHEAT_SHEET_OTHER_CATEGORY"; //$NON-NLS-1$
-
- // OpenCheatSheetAction
- public static final String LAUNCH_SHEET_ERROR = "%LAUNCH_SHEET_ERROR"; //$NON-NLS-1$
- public static final String CHEAT_SHEET_ERROR_OPENING = "%CHEAT_SHEET_ERROR_OPENING"; //$NON-NLS-1$
-
- // actions.OpenPerspective
- public static final String ERROR_OPENING_PERSPECTIVE = "%ERROR_OPENING_PERSPECTIVE"; //$NON-NLS-1$
-
- // CheatSheetSaveHelper
- public static final String ERROR_CREATING_STATEFILE_URL = "%ERROR_CREATING_STATEFILE_URL"; //$NON-NLS-1$
- public static final String ERROR_SAVING_STATEFILE_URL = "%ERROR_SAVING_STATEFILE_URL"; //$NON-NLS-1$
- public static final String ERROR_READING_MANAGERDATA_FROM_STATEFILE = "%ERROR_READING_MANAGERDATA_FROM_STATEFILE"; //$NON-NLS-1$
-
-
- // CheatSheetParser, regaular messages
- public static final String CHEAT_SHEET_INTRO_TITLE = "%CHEAT_SHEET_INTRO_TITLE"; //$NON-NLS-1$
- // CheatSheetParser, general error messages
- public static final String ERROR_TITLE = "%ERROR_TITLE"; //$NON-NLS-1$
- // CheatSheetParser - init, file I/O and XML parsing error messages
- public static final String ERROR_CREATING_DOCUMENT_BUILDER = "%ERROR_CREATING_DOCUMENT_BUILDER"; //$NON-NLS-1$
- public static final String ERROR_DOCUMENT_BUILDER_NOT_INIT = "%ERROR_DOCUMENT_BUILDER_NOT_INIT"; //$NON-NLS-1$
- public static final String ERROR_OPENING_FILE = "%ERROR_OPENING_FILE"; //$NON-NLS-1$
- public static final String ERROR_OPENING_FILE_IN_PARSER = "%ERROR_OPENING_FILE_IN_PARSER"; //$NON-NLS-1$
- public static final String ERROR_SAX_PARSING = "%ERROR_SAX_PARSING"; //$NON-NLS-1$
- public static final String ERROR_SAX_PARSING_WITH_LOCATION = "%ERROR_SAX_PARSING_WITH_LOCATION"; //$NON-NLS-1$
- // CheatSheetParser, content error messages
- public static final String ERROR_PARSING_CHEATSHEET_CONTENTS = "%ERROR_PARSING_CHEATSHEET_CONTENTS"; //$NON-NLS-1$
- public static final String ERROR_PARSING_CHEATSHEET_ELEMENT = "%ERROR_PARSING_CHEATSHEET_ELEMENT"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_INTRO = "%ERROR_PARSING_NO_INTRO"; //$NON-NLS-1$
- public static final String ERROR_PARSING_MORE_THAN_ONE_INTRO = "%ERROR_PARSING_MORE_THAN_ONE_INTRO"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_ITEM = "%ERROR_PARSING_NO_ITEM"; //$NON-NLS-1$
- public static final String ERROR_PARSING_PARAM_INVALIDRANGE = "%ERROR_PARSING_PARAM_INVALIDRANGE"; //$NON-NLS-1$
- public static final String ERROR_PARSING_PARAM_INVALIDNUMBER = "%ERROR_PARSING_PARAM_INVALIDNUMBER"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_DESCRIPTION = "%ERROR_PARSING_NO_DESCRIPTION"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_SUBITEM = "%ERROR_PARSING_NO_SUBITEM"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_ACTION = "%ERROR_PARSING_NO_ACTION"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_TITLE = "%ERROR_PARSING_NO_TITLE"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_CLASS = "%ERROR_PARSING_NO_CLASS"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_PLUGINID = "%ERROR_PARSING_NO_PLUGINID"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_CONDITION = "%ERROR_PARSING_NO_CONDITION"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_VALUES = "%ERROR_PARSING_NO_VALUES"; //$NON-NLS-1$
- public static final String ERROR_PARSING_NO_LABEL = "%ERROR_PARSING_NO_LABEL"; //$NON-NLS-1$
- // CheatSheetParser, content warning messages
- public static final String WARNING_PARSING_UNKNOWN_ATTRIBUTE = "%WARNING_PARSING_UNKNOWN_ATTRIBUTE"; //$NON-NLS-1$
- public static final String WARNING_PARSING_UNKNOWN_ELEMENT = "%WARNING_PARSING_UNKNOWN_ELEMENT"; //$NON-NLS-1$
- public static final String WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT = "%WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT"; //$NON-NLS-1$
-
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.java
new file mode 100644
index 0000000..893458f
--- /dev/null
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.internal.cheatsheets;
+
+import org.eclipse.osgi.util.NLS;
+
+public final class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.ui.internal.cheatsheets.Messages";//$NON-NLS-1$
+
+ private Messages() {
+ // Do not instantiate
+ }
+
+ public static String ERROR_READING_STATE_FILE;
+ public static String ERROR_WRITING_STATE_FILE;
+ public static String CHEAT_SHEET_SELECTION_DIALOG_TITLE;
+ public static String CHEAT_SHEET_SELECTION_DIALOG_MSG;
+ public static String COLLAPSE_ALL_BUT_CURRENT_TOOLTIP;
+ public static String RESTORE_ALL_TOOLTIP;
+ public static String CHEAT_SHEET_OTHER_MENU;
+ public static String PERFORM_TASK_TOOLTIP;
+ public static String SKIP_TASK_TOOLTIP;
+ public static String COMPLETE_TASK_TOOLTIP;
+ public static String RESTART_TASK_TOOLTIP;
+ public static String LESS_THAN_2_SUBITEMS;
+ public static String ERROR_FINDING_PLUGIN_FOR_ACTION;
+ public static String ERROR_DATA_MISSING;
+ public static String ERROR_DATA_MISSING_LOG;
+ public static String ERROR_CONDITIONAL_DATA_MISSING_LOG;
+ public static String ERROR_LOADING_CLASS_FOR_ACTION;
+ public static String ERROR_CREATING_CLASS_FOR_ACTION;
+ public static String START_CHEATSHEET_TOOLTIP;
+ public static String RESTART_CHEATSHEET_TOOLTIP;
+ public static String HELP_BUTTON_TOOLTIP;
+ public static String ERROR_RUNNING_ACTION;
+ public static String ERROR_INVALID_CHEATSHEET_ID;
+ public static String ERROR_CHEATSHEET_DOESNOT_EXIST;
+ public static String ERROR_APPLYING_STATE_DATA;
+ public static String ERROR_APPLYING_STATE_DATA_LOG;
+ public static String INITIAL_VIEW_DIRECTIONS;
+ public static String ERROR_LOADING_CHEATSHEET_CONTENT;
+ public static String ERROR_PAGE_MESSAGE;
+ public static String ERROR_LOADING_CLASS;
+ public static String ERROR_CREATING_CLASS;
+ public static String CHEAT_SHEET_OTHER_CATEGORY;
+ public static String LAUNCH_SHEET_ERROR;
+ public static String CHEAT_SHEET_ERROR_OPENING;
+ public static String ERROR_OPENING_PERSPECTIVE;
+ public static String ERROR_CREATING_STATEFILE_URL;
+ public static String ERROR_SAVING_STATEFILE_URL;
+ public static String ERROR_READING_MANAGERDATA_FROM_STATEFILE;
+ public static String CHEAT_SHEET_INTRO_TITLE;
+ public static String ERROR_TITLE;
+ public static String ERROR_CREATING_DOCUMENT_BUILDER;
+ public static String ERROR_DOCUMENT_BUILDER_NOT_INIT;
+ public static String ERROR_OPENING_FILE;
+ public static String ERROR_OPENING_FILE_IN_PARSER;
+ public static String ERROR_SAX_PARSING;
+ public static String ERROR_SAX_PARSING_WITH_LOCATION;
+ public static String ERROR_PARSING_CHEATSHEET_CONTENTS;
+ public static String ERROR_PARSING_CHEATSHEET_ELEMENT;
+ public static String ERROR_PARSING_NO_INTRO;
+ public static String ERROR_PARSING_MORE_THAN_ONE_INTRO;
+ public static String ERROR_PARSING_NO_ITEM;
+ public static String ERROR_PARSING_PARAM_INVALIDRANGE;
+ public static String ERROR_PARSING_PARAM_INVALIDNUMBER;
+ public static String ERROR_PARSING_NO_DESCRIPTION;
+ public static String ERROR_PARSING_NO_SUBITEM;
+ public static String ERROR_PARSING_NO_ACTION;
+ public static String ERROR_PARSING_NO_TITLE;
+ public static String ERROR_PARSING_NO_CLASS;
+ public static String ERROR_PARSING_NO_PLUGINID;
+ public static String ERROR_PARSING_NO_CONDITION;
+ public static String ERROR_PARSING_NO_VALUES;
+ public static String ERROR_PARSING_NO_LABEL;
+ public static String WARNING_PARSING_UNKNOWN_ATTRIBUTE;
+ public static String WARNING_PARSING_UNKNOWN_ELEMENT;
+ public static String WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.properties b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.properties
new file mode 100644
index 0000000..acc824b
--- /dev/null
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/Messages.properties
@@ -0,0 +1,124 @@
+###############################################################################
+# Copyright (c) 2003, 2005 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+# ----------------------------------------------------------------------
+# Properties for org.eclipse.ui.cheatsheets
+#
+# Entries are of the form CONSTANT=string
+# ----------------------------------------------------------------------
+# ----------------------------------------------------------------------
+# Properties used by cheat sheet Java code
+# ----------------------------------------------------------------------
+# CheatSheetPlugin
+ERROR_READING_STATE_FILE = Unable to read state information.
+ERROR_WRITING_STATE_FILE = Unable to store state information.
+
+# CheatSheetCategoryBasedSelectionDialog, CheatSheetSelectionDialog
+CHEAT_SHEET_SELECTION_DIALOG_TITLE = Cheat Sheet Selection
+CHEAT_SHEET_SELECTION_DIALOG_MSG = Select the cheat sheet to open:
+
+# CheatSheetExapndRestoreAction, CheatSheetView
+COLLAPSE_ALL_BUT_CURRENT_TOOLTIP = Collapse All Items But Current
+
+# CheatSheetExapndRestoreAction
+RESTORE_ALL_TOOLTIP = Expand To Previous Expansion States
+
+# CheatSheetMenu
+CHEAT_SHEET_OTHER_MENU = Other...
+
+# CoreItem
+PERFORM_TASK_TOOLTIP = Click to Perform
+SKIP_TASK_TOOLTIP = Click to Skip
+COMPLETE_TASK_TOOLTIP = Click to Complete
+RESTART_TASK_TOOLTIP = Click to Redo
+LESS_THAN_2_SUBITEMS = Less than 2 sub items found for the next item. This is not allowed. Contact the cheat sheet provider for assistance.
+ERROR_FINDING_PLUGIN_FOR_ACTION = The action could not be run because the plugin ''{0}'' could not be located.
+ERROR_DATA_MISSING = An error occured while executing the cheat sheet due to missing data. Contact the cheat sheet provider for assistance.
+ERROR_DATA_MISSING_LOG = The data for variable ''{0}'' is not initialized properly before it is attempted to be used.
+ERROR_CONDITIONAL_DATA_MISSING_LOG = No subitem matched the condition ''{0}'' specified for the conditional-subitem ''{1}''.
+ERROR_LOADING_CLASS_FOR_ACTION = The action could not be run because the class ''{0}'' could not be loaded.
+ERROR_CREATING_CLASS_FOR_ACTION = The action could not be run because an instance of the class ''{0}'' could not be created.
+
+# IntroItem
+START_CHEATSHEET_TOOLTIP = Click to Begin
+RESTART_CHEATSHEET_TOOLTIP = Click to Restart
+
+# ViewItem
+HELP_BUTTON_TOOLTIP = Open Related Help
+
+# CheatSheetViewer
+ERROR_RUNNING_ACTION = The action could not be run. Contact the cheat sheet provider for assistance.
+ERROR_INVALID_CHEATSHEET_ID = The cheat sheet ''{0}'' does not exist. Contact the cheat sheet provider for assistance.
+ERROR_CHEATSHEET_DOESNOT_EXIST = The cheat sheet specified does not exist. Contact the cheat sheet provider for assistance.
+ERROR_APPLYING_STATE_DATA = The saved state for the cheat sheet current not applied. Contact the cheat sheet provider for assistance.
+ERROR_APPLYING_STATE_DATA_LOG = The saved state from file ''{0}'' for the ''{1}'' cheat sheet current not applied.
+INITIAL_VIEW_DIRECTIONS = To display a cheat sheet, select one from the Help menu or from the menu of the view's local toolbar.
+
+# ErrorPage
+ERROR_LOADING_CHEATSHEET_CONTENT = Error loading cheat sheet content.
+ERROR_PAGE_MESSAGE = An error occurred loading the cheat sheet content file. Contact the cheat sheet provider for assistance.
+
+# CheatSheetElement, CheatSheetItemExtensionElement
+ERROR_LOADING_CLASS = The class ''{0}'' could not be loaded. Contact the cheat sheet provider for assistance.
+ERROR_CREATING_CLASS = An instance of the class ''{0}'' could not be created. Contact the cheat sheet provider for assistance.
+
+# CheatSheetRegistryReader
+CHEAT_SHEET_OTHER_CATEGORY = Other
+
+# OpenCheatSheetAction
+LAUNCH_SHEET_ERROR = Error loading the cheat sheet view
+CHEAT_SHEET_ERROR_OPENING = Error opening cheat sheet
+
+# actions.OpenPerspective
+ERROR_OPENING_PERSPECTIVE = Error opening perspective.
+
+# CheatSheetSaveHelper
+ERROR_CREATING_STATEFILE_URL = Error creating state file url, ''{0}''.
+ERROR_SAVING_STATEFILE_URL = Error saving state file for the ''{0}'' cheat sheet.
+ERROR_READING_MANAGERDATA_FROM_STATEFILE = Error reading CheatSheetManager data for key ''{0}'' from state file for the ''{1}'' cheat sheet.
+
+
+# CheatSheetParser, regaular messages
+CHEAT_SHEET_INTRO_TITLE = Introduction
+
+# CheatSheetParser, general error messages
+ERROR_TITLE = Cheat Sheet Error
+
+# CheatSheetParser - init, file I/O and XML parsing error messages
+ERROR_CREATING_DOCUMENT_BUILDER = Error occured creating DocumentBuilder, verify that the JRE is properly setup.
+ERROR_DOCUMENT_BUILDER_NOT_INIT = The DocumentBuilder was not initialized, verify that the JRE is properly setup.
+ERROR_OPENING_FILE = Could not open the cheat sheet content file, {0}.
+ERROR_OPENING_FILE_IN_PARSER = Cheat sheet content file ''{0}'' not found by parser.
+ERROR_SAX_PARSING = Cheat sheet content file ''{0}'' could not be parsed.
+ERROR_SAX_PARSING_WITH_LOCATION = Cheat sheet content file ''{0}'' could not be parsed, error at line ''{1}'', column ''{2}''.
+
+# CheatSheetParser, content error messages
+ERROR_PARSING_CHEATSHEET_CONTENTS = Error parsing the cheat sheet DOM.
+ERROR_PARSING_CHEATSHEET_ELEMENT = The <cheatsheet> element must be the root node of the cheat sheet content file.
+ERROR_PARSING_NO_INTRO = The cheat sheet content file must contain an <intro> element.
+ERROR_PARSING_MORE_THAN_ONE_INTRO = The cheat sheet content file can only contain one <intro> element.
+ERROR_PARSING_NO_ITEM = The cheat sheet content file must contain at least one <item> element.
+ERROR_PARSING_PARAM_INVALIDRANGE = The action has a parameter ''{0}'' which specified an invalid range ''{1}''.
+ERROR_PARSING_PARAM_INVALIDNUMBER = The action has a parameter which specified an invalid parameter number.
+ERROR_PARSING_NO_DESCRIPTION = The description for element ''{0}'' was not defined.
+ERROR_PARSING_NO_SUBITEM = The ''{0}'' element must specify a subitem element.
+ERROR_PARSING_NO_ACTION = The ''{0}'' elment must specify an action element.
+ERROR_PARSING_NO_TITLE = The ''{0}'' elment must specify a title attribute.
+ERROR_PARSING_NO_CLASS = The ''{0}'' elment must specify a class attribute.
+ERROR_PARSING_NO_PLUGINID = The ''{0}'' elment must specify a pluginId attribute.
+ERROR_PARSING_NO_CONDITION = The ''{0}'' elment must specify a condition attribute.
+ERROR_PARSING_NO_VALUES = The ''{0}'' elment must specify a values attribute.
+ERROR_PARSING_NO_LABEL = The ''{0}'' elment must specify a label attribute.
+
+# CheatSheetParser, content warning messages
+WARNING_PARSING_UNKNOWN_ATTRIBUTE = Unknown attribute ''{0}'' specified for element ''{1}''.
+WARNING_PARSING_UNKNOWN_ELEMENT = Unknown element ''{0}'' specified for element ''{1}''.
+WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT = The description for element ''{0}'' contains an unknown element ''{1}''.
+
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
index d92ee49..a6a4fea 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/CheatSheetMenu.java
@@ -89,7 +89,7 @@
*/
private void createOtherItem(Menu menu, int index) {
MenuItem mi = new MenuItem(menu, SWT.PUSH, index);
- mi.setText(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_OTHER_MENU));
+ mi.setText(Messages.CHEAT_SHEET_OTHER_MENU);
mi.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
runOther(e);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/OpenPerspective.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/OpenPerspective.java
index 84d9db2..7de7414 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/OpenPerspective.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/actions/OpenPerspective.java
@@ -50,7 +50,7 @@
IPerspectiveDescriptor perspective = workbench.getPerspectiveRegistry().findPerspectiveWithId(params[0]);
page.setPerspective(perspective);
} catch(Exception e) {
- IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_OPENING_PERSPECTIVE), null);
+ IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_OPENING_PERSPECTIVE, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
index d677e6a..6e3fc6d 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.*;
import org.eclipse.jface.util.Assert;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
import org.eclipse.ui.internal.cheatsheets.*;
@@ -209,29 +210,29 @@
if(num>-1 && num<9){
params[num] = attribute.getNodeValue();
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_PARAM_INVALIDRANGE, new Object[] {attributeName, paramNum});
+ String message = NLS.bind(Messages.ERROR_PARSING_PARAM_INVALIDRANGE, (new Object[] {attributeName, paramNum}));
throw new NumberFormatException(message);
}
} catch(NumberFormatException e) {
- String message = CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_PARAM_INVALIDNUMBER);
+ String message = Messages.ERROR_PARSING_PARAM_INVALIDNUMBER;
logMessage(IStatus.ERROR, false, message, null, e);
throw new CheatSheetParserException(message);
}
} else if (attributeName.equals(IParserTags.WHEN)) {
action.setWhen(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, actionNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, actionNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!classAttr) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_CLASS, new Object[] {actionNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_CLASS, (new Object[] {actionNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
if(!pluginId) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_PLUGINID, new Object[] {actionNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_PLUGINID, (new Object[] {actionNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -260,14 +261,14 @@
title = true;
cheatSheet.setTitle(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, cheatSheetNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, cheatSheetNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!title) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_TITLE, new Object[] {cheatSheetNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_TITLE, (new Object[] {cheatSheetNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
}
@@ -294,14 +295,14 @@
condition = true;
conditionalSubItem.setCondition(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, conditionalSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, conditionalSubItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!condition) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_CONDITION, new Object[] {conditionalSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_CONDITION, (new Object[] {conditionalSubItemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -317,14 +318,14 @@
handleSubItem(conditionalSubItem, node);
} else {
if(node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != Node.COMMENT_NODE ) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ELEMENT, new Object[] {node.getNodeName(), conditionalSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ELEMENT, (new Object[] {node.getNodeName(), conditionalSubItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!subitem) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_SUBITEM, new Object[] {conditionalSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_SUBITEM, (new Object[] {conditionalSubItemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -362,7 +363,7 @@
if( startNode.getNodeName().equals(IParserTags.DESCRIPTION) ) {
parentNode = startNode.getParentNode();
}
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT, new Object[] {parentNode.getNodeName(), node.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_DESCRIPTION_UNKNOWN_ELEMENT, (new Object[] {parentNode.getNodeName(), node.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
@@ -381,7 +382,7 @@
if( startNode.getNodeName().equals(IParserTags.DESCRIPTION) ) {
parentNode = startNode.getParentNode();
}
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_DESCRIPTION, new Object[] {parentNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_DESCRIPTION, (new Object[] {parentNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
}
@@ -396,15 +397,15 @@
if(introNode == null) {
// Error: there is no intro
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_NO_INTRO));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_NO_INTRO);
}
if(introList.getLength() > 1) {
// Error: there are more than 1 intro
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_MORE_THAN_ONE_INTRO));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_MORE_THAN_ONE_INTRO);
}
Item introItem = new Item();
- introItem.setTitle(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_INTRO_TITLE));
+ introItem.setTitle(Messages.CHEAT_SHEET_INTRO_TITLE);
handleIntroAttributes(introItem, introNode);
handleDescription(introItem, introNode);
@@ -429,7 +430,7 @@
} else if (attributeName.equals(IParserTags.HREF)) {
item.setHref(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, introNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, introNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
@@ -465,14 +466,14 @@
handlePerformWhen(item, node);
} else {
if(node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != Node.COMMENT_NODE ) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ELEMENT, new Object[] {node.getNodeName(), itemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ELEMENT, (new Object[] {node.getNodeName(), itemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!description) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_DESCRIPTION, new Object[] {itemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_DESCRIPTION, (new Object[] {itemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -513,7 +514,7 @@
}
if(!title) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_TITLE, new Object[] {itemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_TITLE, (new Object[] {itemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -526,7 +527,7 @@
NodeList itemList = document.getElementsByTagName(IParserTags.ITEM);
if (itemList == null || itemList.getLength() == 0) {
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_NO_ITEM));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_NO_ITEM);
}
//parse the items. assemble CheatSheetItem objects.
@@ -534,7 +535,7 @@
if (items == null || items.size() == 0) {
// This should never occur but just to be safe let's check.
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_NO_ITEM));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_NO_ITEM);
}
cheatSheet.addItems(items);
@@ -578,14 +579,14 @@
condition = true;
performWhen.setCondition(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, performWhenNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, performWhenNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!condition) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_CONDITION, new Object[] {performWhenNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_CONDITION, (new Object[] {performWhenNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -601,14 +602,14 @@
handleAction(performWhen, node);
} else {
if(node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != Node.COMMENT_NODE ) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ELEMENT, new Object[] {node.getNodeName(), performWhenNode .getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ELEMENT, (new Object[] {node.getNodeName(), performWhenNode .getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!action) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_ACTION, new Object[] {performWhenNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_ACTION, (new Object[] {performWhenNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -637,14 +638,14 @@
values = true;
repeatedSubItem.setValues(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, repeatedSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, repeatedSubItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!values) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_VALUES, new Object[] {repeatedSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_VALUES, (new Object[] {repeatedSubItemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -660,14 +661,14 @@
handleSubItem(repeatedSubItem, node);
} else {
if(node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != Node.COMMENT_NODE ) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ELEMENT, new Object[] {node.getNodeName(), repeatedSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ELEMENT, (new Object[] {node.getNodeName(), repeatedSubItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!subitem) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_SUBITEM, new Object[] {repeatedSubItemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_SUBITEM, (new Object[] {repeatedSubItemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
@@ -693,7 +694,7 @@
handlePerformWhen(subItem, node);
} else {
if(node.getNodeType() != Node.TEXT_NODE && node.getNodeType() != Node.COMMENT_NODE ) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ELEMENT, new Object[] {node.getNodeName(), subItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ELEMENT, (new Object[] {node.getNodeName(), subItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
@@ -723,14 +724,14 @@
} else if (attributeName.equals(IParserTags.WHEN)) {
subItem.setWhen(attribute.getNodeValue());
} else {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {attributeName, subItemNode.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {attributeName, subItemNode.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
}
}
if(!label) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_PARSING_NO_LABEL, new Object[] {subItemNode.getNodeName()});
+ String message = NLS.bind(Messages.ERROR_PARSING_NO_LABEL, (new Object[] {subItemNode.getNodeName()}));
throw new CheatSheetParserException(message);
}
}
@@ -753,7 +754,7 @@
}
if(al.size() == 0) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.WARNING_PARSING_UNKNOWN_ATTRIBUTE, new Object[] {item.getNodeName(), node.getNodeName()});
+ String message = NLS.bind(Messages.WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] {item.getNodeName(), node.getNodeName()}));
logMessage(IStatus.WARNING, false, message, null, null);
}
return (AbstractItemExtensionElement[])al.toArray(new AbstractItemExtensionElement[al.size()]);
@@ -791,28 +792,28 @@
inputSource = new InputSource(is);
}
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_OPENING_FILE, new Object[] {url.getFile()});
- logMessage(IStatus.ERROR, true, message, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_TITLE), e);
+ String message = NLS.bind(Messages.ERROR_OPENING_FILE, (new Object[] {url.getFile()}));
+ logMessage(IStatus.ERROR, true, message, Messages.ERROR_TITLE, e);
return null;
}
Document document;
try {
if(documentBuilder == null) {
- logMessage(IStatus.ERROR, false, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_DOCUMENT_BUILDER_NOT_INIT), null, null);
+ logMessage(IStatus.ERROR, false, Messages.ERROR_DOCUMENT_BUILDER_NOT_INIT, null, null);
return null;
}
document = documentBuilder.parse(inputSource);
} catch (IOException e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_OPENING_FILE_IN_PARSER, new Object[] {url.getFile()});
+ String message = NLS.bind(Messages.ERROR_OPENING_FILE_IN_PARSER, (new Object[] {url.getFile()}));
logMessage(IStatus.ERROR, false, message, null, e);
return null;
} catch (SAXParseException spe) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_SAX_PARSING_WITH_LOCATION, new Object[] {url.getFile(), new Integer(spe.getLineNumber()), new Integer(spe.getColumnNumber())});
+ String message = NLS.bind(Messages.ERROR_SAX_PARSING_WITH_LOCATION, (new Object[] {url.getFile(), new Integer(spe.getLineNumber()), new Integer(spe.getColumnNumber())}));
logMessage(IStatus.ERROR, false, message, null, spe);
return null;
} catch (SAXException se) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_SAX_PARSING, new Object[] {url.getFile()});
+ String message = NLS.bind(Messages.ERROR_SAX_PARSING, (new Object[] {url.getFile()}));
logMessage(IStatus.ERROR, false, message, null, se);
return null;
} finally {
@@ -825,7 +826,7 @@
try {
return parseCheatSheet(document);
} catch(CheatSheetParserException e) {
- logMessage(IStatus.ERROR, true, e.getMessage(), CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_TITLE), e);
+ logMessage(IStatus.ERROR, true, e.getMessage(), Messages.ERROR_TITLE, e);
}
return null;
}
@@ -837,7 +838,7 @@
// Is the root node really <cheatsheet>?
if( !rootnode.getNodeName().equals(IParserTags.CHEATSHEET) ) {
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_CHEATSHEET_ELEMENT));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_CHEATSHEET_ELEMENT);
}
// Create the cheat sheet model object
@@ -851,7 +852,7 @@
return cheatSheet;
} else {
- throw new CheatSheetParserException(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PARSING_CHEATSHEET_CONTENTS));
+ throw new CheatSheetParserException(Messages.ERROR_PARSING_CHEATSHEET_CONTENTS);
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
index d792af5..87f4d4f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetSaveHelper.java
@@ -20,6 +20,7 @@
import javax.xml.transform.stream.StreamResult;
import org.eclipse.core.runtime.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.internal.cheatsheets.*;
import org.eclipse.ui.internal.cheatsheets.views.*;
import org.w3c.dom.*;
@@ -149,7 +150,7 @@
readURL = filePath.toFile().toURL();
doc = readXMLFile(readURL);
} catch (MalformedURLException mue) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_CREATING_STATEFILE_URL, new Object[] {readURL});
+ String message = NLS.bind(Messages.ERROR_CREATING_STATEFILE_URL, (new Object[] {readURL}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, mue);
CheatSheetPlugin.getPlugin().getLog().log(status);
return null;
@@ -197,7 +198,7 @@
String data = csmDatanl.item(i).getFirstChild().getNodeValue();
ht.put(key, data);
} catch(Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_READING_MANAGERDATA_FROM_STATEFILE, new Object[] {key, currentID});
+ String message = NLS.bind(Messages.ERROR_READING_MANAGERDATA_FROM_STATEFILE, (new Object[] {key, currentID}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
@@ -349,7 +350,7 @@
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
transformer.transform(domSource, streamResult);
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_SAVING_STATEFILE_URL, new Object[] {csID});
+ String message = NLS.bind(Messages.ERROR_SAVING_STATEFILE_URL, (new Object[] {csID}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
index bbb6f92..130b89e 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
@@ -61,8 +61,8 @@
this.cheatsheetCategories = cheatsheetCategories;
- setTitle(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_SELECTION_DIALOG_TITLE));
- setMessage(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_SELECTION_DIALOG_MSG));
+ setTitle(Messages.CHEAT_SHEET_SELECTION_DIALOG_TITLE);
+ setMessage(Messages.CHEAT_SHEET_SELECTION_DIALOG_MSG);
setShellStyle(getShellStyle() | SWT.RESIZE);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetSelectionDialog.java
index b9f24b5..49305e8 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetSelectionDialog.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetSelectionDialog.java
@@ -92,8 +92,8 @@
public CheatSheetSelectionDialog(Shell shell) {
super(shell);
- setTitle(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_SELECTION_DIALOG_TITLE));
- setMessage(CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_SELECTION_DIALOG_MSG));
+ setTitle(Messages.CHEAT_SHEET_SELECTION_DIALOG_TITLE);
+ setMessage(Messages.CHEAT_SHEET_SELECTION_DIALOG_MSG);
setShellStyle(getShellStyle() | SWT.RESIZE);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
index d7117b5..9cf7990 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetElement.java
@@ -11,6 +11,7 @@
package org.eclipse.ui.internal.cheatsheets.registry;
import org.eclipse.core.runtime.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.cheatsheets.CheatSheetListener;
import org.eclipse.ui.internal.cheatsheets.*;
import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
@@ -154,7 +155,7 @@
Bundle bundle = Platform.getBundle(pluginId);
extClass = bundle.loadClass(listenerClass);
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_LOADING_CLASS, new Object[] {listenerClass});
+ String message = NLS.bind(Messages.ERROR_LOADING_CLASS, (new Object[] {listenerClass}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
@@ -163,7 +164,7 @@
listener = (CheatSheetListener) extClass.newInstance();
}
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_CREATING_CLASS, new Object[] {listenerClass});
+ String message = NLS.bind(Messages.ERROR_CREATING_CLASS, (new Object[] {listenerClass}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
index 4de0209..4aded2f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetItemExtensionElement.java
@@ -12,6 +12,7 @@
import java.lang.reflect.Constructor;
import org.eclipse.core.runtime.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.cheatsheets.AbstractItemExtensionElement;
import org.eclipse.ui.internal.cheatsheets.*;
import org.eclipse.ui.model.*;
@@ -106,7 +107,7 @@
Bundle bundle = Platform.getBundle(pluginId);
extClass = bundle.loadClass(className);
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_LOADING_CLASS, new Object[] {className});
+ String message = NLS.bind(Messages.ERROR_LOADING_CLASS, (new Object[] {className}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
@@ -117,7 +118,7 @@
extElement = (AbstractItemExtensionElement) c.newInstance(parameters);
}
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_CREATING_CLASS, new Object[] {className});
+ String message = NLS.bind(Messages.ERROR_CREATING_CLASS, (new Object[] {className}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
index aaed934..0459d9f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/registry/CheatSheetRegistryReader.java
@@ -62,7 +62,7 @@
protected final static String TAG_ITEM_EXTENSION = "itemExtension"; //$NON-NLS-1$
protected final static String trueString = "TRUE"; //$NON-NLS-1$
private final static String UNCATEGORIZED_CHEATSHEET_CATEGORY = "org.eclipse.ui.Other"; //$NON-NLS-1$
- private final static String UNCATEGORIZED_CHEATSHEET_CATEGORY_LABEL = CheatSheetPlugin.getResourceString(ICheatSheetResource.CHEAT_SHEET_OTHER_CATEGORY);
+ private final static String UNCATEGORIZED_CHEATSHEET_CATEGORY_LABEL = Messages.CHEAT_SHEET_OTHER_CATEGORY;
/**
* Returns a list of cheatsheets, project and not.
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetExpandRestoreAction.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetExpandRestoreAction.java
index 5a5e2c1..ad6cb72 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetExpandRestoreAction.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetExpandRestoreAction.java
@@ -13,7 +13,6 @@
import org.eclipse.jface.action.Action;
import org.eclipse.ui.internal.cheatsheets.*;
-import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
/**
* Action used to enable / disable method filter properties
@@ -44,9 +43,9 @@
super.setChecked(value);
collapsed = value;
if(value) {
- setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTORE_ALL_TOOLTIP));
+ setToolTipText(Messages.RESTORE_ALL_TOOLTIP);
} else {
- setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP));
+ setToolTipText(Messages.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP);
}
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetView.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetView.java
index 8bcdb22..49d9fe6 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetView.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetView.java
@@ -41,8 +41,8 @@
URL collapseExpandURL = CheatSheetPlugin.getPlugin().find(new Path(collapseExpandFile));
ImageDescriptor collapseExpandImage = ImageDescriptor.createFromURL(collapseExpandURL);
- expandRestoreAction = new CheatSheetExpandRestoreAction(CheatSheetPlugin.getResourceString(ICheatSheetResource.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP), false, viewer);
- expandRestoreAction.setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP));
+ expandRestoreAction = new CheatSheetExpandRestoreAction(Messages.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP, false, viewer);
+ expandRestoreAction.setToolTipText(Messages.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP);
expandRestoreAction.setImageDescriptor(collapseExpandImage);
tbmanager.add(expandRestoreAction);
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
index d09b6ab..f54495a 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java
@@ -14,6 +14,7 @@
import java.util.*;
import org.eclipse.core.runtime.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Cursor;
@@ -340,7 +341,7 @@
SubItemCompositeHolder s = (SubItemCompositeHolder) l.get(Integer.parseInt(token));
if (s != null && s.getStartButton() != null) {
s.getStartButton().setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_RESTART));
- s.getStartButton().setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTART_TASK_TOOLTIP));
+ s.getStartButton().setToolTipText(Messages.RESTART_TASK_TOOLTIP);
}
}
@@ -404,7 +405,7 @@
// Log the exception
String stateFile = saveHelper.getStateFile(currentID).toOSString();
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_APPLYING_STATE_DATA_LOG, new Object[] {stateFile, currentID});
+ String message = NLS.bind(Messages.ERROR_APPLYING_STATE_DATA_LOG, (new Object[] {stateFile, currentID}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
@@ -422,7 +423,7 @@
viewItemList = new ArrayList();
// Create the errorpage to show the user
- createErrorPage(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_APPLYING_STATE_DATA));
+ createErrorPage(Messages.ERROR_APPLYING_STATE_DATA);
return false;
}
@@ -515,7 +516,7 @@
});
howToBegin = new Label(control, SWT.WRAP);
- howToBegin.setText(CheatSheetPlugin.getResourceString(ICheatSheetResource.INITIAL_VIEW_DIRECTIONS));
+ howToBegin.setText(Messages.INITIAL_VIEW_DIRECTIONS);
howToBegin.setLayoutData(new GridData(GridData.FILL_BOTH));
Display display = parent.getDisplay();
@@ -633,7 +634,7 @@
// Exception thrown during parsing.
// Something is wrong with the Cheat sheet content file at the xml level.
if(invalidCheatSheetId) {
- createErrorPage(CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_CHEATSHEET_DOESNOT_EXIST));
+ createErrorPage(Messages.ERROR_CHEATSHEET_DOESNOT_EXIST);
} else {
createErrorPage(null);
}
@@ -730,7 +731,7 @@
}
}
} catch (RuntimeException e) {
- IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_RUNNING_ACTION), e);
+ IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_RUNNING_ACTION, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
} finally {
@@ -750,13 +751,13 @@
ArrayList l = coreItem.getListOfSubItemCompositeHolders();
SubItemCompositeHolder s = (SubItemCompositeHolder) l.get(subItemIndex);
s.getStartButton().setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_RESTART));
- s.getStartButton().setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTART_TASK_TOOLTIP));
+ s.getStartButton().setToolTipText(Messages.RESTART_TASK_TOOLTIP);
advanceSubItem(link, true, subItemIndex);
saveCurrentSheet();
}
}
} catch (RuntimeException e) {
- IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_RUNNING_ACTION), e);
+ IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_RUNNING_ACTION, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
} finally {
@@ -852,7 +853,7 @@
element = CheatSheetRegistryReader.getInstance().findCheatSheet(id);
if(element == null) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_INVALID_CHEATSHEET_ID, new Object[] {id});
+ String message = NLS.bind(Messages.ERROR_INVALID_CHEATSHEET_ID, (new Object[] {id}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
invalidCheatSheetId = true;
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
index ae6eaf7..f14ef0f 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.*;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.util.*;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
@@ -63,7 +64,7 @@
private void createButtons(Action action) {
if (action != null ) {
- final ImageHyperlink startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.PERFORM_TASK_TOOLTIP));
+ final ImageHyperlink startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, Messages.PERFORM_TASK_TOOLTIP);
toolkit.adapt(startButton, true, true);
startButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -72,7 +73,7 @@
});
}
if (item.isSkip()) {
- final ImageHyperlink skipButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_SKIP), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.SKIP_TASK_TOOLTIP));
+ final ImageHyperlink skipButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_SKIP), this, itemColor, Messages.SKIP_TASK_TOOLTIP);
toolkit.adapt(skipButton, true, true);
skipButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -81,7 +82,7 @@
});
}
if (action == null || action.isConfirm()) {
- final ImageHyperlink completeButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_COMPLETE), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.COMPLETE_TASK_TOOLTIP));
+ final ImageHyperlink completeButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_COMPLETE), this, itemColor, Messages.COMPLETE_TASK_TOOLTIP);
toolkit.adapt(completeButton, true, true);
completeButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -139,7 +140,7 @@
ImageHyperlink startButton = null;
if (subAction != null) {
added++;
- startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.PERFORM_TASK_TOOLTIP));
+ startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, Messages.PERFORM_TASK_TOOLTIP);
final ImageHyperlink finalStartButton = startButton;
toolkit.adapt(startButton, true, true);
startButton.addHyperlinkListener(new HyperlinkAdapter() {
@@ -150,7 +151,7 @@
}
if (sub.isSkip()) {
added++;
- final ImageHyperlink skipButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_SKIP), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.SKIP_TASK_TOOLTIP));
+ final ImageHyperlink skipButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_SKIP), this, itemColor, Messages.SKIP_TASK_TOOLTIP);
toolkit.adapt(skipButton, true, true);
skipButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -160,7 +161,7 @@
}
if (subAction == null || subAction.isConfirm()) {
added++;
- final ImageHyperlink completeButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_COMPLETE), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.COMPLETE_TASK_TOOLTIP));
+ final ImageHyperlink completeButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_COMPLETE), this, itemColor, Messages.COMPLETE_TASK_TOOLTIP);
toolkit.adapt(completeButton, true, true);
completeButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -217,8 +218,8 @@
if(control instanceof ImageHyperlink) {
String toolTipText = control.getToolTipText();
if( toolTipText != null &&
- (toolTipText.equals(CheatSheetPlugin.getResourceString(ICheatSheetResource.PERFORM_TASK_TOOLTIP)) ||
- toolTipText.equals(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTART_TASK_TOOLTIP)))) {
+ (toolTipText.equals(Messages.PERFORM_TASK_TOOLTIP) ||
+ toolTipText.equals(Messages.RESTART_TASK_TOOLTIP))) {
return (ImageHyperlink)control;
}
}
@@ -239,9 +240,9 @@
handleSubButtons();
}catch(Exception e){
//Need to log exception here.
- IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.LESS_THAN_2_SUBITEMS), e);
+ IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.LESS_THAN_2_SUBITEMS, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), CheatSheetPlugin.getResourceString(ICheatSheetResource.LESS_THAN_2_SUBITEMS), null, status);
+ org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.LESS_THAN_2_SUBITEMS, null, status);
}
}
@@ -290,11 +291,11 @@
String values = repeatedSubItem.getValues();
values = viewer.getManager().getVariableData(values);
if(values == null || values.length() <= 0 || (values.startsWith("${") && values.endsWith("}"))) { //$NON-NLS-1$ //$NON-NLS-2$
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_DATA_MISSING_LOG, new Object[] {repeatedSubItem.getValues()});
+ String message = NLS.bind(Messages.ERROR_DATA_MISSING_LOG, (new Object[] {repeatedSubItem.getValues()}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
- status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_DATA_MISSING), null);
+ status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_DATA_MISSING, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
break;
@@ -318,11 +319,11 @@
SubItem selectedSubItem = sub.getSelectedSubItem();
if(selectedSubItem == null) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_CONDITIONAL_DATA_MISSING_LOG, new Object[] {sub.getCondition(), getItem().getTitle()});
+ String message = NLS.bind(Messages.ERROR_CONDITIONAL_DATA_MISSING_LOG, (new Object[] {sub.getCondition(), getItem().getTitle()}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
- status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_DATA_MISSING), null);
+ status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, Messages.ERROR_DATA_MISSING, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, null, status);
break;
@@ -379,7 +380,7 @@
ArrayList sublist = item.getSubItems();
if(sublist == null || sublist.size()<=1)
- throw new Exception(ICheatSheetResource.LESS_THAN_2_SUBITEMS);
+ throw new Exception(Messages.LESS_THAN_2_SUBITEMS);
createSubItemButtonComposite();
@@ -448,10 +449,10 @@
byte runAction(String pluginId, String className, String[] params, CheatSheetManager csm) {
Bundle bundle = Platform.getBundle(pluginId);
if (bundle == null) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_FINDING_PLUGIN_FOR_ACTION, new Object[] {pluginId});
+ String message = NLS.bind(Messages.ERROR_FINDING_PLUGIN_FOR_ACTION, (new Object[] {pluginId}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, null);
CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_RUNNING_ACTION), status);
+ org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, Messages.ERROR_RUNNING_ACTION, status);
return VIEWITEM_DONOT_ADVANCE;
}
Class actionClass;
@@ -459,19 +460,19 @@
try {
actionClass = bundle.loadClass(className);
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_LOADING_CLASS_FOR_ACTION, new Object[] {className});
+ String message = NLS.bind(Messages.ERROR_LOADING_CLASS_FOR_ACTION, (new Object[] {className}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_RUNNING_ACTION), status);
+ org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, Messages.ERROR_RUNNING_ACTION, status);
return VIEWITEM_DONOT_ADVANCE;
}
try {
action = (IAction) actionClass.newInstance();
} catch (Exception e) {
- String message = CheatSheetPlugin.formatResourceString(ICheatSheetResource.ERROR_CREATING_CLASS_FOR_ACTION, new Object[] {className});
+ String message = NLS.bind(Messages.ERROR_CREATING_CLASS_FOR_ACTION, (new Object[] {className}));
IStatus status = new Status(IStatus.ERROR, ICheatSheetResource.CHEAT_SHEET_PLUGIN_ID, IStatus.OK, message, e);
CheatSheetPlugin.getPlugin().getLog().log(status);
- org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_RUNNING_ACTION), status);
+ org.eclipse.jface.dialogs.ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), null, Messages.ERROR_RUNNING_ACTION, status);
return VIEWITEM_DONOT_ADVANCE;
}
@@ -564,7 +565,7 @@
s.getIconLabel().setImage(null);
if(s.startButton != null) {
s.getStartButton().setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START));
- s.getStartButton().setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.PERFORM_TASK_TOOLTIP));
+ s.getStartButton().setToolTipText(Messages.PERFORM_TASK_TOOLTIP);
}
}
}
@@ -574,7 +575,7 @@
ImageHyperlink startButton = getStartButton();
if (startButton != null) {
startButton.setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_RESTART));
- startButton.setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTART_TASK_TOOLTIP));
+ startButton.setToolTipText(Messages.RESTART_TASK_TOOLTIP);
}
}
@@ -582,7 +583,7 @@
ImageHyperlink startButton = getStartButton();
if (startButton != null) {
startButton.setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START));
- startButton.setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.PERFORM_TASK_TOOLTIP));
+ startButton.setToolTipText(Messages.PERFORM_TASK_TOOLTIP);
}
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
index 470071b..fa211e9 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ErrorPage.java
@@ -31,7 +31,7 @@
String errorString = null;
if(message == null) {
- errorString = CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_PAGE_MESSAGE);
+ errorString = Messages.ERROR_PAGE_MESSAGE;
} else {
errorString = message;
}
@@ -46,6 +46,6 @@
* @param parent the SWT parent for the title area composite
*/
protected String getTitle() {
- return CheatSheetPlugin.getResourceString(ICheatSheetResource.ERROR_LOADING_CHEATSHEET_CONTENT);
+ return Messages.ERROR_LOADING_CHEATSHEET_CONTENT;
}
}
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/IntroItem.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/IntroItem.java
index d947ee6..efca8c0 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/IntroItem.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/IntroItem.java
@@ -33,13 +33,13 @@
/*package*/ void setStartImage() {
startButton.setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_START));
- startButton.setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.START_CHEATSHEET_TOOLTIP));
+ startButton.setToolTipText(Messages.START_CHEATSHEET_TOOLTIP);
// startButton.setFAccessibleName(startButton.getToolTipText());
}
/*package*/ void setRestartImage() {
startButton.setImage(CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_RESTART));
- startButton.setToolTipText(CheatSheetPlugin.getResourceString(ICheatSheetResource.RESTART_CHEATSHEET_TOOLTIP));
+ startButton.setToolTipText(Messages.RESTART_CHEATSHEET_TOOLTIP);
// startButton.setFAccessibleName(startButton.getToolTipText());
}
@@ -64,7 +64,7 @@
filldata.widthHint = 16;
filllabel.setLayoutData(filldata);
- startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_START), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.START_CHEATSHEET_TOOLTIP));
+ startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_START), this, itemColor, Messages.START_CHEATSHEET_TOOLTIP);
toolkit.adapt(startButton, true, true);
startButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
index f400da2..1454987 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java
@@ -17,10 +17,10 @@
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.cheatsheets.*;
import org.eclipse.ui.forms.events.*;
import org.eclipse.ui.forms.widgets.*;
-import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.internal.cheatsheets.*;
import org.eclipse.ui.internal.cheatsheets.data.IParserTags;
import org.eclipse.ui.internal.cheatsheets.data.Item;
@@ -142,7 +142,7 @@
if(item.getContextId() != null || item.getHref() != null) {
// adjust the layout count
number++;
- ImageHyperlink helpButton = createButton(titleComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_HELP), this, itemColor, CheatSheetPlugin.getResourceString(ICheatSheetResource.HELP_BUTTON_TOOLTIP));
+ ImageHyperlink helpButton = createButton(titleComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_HELP), this, itemColor, Messages.HELP_BUTTON_TOOLTIP);
toolkit.adapt(helpButton, true, true);
helpButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
@@ -328,7 +328,7 @@
return;
}
- WorkbenchHelp.displayHelpResource(item.getHref());
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(item.getHref());
}
/**
@@ -346,7 +346,7 @@
Point point = widget.getDisplay().getCursorLocation();
point = new Point(point.x + 15, point.y);
// display the help
- WorkbenchHelp.displayContext(context, point.x, point.y);
+ PlatformUI.getWorkbench().getHelpSystem().displayContext(context, point.x, point.y);
}
}