Author: sflanigan
Date: 2009-03-09 22:13:52 -0400 (Mon, 09 Mar 2009)
New Revision: 14121
Added:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Messages.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/messages.properties
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Constants.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/ImageManager.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Plugin.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ConfigurationManager.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/MacroLibrary.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ProjectClassLoader.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/dialogs/ContextValueDialog.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/CompletionProcessor.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/ContentScanner.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/Editor.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/FreemarkerMultiPageEditor.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/MacroHyperlink.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/PartitionScanner.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/XMLTagScanner.java
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/preferences/PreferencePage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
Log:
JBIDE-3557 Externalise English strings in Java code
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-03-10
02:13:52 UTC (rev 14121)
@@ -37,6 +37,9 @@
JBoss_Runtime_List_Field_Editor_Name2=Name:
JBoss_Runtime_Check_Field_Default_Classpath=Customize JBoss ESB runtime jars
JBoss_Preference_Page_Runtimes=JBoss ESB Runtimes
+JBossLibraryListFieldEditor_ActionAdd=&Add
+JBossLibraryListFieldEditor_ActionRemove=&Remove
+JBossLibraryListFieldEditor_LIBRARY_JARS=Library Jars
JBossRuntimeListFieldEditor_ActionAdd=&Add
JBossRuntimeListFieldEditor_ActionEdit=&Edit
JBossRuntimeListFieldEditor_ActionRemove=&Remove
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -72,6 +72,12 @@
public static String JBoss_Runtime_Check_Field_Default_Classpath;
public static String JBoss_Preference_Page_Runtimes;
+ public static String JBossLibraryListFieldEditor_ActionAdd;
+
+ public static String JBossLibraryListFieldEditor_ActionRemove;
+
+ public static String JBossLibraryListFieldEditor_LIBRARY_JARS;
+
public static String JBossRuntimeListFieldEditor_ActionAdd;
public static String JBossRuntimeListFieldEditor_ActionEdit;
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -135,7 +135,7 @@
createCheckButton(root);
jarGroup = new Group(root, SWT.BORDER);
- jarGroup.setText("Library Jars");
+ jarGroup.setText(JBossESBUIMessages.JBossLibraryListFieldEditor_LIBRARY_JARS);
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;
@@ -254,7 +254,7 @@
public Image getImage(Object element) {
if (jarImg == null){
- ImageDescriptor jarImgDesc =
JBossESBUIPlugin.getImageDescriptor("obj16/jar_obj.gif");
+ ImageDescriptor jarImgDesc =
JBossESBUIPlugin.getImageDescriptor("obj16/jar_obj.gif"); //$NON-NLS-1$
jarImg = jarImgDesc.createImage();
}
return jarImg;
@@ -263,7 +263,7 @@
public String getText(Object element) {
String fullName = (String)element;
File jarFile = new File(fullName);
- return jarFile.getName() + " - " + jarFile.getParentFile().toString();
+ return jarFile.getName() + " - " + jarFile.getParentFile().toString();
//$NON-NLS-1$
}
});
@@ -500,13 +500,11 @@
*/
public class AddAction extends BaseAction {
- static final String ACTION_NAME = "&Add";
-
/**
* Constructor create Add action with default name
*/
public AddAction() {
- super(ACTION_NAME);
+ super(JBossESBUIMessages.JBossLibraryListFieldEditor_ActionAdd);
// This action is always available
setEnabled(true);
}
@@ -528,7 +526,7 @@
public void run() {
FileDialog dialog = new FileDialog(Display.getCurrent()
.getActiveShell(), SWT.MULTI);
- dialog.setFilterExtensions(new String[] { "*.jar;*.zip" });
+ dialog.setFilterExtensions(new String[] { "*.jar;*.zip" }); //$NON-NLS-1$
String fileName = dialog.open();
String[] fileNames = dialog.getFileNames();
if (fileName != null) {
@@ -556,13 +554,11 @@
*/
public class RemoveAction extends BaseAction {
- static final String ACTION_NAME = "&Remove";
-
/**
* Create DeleteAction action with default name
*/
public RemoveAction() {
- super(ACTION_NAME);
+ super(JBossESBUIMessages.JBossLibraryListFieldEditor_ActionRemove);
}
@Override
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Constants.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Constants.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Constants.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -23,13 +23,13 @@
public class Constants {
- public static final String COLOR_DIRECTIVE = "color.directive";
- public static final String COLOR_INTERPOLATION = "color.interpolation";
- public static final String COLOR_COMMENT = "color.comment";
- public static final String COLOR_TEXT = "color.text";
- public static final String COLOR_STRING = "color.string";
- public static final String COLOR_XML_TAG = "color.xmlTag";
- public static final String COLOR_XML_COMMENT = "color.xmlComment";
- public static final String COLOR_RELATED_ITEM = "color.oppositeRegion";
- public static final String HIGHLIGHT_RELATED_ITEMS =
"boolean.highlightRelatedItems";
+ public static final String COLOR_DIRECTIVE = "color.directive"; //$NON-NLS-1$
+ public static final String COLOR_INTERPOLATION = "color.interpolation";
//$NON-NLS-1$
+ public static final String COLOR_COMMENT = "color.comment"; //$NON-NLS-1$
+ public static final String COLOR_TEXT = "color.text"; //$NON-NLS-1$
+ public static final String COLOR_STRING = "color.string"; //$NON-NLS-1$
+ public static final String COLOR_XML_TAG = "color.xmlTag"; //$NON-NLS-1$
+ public static final String COLOR_XML_COMMENT = "color.xmlComment";
//$NON-NLS-1$
+ public static final String COLOR_RELATED_ITEM = "color.oppositeRegion";
//$NON-NLS-1$
+ public static final String HIGHLIGHT_RELATED_ITEMS =
"boolean.highlightRelatedItems"; //$NON-NLS-1$
}
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/ImageManager.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/ImageManager.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/ImageManager.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -28,10 +28,10 @@
*/
public class ImageManager {
- public static final String IMG_MACRO =
"icons/userdefined_directive_call.gif";
- public static final String IMG_IMPORT = "icons/import.gif";
- public static final String IMG_IMPORT_COLLECTION =
"icons/import_collection.gif";
- public static final String IMG_FUNCTION = "icons/function.gif";
+ public static final String IMG_MACRO = "icons/userdefined_directive_call.gif";
//$NON-NLS-1$
+ public static final String IMG_IMPORT = "icons/import.gif"; //$NON-NLS-1$
+ public static final String IMG_IMPORT_COLLECTION =
"icons/import_collection.gif"; //$NON-NLS-1$
+ public static final String IMG_FUNCTION = "icons/function.gif"; //$NON-NLS-1$
public static Image getImage(String filename) {
Added:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Messages.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Messages.java
(rev 0)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Messages.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -0,0 +1,47 @@
+package org.jboss.ide.eclipse.freemarker;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.ide.eclipse.freemarker.messages"; //$NON-NLS-1$
+ public static String ConfigurationManager_CHOOSE_NAMESPACE_FOR;
+ public static String ConfigurationManager_TITLE_CHOOSE_NAMESPACE;
+ public static String ContextValueDialog_BUTTON_BROWSE;
+ public static String ContextValueDialog_ERROR;
+ public static String ContextValueDialog_JAVA_PROJECT_ERROR;
+ public static String ContextValueDialog_LABEL_LIST_ENTRY_TYPE;
+ public static String ContextValueDialog_LABEL_NAME;
+ public static String ContextValueDialog_LABEL_TYPE;
+ public static String ContextValueDialog_MUST_BE_JAVA_PROJECT;
+ public static String ContextValueDialog_MUST_CHOOSE_CLASS;
+ public static String ContextValueDialog_MUST_CHOOSE_REFERENCE;
+ public static String ContextValueDialog_SHELL_CONTEXT_VALUE_CONFIG;
+ public static String FreemarkerMultiPageEditor_BUTTON_DELETE;
+ public static String FreemarkerMultiPageEditor_BUTTON_EDIT;
+ public static String FreemarkerMultiPageEditor_BUTTON_NEW;
+ public static String FreemarkerMultiPageEditor_COLUMN_NAME;
+ public static String FreemarkerMultiPageEditor_COLUMN_TYPE;
+ public static String FreemarkerMultiPageEditor_CONFIRMATION_TITLE;
+ public static String FreemarkerMultiPageEditor_CONFIRMATION_TO_DELETE_MESSAGE;
+ public static String FreemarkerMultiPageEditor_ERROR_CREATING_VEDITOR;
+ public static String FreemarkerMultiPageEditor_PAGE_TEXT_CONTEXT;
+ public static String FreemarkerMultiPageEditor_PAGE_TEXT_SOURCE;
+ public static String MacroHyperlink_TYPELABEL_MACRO_DEFINITION;
+ public static String PreferencePage_DESCRIPTION_FREEMARKER_SETTINGS;
+ public static String PreferencePage_FIELD_COMMENT;
+ public static String PreferencePage_FIELD_DIRECTIVE;
+ public static String PreferencePage_FIELD_HIGHLIGHT_RELATED_DIRECTIVES;
+ public static String PreferencePage_FIELD_HTML_XML_COMMENT;
+ public static String PreferencePage_FIELD_HTML_XML_TAG;
+ public static String PreferencePage_FIELD_INTERPOLATION;
+ public static String PreferencePage_FIELD_RELATED_DIRECTIVES;
+ public static String PreferencePage_FIELD_STRING;
+ public static String PreferencePage_FIELD_TEXT;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Plugin.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Plugin.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/Plugin.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -50,7 +50,7 @@
*/
public class Plugin extends AbstractUIPlugin {
- public static final String ID = "org.jboss.ide.eclipse.freemarker";
+ public static final String ID = "org.jboss.ide.eclipse.freemarker";
//$NON-NLS-1$
//The shared instance.
private static Plugin plugin;
@@ -61,7 +61,7 @@
super();
plugin = this;
try {
- resourceBundle =
ResourceBundle.getBundle("org.jboss.ide.eclipse.freemarker.resources");
+ resourceBundle =
ResourceBundle.getBundle("org.jboss.ide.eclipse.freemarker.resources");
//$NON-NLS-1$
} catch (MissingResourceException x) {
resourceBundle = null;
}
@@ -107,14 +107,14 @@
protected void initializeDefaultPluginPreferences() {
Preferences prefs = getPluginPreferences();
prefs.setDefault(Constants.HIGHLIGHT_RELATED_ITEMS, true);
- prefs.setDefault(Constants.COLOR_COMMENT, "170,0,0");
- prefs.setDefault(Constants.COLOR_TEXT, "0,0,0");
- prefs.setDefault(Constants.COLOR_INTERPOLATION, "255,0,128");
- prefs.setDefault(Constants.COLOR_DIRECTIVE, "0,0,255");
- prefs.setDefault(Constants.COLOR_STRING, "0,128,128");
- prefs.setDefault(Constants.COLOR_XML_COMMENT, "128,128,128");
- prefs.setDefault(Constants.COLOR_XML_TAG, "0,0,128");
- prefs.setDefault(Constants.COLOR_RELATED_ITEM, "255,255,128");
+ prefs.setDefault(Constants.COLOR_COMMENT, "170,0,0"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_TEXT, "0,0,0"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_INTERPOLATION, "255,0,128"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_DIRECTIVE, "0,0,255"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_STRING, "0,128,128"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_XML_COMMENT, "128,128,128"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_XML_TAG, "0,0,128"); //$NON-NLS-1$
+ prefs.setDefault(Constants.COLOR_RELATED_ITEM, "255,255,128"); //$NON-NLS-1$
}
public static void error (Throwable t) {
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ConfigurationManager.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ConfigurationManager.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ConfigurationManager.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -25,6 +25,7 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -43,6 +44,7 @@
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.Plugin;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -86,11 +88,13 @@
if (obj instanceof IFile) {
IFile file = (IFile) obj;
String namespace = file.getName();
- int index = namespace.indexOf(".");
+ int index = namespace.indexOf("."); //$NON-NLS-1$
if (index >= 0) namespace = namespace.substring(0, index);
InputDialog inputDialog = new InputDialog(
- shell, "Choose Macro Library Namespace",
- "Please choose the namespace for '" + file.getName() +
"'",
+ shell, Messages.ConfigurationManager_TITLE_CHOOSE_NAMESPACE,
+ MessageFormat.format(
+ Messages.ConfigurationManager_CHOOSE_NAMESPACE_FOR, file
+ .getName()),
namespace, null);
int rtn = inputDialog.open();
if (rtn == IDialogConstants.OK_ID) {
@@ -109,11 +113,13 @@
else if (obj instanceof JarEntryFile) {
JarEntryFile jef = (JarEntryFile) obj;
String namespace = jef.getName();
- int index = namespace.indexOf(".");
+ int index = namespace.indexOf("."); //$NON-NLS-1$
if (index >= 0) namespace = namespace.substring(0, index);
InputDialog inputDialog = new InputDialog(
- shell, "Choose Macro Library Namespace",
- "Please choose the namespace for '" + jef.getName() +
"'",
+ shell, Messages.ConfigurationManager_TITLE_CHOOSE_NAMESPACE,
+ MessageFormat.format(
+ Messages.ConfigurationManager_CHOOSE_NAMESPACE_FOR, jef
+ .getName()),
namespace, null);
int rtn = inputDialog.open();
if (rtn == IDialogConstants.OK_ID) {
@@ -146,7 +152,7 @@
private void writeMacroLibrary(StringBuffer sb) {
for (Iterator i=macroLibrary.values().iterator(); i.hasNext(); ) {
MacroLibrary macroLibrary = (MacroLibrary) i.next();
- sb.append("\t\t" + macroLibrary.toXML() + "\n");
+ sb.append("\t\t" + macroLibrary.toXML() + "\n"); //$NON-NLS-1$
//$NON-NLS-2$
}
}
@@ -154,7 +160,7 @@
Map map = new HashMap();
try {
NodeList nl = element
- .getElementsByTagName("entry");
+ .getElementsByTagName("entry"); //$NON-NLS-1$
for (int i = 0; i < nl.getLength(); i++) {
try {
Node n = nl.item(i);
@@ -186,21 +192,21 @@
Map map = new HashMap();
try {
NodeList nl = element
- .getElementsByTagName("resource");
+ .getElementsByTagName("resource"); //$NON-NLS-1$
for (int i = 0; i < nl.getLength(); i++) {
try {
Node n = nl.item(i);
- String path = ((Element) n).getAttribute("path");
+ String path = ((Element) n).getAttribute("path");
//$NON-NLS-1$
List contextValues = new ArrayList();
NodeList nl2 = ((Element) n)
- .getElementsByTagName("value");
+ .getElementsByTagName("value"); //$NON-NLS-1$
for (int j = 0; j < nl2.getLength(); j++) {
Node n2 = nl2.item(j);
- String key = ((Element) n2).getAttribute("key");
+ String key = ((Element) n2).getAttribute("key");
//$NON-NLS-1$
Class value = getClass(((Element) n2)
- .getAttribute("object-class"));
+ .getAttribute("object-class")); //$NON-NLS-1$
String singularName = ((Element) n2)
- .getAttribute("item-class");
+ .getAttribute("item-class"); //$NON-NLS-1$
Class singularClass = null;
if (null != singularName &&
singularName.trim().length()>0)
singularClass = getClass(singularName);
@@ -235,15 +241,15 @@
private void save() {
StringBuffer sb = new StringBuffer();
- sb.append("<config>\n");
- sb.append("\t<context-values>\n");
+ sb.append("<config>\n"); //$NON-NLS-1$
+ sb.append("\t<context-values>\n"); //$NON-NLS-1$
writeContextValues(sb);
- sb.append("\t</context-values>\n");
- sb.append("\t<macro-library>\n");
+ sb.append("\t</context-values>\n"); //$NON-NLS-1$
+ sb.append("\t<macro-library>\n"); //$NON-NLS-1$
writeMacroLibrary(sb);
- sb.append("\t</macro-library>\n");
- sb.append("</config>");
- IFile file = project.getFile(".freemarker-ide.xml");
+ sb.append("\t</macro-library>\n"); //$NON-NLS-1$
+ sb.append("</config>"); //$NON-NLS-1$
+ IFile file = project.getFile(".freemarker-ide.xml"); //$NON-NLS-1$
try {
if (file.exists())
file.setContents(new ByteArrayInputStream(sb.toString()
@@ -259,7 +265,7 @@
public void reload() {
this.projectClassLoader = null;
- IFile file = project.getFile(".freemarker-ide.xml");
+ IFile file = project.getFile(".freemarker-ide.xml"); //$NON-NLS-1$
if (file.exists()) {
try { file.refreshLocal(1, null); } catch (CoreException e) {}
Map map = new HashMap();
@@ -267,13 +273,14 @@
Document document = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(file.getContents());
NodeList nl = document.getDocumentElement()
- .getElementsByTagName("context-values");
+ .getElementsByTagName("context-values"); //$NON-NLS-1$
if (nl.getLength() > 0)
this.contextValues = loadContextValues((Element) nl.item(0));
else
this.contextValues = new HashMap();
nl = document.getDocumentElement()
- .getElementsByTagName("macro-library");
+ .getElementsByTagName(
+ "macro-library"); //$NON-NLS-1$
List libraries = new ArrayList();
if (nl.getLength() > 0) {
this.macroLibrary = loadMacroTemplates((Element) nl.item(0));
@@ -296,17 +303,18 @@
String fileName = (String) entry.getKey();
ContextValue[] values = (ContextValue[]) entry.getValue();
if (null != values && values.length > 0) {
- sb.append("\t\t<resource path=\"" + fileName +
"\">\n");
+ sb.append("\t\t<resource path=\"" + fileName +
"\">\n"); //$NON-NLS-1$//$NON-NLS-2$
for (int j = 0; j < values.length; j++) {
- sb.append("\t\t\t<value key=\"" + values[j].name
- + "\" object-class=\"" +
values[j].objClass.getName()
- + "\"");
+ sb
+ .append("\t\t\t<value key=\"" + values[j].name //$NON-NLS-1$
+ + "\" object-class=\"" + values[j].objClass.getName()
//$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
if (null != values[j].singularClass)
- sb.append(" item-class=\""
- + values[j].singularClass.getName() +
"\"");
- sb.append("/>\n");
+ sb.append(" item-class=\"" //$NON-NLS-1$
+ + values[j].singularClass.getName() + "\""); //$NON-NLS-1$
+ sb.append("/>\n"); //$NON-NLS-1$
}
- sb.append("\t\t</resource>\n");
+ sb.append("\t\t</resource>\n"); //$NON-NLS-1$
}
}
}
@@ -323,7 +331,8 @@
key = resource.getProjectRelativePath().toString();
if (recurse) addRootContextValues(resource.getParent(), newValues, true);
}
- else key = "";
+ else
+ key = ""; //$NON-NLS-1$
if (null != resource.getProject()) {
ContextValue[] values = (ContextValue[]) contextValues.get(key);
if (null != values) {
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/MacroLibrary.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/MacroLibrary.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/MacroLibrary.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -43,8 +43,8 @@
*/
public class MacroLibrary {
- public static final String TYPE_FILE = "file";
- public static final String TYPE_JAR_ENTRY = "jarEntry";
+ public static final String TYPE_FILE = "file"; //$NON-NLS-1$
+ public static final String TYPE_JAR_ENTRY = "jarEntry"; //$NON-NLS-1$
private long lastUpdatedTime;
private IFile file;
@@ -88,7 +88,7 @@
private void load () {
try {
List macros = new ArrayList();
- String search = "#macro ";
+ String search = "#macro "; //$NON-NLS-1$
int index = content.indexOf(search);
int startIndex = index;
char startChar = content.charAt(index-1);
@@ -157,12 +157,12 @@
public String toXML () {
StringBuffer sb = new StringBuffer();
- sb.append("<entry namespace=\"" + getNamespace() + "\"
");
- sb.append("path=\"" + getPath() + "\" ");
+ sb.append("<entry namespace=\"" + getNamespace() + "\"
"); //$NON-NLS-1$ //$NON-NLS-2$
+ sb.append("path=\"" + getPath() + "\" "); //$NON-NLS-1$
//$NON-NLS-2$
if (null != file) {
- sb.append("project=\"" + file.getProject().getName() + "\"
");
+ sb.append("project=\"" + file.getProject().getName() + "\"
"); //$NON-NLS-1$ //$NON-NLS-2$
}
- sb.append("type=\"" + getType() + "\"/>");
+ sb.append("type=\"" + getType() + "\"/>");
//$NON-NLS-1$//$NON-NLS-2$
return sb.toString();
}
@@ -174,10 +174,10 @@
}
public static MacroLibrary fromXML (IProject project, Element node, ClassLoader
classLoader) throws CoreException, IOException {
- String namespace = node.getAttribute("namespace");
- String path = node.getAttribute("path");
- String projectName = node.getAttribute("project");
- String type = node.getAttribute("type");
+ String namespace = node.getAttribute("namespace"); //$NON-NLS-1$
+ String path = node.getAttribute("path"); //$NON-NLS-1$
+ String projectName = node.getAttribute("project"); //$NON-NLS-1$
+ String type = node.getAttribute("type"); //$NON-NLS-1$
if (null == type || type.length() == 0 || type.equals(TYPE_FILE)) {
if (null != projectName && projectName.length() > 0)
project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ProjectClassLoader.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ProjectClassLoader.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/configuration/ProjectClassLoader.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -60,7 +60,7 @@
IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots();
String installLoc =
ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().getAbsolutePath();
installLoc = installLoc.replace('\\', '/');
- if (installLoc.endsWith("/")) installLoc = installLoc.substring(0,
installLoc.length()-1);
+ if (installLoc.endsWith("/")) installLoc = installLoc.substring(0,
installLoc.length()-1); //$NON-NLS-1$
for (int i=0; i<roots.length; i++) {
try {
@@ -71,18 +71,18 @@
}
else {
String s = roots[i].getPath().toOSString().replace('\\', '/');
- if (!s.startsWith("/")) s = "/" + s;
+ if (!s.startsWith("/")) s = "/" + s; //$NON-NLS-1$
//$NON-NLS-2$
f = new File(installLoc + s);
if (f.exists()) {
list.add(f.toURL());
}
else {
- f = new File("c:" + installLoc + s);
+ f = new File("c:" + installLoc + s); //$NON-NLS-1$
if (f.exists()) {
list.add(f.toURL());
}
else {
- f = new File("d:" + installLoc + s);
+ f = new File("d:" + installLoc + s); //$NON-NLS-1$
if (f.exists()) {
list.add(f.toURL());
}
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/dialogs/ContextValueDialog.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/dialogs/ContextValueDialog.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/dialogs/ContextValueDialog.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -47,6 +47,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SelectionDialog;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.configuration.ConfigurationManager;
import org.jboss.ide.eclipse.freemarker.configuration.ContextValue;
@@ -74,7 +75,7 @@
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
protected void configureShell(Shell newShell) {
- newShell.setText("Context Value Configuration");
+ newShell.setText(Messages.ContextValueDialog_SHELL_CONTEXT_VALUE_CONFIG);
super.configureShell(newShell);
}
@@ -84,7 +85,7 @@
composite.setLayout(new GridLayout(3, false));
Label label = new Label(composite, SWT.NULL);
- label.setText("Name:");
+ label.setText(Messages.ContextValueDialog_LABEL_NAME);
keyText = new Text(composite, SWT.BORDER);
if (null != contextValue) {
keyText.setText(contextValue.name);
@@ -96,7 +97,7 @@
keyText.setLayoutData(gd);
label = new Label(composite, SWT.NULL);
- label.setText("Type:");
+ label.setText(Messages.ContextValueDialog_LABEL_TYPE);
valueText = new Text(composite, SWT.BORDER);
valueText.setEnabled(false);
valueText.setBackground(new Color(null, 255, 255, 255));
@@ -105,7 +106,7 @@
valueText.setLayoutData(gd);
if (null != contextValue && null != contextValue.objClass)
valueText.setText(contextValue.objClass.getName());
Button browse = new Button(composite, 8);
- browse.setText("Browse");
+ browse.setText(Messages.ContextValueDialog_BUTTON_BROWSE);
browse.addMouseListener(new MouseListener() {
public void mouseDown(MouseEvent e)
{
@@ -124,10 +125,10 @@
valueText.setText(type.getFullyQualifiedName());
String[] interfaces = type.getSuperInterfaceNames();
boolean isList = false;
- if ("java.lang.Object".equals(fullyQualifiedName))
isList = true;
+ if ("java.lang.Object".equals(fullyQualifiedName))
isList = true; //$NON-NLS-1$
else {
for (int i=0; i<interfaces.length; i++) {
- if
(interfaces[i].equals("java.util.Collection") ||
interfaces[i].equals("java.util.List") ||
interfaces[i].equals("java.util.Set")) {
+ if
(interfaces[i].equals("java.util.Collection") ||
interfaces[i].equals("java.util.List") ||
interfaces[i].equals("java.util.Set")) { //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
isList = true;
break;
}
@@ -142,12 +143,12 @@
singleBrowse.setEnabled(false);
singleLabel.setEnabled(false);
singleValueText.setEnabled(false);
- singleValueText.setText("");
+ singleValueText.setText(""); //$NON-NLS-1$
}
}
}
else {
- MessageDialog.openError(getShell(), "Java Project
Error", "The project must be a java project.");
+ MessageDialog.openError(getShell(),
Messages.ContextValueDialog_JAVA_PROJECT_ERROR,
Messages.ContextValueDialog_MUST_BE_JAVA_PROJECT);
}
}
catch(JavaModelException _ex) { }
@@ -167,7 +168,7 @@
if (null != contextValue && null != contextValue.singularClass) enabled =
true;
singleLabel = new Label(composite, SWT.NULL);
singleLabel.setEnabled(enabled);
- singleLabel.setText("List Entry Type:");
+ singleLabel.setText(Messages.ContextValueDialog_LABEL_LIST_ENTRY_TYPE);
singleValueText = new Text(composite, SWT.BORDER);
singleValueText.setEnabled(enabled);
singleValueText.setBackground(new Color(null, 255, 255, 255));
@@ -177,7 +178,7 @@
if (enabled) singleValueText.setText(contextValue.singularClass.getName());
singleBrowse = new Button(composite, 8);
singleBrowse.setEnabled(enabled);
- singleBrowse.setText("Browse");
+ singleBrowse.setText(Messages.ContextValueDialog_BUTTON_BROWSE);
singleBrowse.addMouseListener(new MouseListener() {
public void mouseDown(MouseEvent e)
{
@@ -196,7 +197,7 @@
}
}
else {
- MessageDialog.openError(getShell(), "Java Project
Error", "The project must be a java project.");
+ MessageDialog.openError(getShell(),
Messages.ContextValueDialog_JAVA_PROJECT_ERROR,
Messages.ContextValueDialog_MUST_BE_JAVA_PROJECT);
}
}
catch(JavaModelException _ex) { }
@@ -217,10 +218,10 @@
protected void okPressed() {
try {
String name = keyText.getText().trim();
- while (name.startsWith("$")) name = name.substring(1, name.length());
- if (name.length() == 0) MessageDialog.openError(getShell(), "Error",
"You must choose the reference name");
+ while (name.startsWith("$")) name = name.substring(1, name.length());
//$NON-NLS-1$
+ if (name.length() == 0) MessageDialog.openError(getShell(),
Messages.ContextValueDialog_ERROR, Messages.ContextValueDialog_MUST_CHOOSE_REFERENCE);
String className = valueText.getText().trim();
- if (className.length() == 0) MessageDialog.openError(getShell(), "Error",
"You must choose the class name");
+ if (className.length() == 0) MessageDialog.openError(getShell(),
Messages.ContextValueDialog_ERROR, Messages.ContextValueDialog_MUST_CHOOSE_CLASS);
String singularClassName = singleValueText.getText().trim();
Class singularClass = null;
if (null != singularClassName && singularClassName.trim().length() > 0)
singularClass =
ConfigurationManager.getInstance(resource.getProject()).getClass(singularClassName);
@@ -232,7 +233,7 @@
ConfigurationManager.getInstance(resource.getProject()).addContextValue(contextValue,
resource);
}
catch (Exception e) {
- MessageDialog.openError(getShell(), "Error", e.getMessage());
+ MessageDialog.openError(getShell(), Messages.ContextValueDialog_ERROR,
e.getMessage());
}
super.okPressed();
}
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/CompletionProcessor.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/CompletionProcessor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/CompletionProcessor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -106,9 +106,9 @@
Item stackItem = editor.getItemSet().getPreviousStartItem(offset);
StringBuffer value = new StringBuffer();
if (null != stackItem && stackItem instanceof MacroInstance)
- value.append("@");
+ value.append("@"); //$NON-NLS-1$
else
- value.append("#");
+ value.append("#"); //$NON-NLS-1$
String name = null;
if (null != stackItem) name = stackItem.getFirstToken();
if (null != name)
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/ContentScanner.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/ContentScanner.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/ContentScanner.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -72,10 +72,10 @@
this.tokens.clear();
}
- private static String TYPE_UNKNOWN = "UNKNOWN";
- private static String TYPE_INTERPOLATION = "INTERPOLATION";
- private static String TYPE_DIRECTIVE = "DIRECTIVE";
- private static String TYPE_STRING = "STRING";
+ private static String TYPE_UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
+ private static String TYPE_INTERPOLATION = "INTERPOLATION"; //$NON-NLS-1$
+ private static String TYPE_DIRECTIVE = "DIRECTIVE"; //$NON-NLS-1$
+ private static String TYPE_STRING = "STRING"; //$NON-NLS-1$
private static IToken STRING_TOKEN;
private static IToken INTERPOLATION_TOKEN;
@@ -150,11 +150,11 @@
}
else if (c == '(') {
if (type.equals(TYPE_INTERPOLATION)) {
- push("(");
+ push("("); //$NON-NLS-1$
}
}
else if (c == ')') {
- if (type.equals("(")) {
+ if (type.equals("(")) { //$NON-NLS-1$
pop();
}
}
@@ -244,7 +244,7 @@
private IToken getToken (String type) {
if (type.equals(TYPE_DIRECTIVE)) return DIRECTIVE_TOKEN;
- else if (type.equals(TYPE_INTERPOLATION) || type.equals("(")) return
INTERPOLATION_TOKEN;
+ else if (type.equals(TYPE_INTERPOLATION) || type.equals("(")) return
INTERPOLATION_TOKEN; //$NON-NLS-1$
else if (type.equals(TYPE_STRING)) return STRING_TOKEN;
else return defaultToken;
}
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/Editor.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/Editor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/Editor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -54,6 +54,7 @@
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.jboss.ide.eclipse.freemarker.Constants;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.Plugin;
import org.jboss.ide.eclipse.freemarker.configuration.ConfigurationManager;
import org.jboss.ide.eclipse.freemarker.model.Item;
@@ -130,9 +131,9 @@
// Add content assist propsal action
ContentAssistAction action = new ContentAssistAction(
Plugin.getDefault().getResourceBundle(),
- "FreemarkerEditor.ContentAssist", this);
+ "FreemarkerEditor.ContentAssist", this); //$NON-NLS-1$
action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- setAction("FreemarkerEditor.ContentAssist", action);
+ setAction("FreemarkerEditor.ContentAssist", action); //$NON-NLS-1$
action.setEnabled(true);
}
@@ -289,7 +290,7 @@
char c = getDocument().getChar(getCaretOffset());
if (c == ']') {
// remove this
- getDocument().replace(getCaretOffset(), 1, "");
+ getDocument().replace(getCaretOffset(), 1, ""); //$NON-NLS-1$
}
}
catch (BadLocationException e1) {}
@@ -299,7 +300,7 @@
char c = getDocument().getChar(getCaretOffset());
if (c == '}') {
// remove this
- getDocument().replace(getCaretOffset(), 1, "}");
+ getDocument().replace(getCaretOffset(), 1, "}"); //$NON-NLS-1$
}
}
catch (BadLocationException e1) {}
@@ -348,11 +349,11 @@
if (i == '}') return;
else if (i == '\n') break;
}
- getSourceViewer().getDocument().replace(offset, 0, "}");
+ getSourceViewer().getDocument().replace(offset, 0, "}"); //$NON-NLS-1$
}
}
else {
- getSourceViewer().getDocument().replace(offset, 0, "}");
+ getSourceViewer().getDocument().replace(offset, 0, "}"); //$NON-NLS-1$
}
}
}
@@ -400,13 +401,6 @@
}
}
- private void showMessage (String text) {
- MessageDialog.openError(
- getSourceViewer().getTextWidget().getShell(),
- "message",
- text);
- }
-
public static Validator VALIDATOR;
public synchronized void validateContents () {
if (null == VALIDATOR) {
@@ -452,10 +446,10 @@
errorLine = e.getLineNumber();
if (errorLine == 0) {
// sometimes they forget to put it in
- int index = e.getMessage().indexOf("line: ");
+ int index = e.getMessage().indexOf("line: "); //$NON-NLS-1$
if (index > 0) {
- int index2 = e.getMessage().indexOf(" ", index+6);
- int index3 = e.getMessage().indexOf(",", index+6);
+ int index2 = e.getMessage().indexOf(" ", index+6); //$NON-NLS-1$
+ int index3 = e.getMessage().indexOf(",", index+6); //$NON-NLS-1$
if (index3 < index2 && index3 > 0) index2 = index3;
String s = e.getMessage().substring(index+6, index2);
try {
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/FreemarkerMultiPageEditor.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/FreemarkerMultiPageEditor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/FreemarkerMultiPageEditor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -64,6 +64,7 @@
import org.eclipse.ui.texteditor.IStatusField;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.Plugin;
import org.jboss.ide.eclipse.freemarker.configuration.ConfigurationManager;
import org.jboss.ide.eclipse.freemarker.configuration.ContextValue;
@@ -74,7 +75,7 @@
*/
public class FreemarkerMultiPageEditor extends MultiPageEditorPart implements
ITextEditor, ITextEditorExtension {
- public static final String ID =
"org.jboss.ide.eclipse.freemarker.editor.FreemarkerEditor";
+ public static final String ID =
"org.jboss.ide.eclipse.freemarker.editor.FreemarkerEditor"; //$NON-NLS-1$
private Editor vEditor;
private String text;
@@ -98,11 +99,11 @@
vEditor.init(getEditorSite(), getEditorInput());
if (readOnly) vEditor.setReadOnly(readOnly);
int index = addPage(vEditor, getEditorInput());
- setPageText(index, "Source");
+ setPageText(index, Messages.FreemarkerMultiPageEditor_PAGE_TEXT_SOURCE);
setPartName(vEditor.getTitle());
}
catch (PartInitException e) {
- ErrorDialog.openError(getSite().getShell(), "Error creating nested text
vEditor", null, e.getStatus());
+ ErrorDialog.openError(getSite().getShell(),
Messages.FreemarkerMultiPageEditor_ERROR_CREATING_VEDITOR, null, e.getStatus());
}
}
@@ -143,8 +144,8 @@
// create the columns
TableColumn keyColumn = new TableColumn(contextValuesTable, SWT.LEFT);
TableColumn valueColumn = new TableColumn(contextValuesTable, SWT.LEFT);
- keyColumn.setText("Name");
- valueColumn.setText("Type");
+ keyColumn.setText(Messages.FreemarkerMultiPageEditor_COLUMN_NAME);
+ valueColumn.setText(Messages.FreemarkerMultiPageEditor_COLUMN_TYPE);
ColumnLayoutData keyColumnLayout = new ColumnWeightData(30, false);
ColumnLayoutData valueColumnLayout = new ColumnWeightData(70, false);
@@ -169,7 +170,7 @@
buttonComposite.setLayout(gl);
buttonComposite.setVisible(true);
addContextValueButton = new Button(buttonComposite, SWT.NATIVE);
- addContextValueButton.setText("New");
+ addContextValueButton.setText(Messages.FreemarkerMultiPageEditor_BUTTON_NEW);
addContextValueButton.setVisible(true);
addContextValueButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
addContextValueButton.addSelectionListener(new AddContextValueButtonListener());
@@ -178,7 +179,7 @@
data.grabExcessHorizontalSpace = true;
addContextValueButton.setLayoutData(data);
editContextValueButton = new Button(buttonComposite, SWT.NATIVE);
- editContextValueButton.setText("Edit");
+ editContextValueButton.setText(Messages.FreemarkerMultiPageEditor_BUTTON_EDIT);
editContextValueButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
editContextValueButton.addSelectionListener(new EditContextValueButtonListener());
data = new GridData();
@@ -186,7 +187,7 @@
data.grabExcessHorizontalSpace = true;
editContextValueButton.setLayoutData(data);
deleteContextValueButton = new Button(buttonComposite, SWT.NATIVE);
- deleteContextValueButton.setText("Delete");
+ deleteContextValueButton.setText(Messages.FreemarkerMultiPageEditor_BUTTON_DELETE);
deleteContextValueButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
deleteContextValueButton.addSelectionListener(new ContextValueDeleteKeyListener());
data = new GridData();
@@ -196,7 +197,7 @@
reloadContextValues();
int index = addPage(composite);
- setPageText(index, "Context");
+ setPageText(index, Messages.FreemarkerMultiPageEditor_PAGE_TEXT_CONTEXT);
}
@@ -278,7 +279,7 @@
int index = contextValuesTable.getSelectionIndex();
if (index >= 0) {
try {
- boolean confirm = MessageDialog.openConfirm(new Shell(), "Confirmation",
"Are you sure you want to delete this context value?");
+ boolean confirm = MessageDialog.openConfirm(new Shell(),
Messages.FreemarkerMultiPageEditor_CONFIRMATION_TITLE,
Messages.FreemarkerMultiPageEditor_CONFIRMATION_TO_DELETE_MESSAGE);
if (confirm) {
String key = contextValuesTable.getSelection()[0].getText(0);
ContextValue value =
ConfigurationManager.getInstance(vEditor.getFile().getProject()).getContextValue(key,
vEditor.getFile(), false);
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/MacroHyperlink.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/MacroHyperlink.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/MacroHyperlink.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -28,6 +28,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.Plugin;
import org.jboss.ide.eclipse.freemarker.model.MacroInstance;
@@ -67,6 +68,6 @@
}
public String getTypeLabel() {
- return "Macro Definition";
+ return Messages.MacroHyperlink_TYPELABEL_MACRO_DEFINITION;
}
}
\ No newline at end of file
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/PartitionScanner.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/PartitionScanner.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/PartitionScanner.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -45,42 +45,42 @@
*/
public class PartitionScanner extends RuleBasedPartitionScanner {
- public final static String FTL_COMMENT = "__ftl_comment";
- public final static String FTL_INCLUDE = "__ftl_include";
- public final static String FTL_IMPORT = "__ftl_import";
- public final static String FTL_ASSIGN = "__ftl_assign";
- public final static String FTL_ASSIGN_END = "__ftl_assign_end";
- public final static String FTL_LOCAL = "__ftl_local";
- public final static String FTL_LOCAL_END = "__ftl_local_end";
- public final static String FTL_GLOBAL = "__ftl_global";
- public final static String FTL_GLOBAL_END = "__ftl_global_end";
- public final static String FTL_BREAK = "__ftl_break";
- public final static String FTL_NESTED = "__ftl_nested";
- public final static String FTL_RETURN = "__ftl_return";
- public final static String FTL_STOP = "__ftl_stop";
- public final static String FTL_FTL_DIRECTIVE = "__ftl_ftl_directive";
- public final static String FTL_FUNCTION_DIRECTIVE_START =
"__ftl_function_directive_start";
- public final static String FTL_FUNCTION_DIRECTIVE_END =
"__ftl_function_directive_end";
- public final static String FTL_LIST_DIRECTIVE_START =
"__ftl_list_directive_start";
- public final static String FTL_LIST_DIRECTIVE_END =
"__ftl_list_directive_end";
- public final static String FTL_MACRO_DIRECTIVE_START =
"__ftl_macro_directive_start";
- public final static String FTL_MACRO_DIRECTIVE_END =
"__ftl_macro_directive_end";
- public final static String FTL_MACRO_INSTANCE_START =
"__ftl_macro_instance_start";
- public final static String FTL_MACRO_INSTANCE_END =
"__ftl_macro_instance_end";
- public final static String FTL_SWITCH_DIRECTIVE_START =
"__ftl_switch_directive_start";
- public final static String FTL_SWITCH_DIRECTIVE_END =
"__ftl_switch_directive_end";
- public final static String FTL_CASE_DIRECTIVE_START =
"__ftl_case_directive_start";
- public final static String FTL_CASE_DEFAULT_START =
"__ftl_case_default_start";
- public final static String FTL_IF_DIRECTIVE_START =
"__ftl_if_directive_start";
- public final static String FTL_IF_DIRECTIVE_END = "__ftl_if_directive_end";
- public final static String FTL_IF_ELSE_DIRECTIVE = "__ftl_if_else_directive";
- public final static String FTL_ELSE_IF_DIRECTIVE = "__ftl_else_if_directive";
- public final static String FTL_INTERPOLATION = "__ftl_interpolation";
- public final static String FTL_DIRECTIVE = "__ftl_directive";
- public final static String FTL_DIRECTIVE_END = "__ftl_directive_end";
- public final static String XML_TAG = "__xml_tag";
- public final static String XML_COMMENT = "__xml_comment";
- public final static String STRING = "__string";
+ public final static String FTL_COMMENT = "__ftl_comment"; //$NON-NLS-1$
+ public final static String FTL_INCLUDE = "__ftl_include"; //$NON-NLS-1$
+ public final static String FTL_IMPORT = "__ftl_import"; //$NON-NLS-1$
+ public final static String FTL_ASSIGN = "__ftl_assign"; //$NON-NLS-1$
+ public final static String FTL_ASSIGN_END = "__ftl_assign_end"; //$NON-NLS-1$
+ public final static String FTL_LOCAL = "__ftl_local"; //$NON-NLS-1$
+ public final static String FTL_LOCAL_END = "__ftl_local_end"; //$NON-NLS-1$
+ public final static String FTL_GLOBAL = "__ftl_global"; //$NON-NLS-1$
+ public final static String FTL_GLOBAL_END = "__ftl_global_end"; //$NON-NLS-1$
+ public final static String FTL_BREAK = "__ftl_break"; //$NON-NLS-1$
+ public final static String FTL_NESTED = "__ftl_nested"; //$NON-NLS-1$
+ public final static String FTL_RETURN = "__ftl_return"; //$NON-NLS-1$
+ public final static String FTL_STOP = "__ftl_stop"; //$NON-NLS-1$
+ public final static String FTL_FTL_DIRECTIVE = "__ftl_ftl_directive";
//$NON-NLS-1$
+ public final static String FTL_FUNCTION_DIRECTIVE_START =
"__ftl_function_directive_start"; //$NON-NLS-1$
+ public final static String FTL_FUNCTION_DIRECTIVE_END =
"__ftl_function_directive_end"; //$NON-NLS-1$
+ public final static String FTL_LIST_DIRECTIVE_START =
"__ftl_list_directive_start"; //$NON-NLS-1$
+ public final static String FTL_LIST_DIRECTIVE_END =
"__ftl_list_directive_end"; //$NON-NLS-1$
+ public final static String FTL_MACRO_DIRECTIVE_START =
"__ftl_macro_directive_start"; //$NON-NLS-1$
+ public final static String FTL_MACRO_DIRECTIVE_END =
"__ftl_macro_directive_end"; //$NON-NLS-1$
+ public final static String FTL_MACRO_INSTANCE_START =
"__ftl_macro_instance_start"; //$NON-NLS-1$
+ public final static String FTL_MACRO_INSTANCE_END =
"__ftl_macro_instance_end"; //$NON-NLS-1$
+ public final static String FTL_SWITCH_DIRECTIVE_START =
"__ftl_switch_directive_start"; //$NON-NLS-1$
+ public final static String FTL_SWITCH_DIRECTIVE_END =
"__ftl_switch_directive_end"; //$NON-NLS-1$
+ public final static String FTL_CASE_DIRECTIVE_START =
"__ftl_case_directive_start"; //$NON-NLS-1$
+ public final static String FTL_CASE_DEFAULT_START =
"__ftl_case_default_start"; //$NON-NLS-1$
+ public final static String FTL_IF_DIRECTIVE_START =
"__ftl_if_directive_start"; //$NON-NLS-1$
+ public final static String FTL_IF_DIRECTIVE_END = "__ftl_if_directive_end";
//$NON-NLS-1$
+ public final static String FTL_IF_ELSE_DIRECTIVE = "__ftl_if_else_directive";
//$NON-NLS-1$
+ public final static String FTL_ELSE_IF_DIRECTIVE = "__ftl_else_if_directive";
//$NON-NLS-1$
+ public final static String FTL_INTERPOLATION = "__ftl_interpolation";
//$NON-NLS-1$
+ public final static String FTL_DIRECTIVE = "__ftl_directive"; //$NON-NLS-1$
+ public final static String FTL_DIRECTIVE_END = "__ftl_directive_end";
//$NON-NLS-1$
+ public final static String XML_TAG = "__xml_tag"; //$NON-NLS-1$
+ public final static String XML_COMMENT = "__xml_comment"; //$NON-NLS-1$
+ public final static String STRING = "__string"; //$NON-NLS-1$
public final static String[] DIRECTIVES = {
FTL_INCLUDE, FTL_IMPORT, FTL_ASSIGN, FTL_ASSIGN_END, FTL_LOCAL, FTL_LOCAL_END,
FTL_GLOBAL,
@@ -124,45 +124,45 @@
IToken ftlComment = new Token(FTL_COMMENT);
- rules.add(new MultiLineRule("<!--", "-->", new
Token(XML_COMMENT)));
- rules.add(new MultiLineRule("<#--", "-->",
ftlComment));
- rules.add(new MultiLineRule("[#--", "--]", ftlComment));
+ rules.add(new MultiLineRule("<!--", "-->", new
Token(XML_COMMENT))); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("<#--", "-->",
ftlComment)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("[#--", "--]", ftlComment));
//$NON-NLS-1$ //$NON-NLS-2$
- rules.add(new DirectiveRule("ftl", new Token(FTL_FTL_DIRECTIVE)));
- rules.add(new DirectiveRule("if", new Token(FTL_IF_DIRECTIVE_START)));
- rules.add(new DirectiveRule("elseif", new
Token(FTL_ELSE_IF_DIRECTIVE)));
- rules.add(new DirectiveRule("else", new Token(FTL_IF_ELSE_DIRECTIVE),
true));
- rules.add(new DirectiveRuleEnd("if", new
Token(FTL_IF_DIRECTIVE_END)));
+ rules.add(new DirectiveRule("ftl", new Token(FTL_FTL_DIRECTIVE)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("if", new Token(FTL_IF_DIRECTIVE_START)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("elseif", new
Token(FTL_ELSE_IF_DIRECTIVE))); //$NON-NLS-1$
+ rules.add(new DirectiveRule("else", new Token(FTL_IF_ELSE_DIRECTIVE),
true)); //$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("if", new Token(FTL_IF_DIRECTIVE_END)));
//$NON-NLS-1$
- rules.add(new DirectiveRule("function", new
Token(FTL_FUNCTION_DIRECTIVE_START)));
- rules.add(new DirectiveRuleEnd("function", new
Token(FTL_FUNCTION_DIRECTIVE_END)));
+ rules.add(new DirectiveRule("function", new
Token(FTL_FUNCTION_DIRECTIVE_START))); //$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("function", new
Token(FTL_FUNCTION_DIRECTIVE_END))); //$NON-NLS-1$
- rules.add(new DirectiveRule("list", new
Token(FTL_LIST_DIRECTIVE_START)));
- rules.add(new DirectiveRuleEnd("list", new
Token(FTL_LIST_DIRECTIVE_END)));
+ rules.add(new DirectiveRule("list", new
Token(FTL_LIST_DIRECTIVE_START))); //$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("list", new
Token(FTL_LIST_DIRECTIVE_END))); //$NON-NLS-1$
- rules.add(new DirectiveRule("macro", new
Token(FTL_MACRO_DIRECTIVE_START)));
- rules.add(new DirectiveRuleEnd("macro", new
Token(FTL_MACRO_DIRECTIVE_END)));
+ rules.add(new DirectiveRule("macro", new
Token(FTL_MACRO_DIRECTIVE_START))); //$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("macro", new
Token(FTL_MACRO_DIRECTIVE_END))); //$NON-NLS-1$
rules.add(new MacroInstanceRule(new Token(FTL_MACRO_INSTANCE_START)));
rules.add(new MacroInstanceRuleEnd(new Token(FTL_MACRO_INSTANCE_END)));
- rules.add(new DirectiveRule("switch", new
Token(FTL_SWITCH_DIRECTIVE_START)));
- rules.add(new DirectiveRuleEnd("switch", new
Token(FTL_SWITCH_DIRECTIVE_END)));
- rules.add(new DirectiveRule("case", new
Token(FTL_CASE_DIRECTIVE_START)));
- rules.add(new DirectiveRule("default", new
Token(FTL_CASE_DEFAULT_START)));
+ rules.add(new DirectiveRule("switch", new
Token(FTL_SWITCH_DIRECTIVE_START))); //$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("switch", new
Token(FTL_SWITCH_DIRECTIVE_END))); //$NON-NLS-1$
+ rules.add(new DirectiveRule("case", new
Token(FTL_CASE_DIRECTIVE_START))); //$NON-NLS-1$
+ rules.add(new DirectiveRule("default", new
Token(FTL_CASE_DEFAULT_START))); //$NON-NLS-1$
- rules.add(new DirectiveRule("assign", new Token(FTL_ASSIGN)));
- rules.add(new DirectiveRuleEnd("assign", new Token(FTL_ASSIGN_END)));
- rules.add(new DirectiveRule("local", new Token(FTL_LOCAL)));
- rules.add(new DirectiveRuleEnd("local", new Token(FTL_LOCAL_END)));
- rules.add(new DirectiveRule("global", new Token(FTL_GLOBAL)));
- rules.add(new DirectiveRuleEnd("global", new Token(FTL_GLOBAL_END)));
+ rules.add(new DirectiveRule("assign", new Token(FTL_ASSIGN)));
//$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("assign", new Token(FTL_ASSIGN_END)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("local", new Token(FTL_LOCAL)));
//$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("local", new Token(FTL_LOCAL_END)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("global", new Token(FTL_GLOBAL)));
//$NON-NLS-1$
+ rules.add(new DirectiveRuleEnd("global", new Token(FTL_GLOBAL_END)));
//$NON-NLS-1$
- rules.add(new DirectiveRule("include", new Token(FTL_INCLUDE)));
- rules.add(new DirectiveRule("import", new Token(FTL_IMPORT)));
- rules.add(new DirectiveRule("break", new Token(FTL_BREAK)));
- rules.add(new DirectiveRule("stop", new Token(FTL_STOP)));
- rules.add(new DirectiveRule("nested", new Token(FTL_NESTED)));
- rules.add(new DirectiveRule("return", new Token(FTL_RETURN)));
+ rules.add(new DirectiveRule("include", new Token(FTL_INCLUDE)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("import", new Token(FTL_IMPORT)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("break", new Token(FTL_BREAK)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("stop", new Token(FTL_STOP)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("nested", new Token(FTL_NESTED)));
//$NON-NLS-1$
+ rules.add(new DirectiveRule("return", new Token(FTL_RETURN)));
//$NON-NLS-1$
rules.add(new GenericDirectiveRule(new Token(FTL_DIRECTIVE)));
rules.add(new GenericDirectiveRuleEnd(new Token(FTL_DIRECTIVE_END)));
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/XMLTagScanner.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/XMLTagScanner.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/editor/XMLTagScanner.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -64,12 +64,12 @@
List l = new ArrayList();
- l.add(new StringSubRule("\"", "${", 2, string));
+ l.add(new StringSubRule("\"", "${", 2, string)); //$NON-NLS-1$
//$NON-NLS-2$
l.add(new InterpolationRule('$', interpolation));
l.add(new InterpolationRule('#', interpolation));
- l.add(new SingleLineRule("\"", "\"", string,
'\\'));
- l.add(new SingleLineRule("'", "'", string, '\\'));
+ l.add(new SingleLineRule("\"", "\"", string,
'\\')); //$NON-NLS-1$ //$NON-NLS-2$
+ l.add(new SingleLineRule("'", "'", string, '\\'));
//$NON-NLS-1$ //$NON-NLS-2$
l.add(new WhitespaceRule(new WhitespaceDetector()));
setRules((IRule[]) l.toArray(new IRule[l.size()]));
Added:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/messages.properties
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/messages.properties
(rev 0)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/messages.properties 2009-03-10
02:13:52 UTC (rev 14121)
@@ -0,0 +1,33 @@
+ConfigurationManager_CHOOSE_NAMESPACE_FOR=Please choose the namespace for '{0}'
+ConfigurationManager_TITLE_CHOOSE_NAMESPACE=Choose Macro Library Namespace
+ContextValueDialog_BUTTON_BROWSE=Browse
+ContextValueDialog_ERROR=Error
+ContextValueDialog_JAVA_PROJECT_ERROR=Java Project Error
+ContextValueDialog_LABEL_LIST_ENTRY_TYPE=List Entry Type:
+ContextValueDialog_LABEL_NAME=Name:
+ContextValueDialog_LABEL_TYPE=Type:
+ContextValueDialog_MUST_BE_JAVA_PROJECT=The project must be a java project.
+ContextValueDialog_MUST_CHOOSE_CLASS=You must choose the class name
+ContextValueDialog_MUST_CHOOSE_REFERENCE=You must choose the reference name
+ContextValueDialog_SHELL_CONTEXT_VALUE_CONFIG=Context Value Configuration
+FreemarkerMultiPageEditor_BUTTON_DELETE=Delete
+FreemarkerMultiPageEditor_BUTTON_EDIT=Edit
+FreemarkerMultiPageEditor_BUTTON_NEW=New
+FreemarkerMultiPageEditor_COLUMN_NAME=Name
+FreemarkerMultiPageEditor_COLUMN_TYPE=Type
+FreemarkerMultiPageEditor_CONFIRMATION_TITLE=Confirmation
+FreemarkerMultiPageEditor_CONFIRMATION_TO_DELETE_MESSAGE=Are you sure you want to delete
this context value?
+FreemarkerMultiPageEditor_ERROR_CREATING_VEDITOR=Error creating nested text vEditor
+FreemarkerMultiPageEditor_PAGE_TEXT_CONTEXT=Context
+FreemarkerMultiPageEditor_PAGE_TEXT_SOURCE=Source
+MacroHyperlink_TYPELABEL_MACRO_DEFINITION=Macro Definition
+PreferencePage_DESCRIPTION_FREEMARKER_SETTINGS=FreeMarker Settings
+PreferencePage_FIELD_COMMENT=Comment:
+PreferencePage_FIELD_DIRECTIVE=Directive:
+PreferencePage_FIELD_HIGHLIGHT_RELATED_DIRECTIVES=Highlight Related Directives
+PreferencePage_FIELD_HTML_XML_COMMENT=HTML/XML Comment:
+PreferencePage_FIELD_HTML_XML_TAG=HTML/XML Tag:
+PreferencePage_FIELD_INTERPOLATION=Interpolation:
+PreferencePage_FIELD_RELATED_DIRECTIVES=Related Directives:
+PreferencePage_FIELD_STRING=String:
+PreferencePage_FIELD_TEXT=Text:
Modified:
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/preferences/PreferencePage.java
===================================================================
---
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/preferences/PreferencePage.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/src/org/jboss/ide/eclipse/freemarker/preferences/PreferencePage.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -28,6 +28,7 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jboss.ide.eclipse.freemarker.Constants;
+import org.jboss.ide.eclipse.freemarker.Messages;
import org.jboss.ide.eclipse.freemarker.Plugin;
/**
@@ -40,28 +41,28 @@
public PreferencePage() {
super(GRID);
setPreferenceStore(Plugin.getDefault().getPreferenceStore());
- setDescription("FreeMarker Settings");
+ setDescription(Messages.PreferencePage_DESCRIPTION_FREEMARKER_SETTINGS);
}
public void createFieldEditors() {
addField(new ColorFieldEditor(Constants.COLOR_DIRECTIVE,
- "Directive:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_DIRECTIVE, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_RELATED_ITEM,
- "Related Directives:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_RELATED_DIRECTIVES,
getFieldEditorParent()));
addField(new BooleanFieldEditor(Constants.HIGHLIGHT_RELATED_ITEMS,
- "Highlight Related Directives", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_HIGHLIGHT_RELATED_DIRECTIVES,
getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_INTERPOLATION,
- "Interpolation:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_INTERPOLATION, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_TEXT,
- "Text:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_TEXT, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_COMMENT,
- "Comment:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_COMMENT, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_STRING,
- "String:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_STRING, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_XML_TAG,
- "HTML/XML Tag:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_HTML_XML_TAG, getFieldEditorParent()));
addField(new ColorFieldEditor(Constants.COLOR_XML_COMMENT,
- "HTML/XML Comment:", getFieldEditorParent()));
+ Messages.PreferencePage_FIELD_HTML_XML_COMMENT,
getFieldEditorParent()));
}
public void init(IWorkbench workbench) {
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2009-03-10
02:13:52 UTC (rev 14121)
@@ -9,6 +9,10 @@
Error_JBossWS_Basic_Editor_Composite=Parent control should be Composite
Error_JBossWS_Basic_Editor_Support=Editor supports only grid layout
Error_JBossWS_Basic_Editor_Different=Parent for label is different
+JBossRuntimeListFieldEditor_ActionAdd=&Add
+JBossRuntimeListFieldEditor_ActionEdit=&Edit
+JBossRuntimeListFieldEditor_ActionRemove=&Remove
+JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar=The library must contain at least
one jar.
JBossWS_Runtime_List_Field_Editor_Name=Name
JBossWS_Runtime_List_Field_Editor_Version=Version
JBossWS_Runtime_List_Field_Editor_Path=Path
@@ -34,4 +38,7 @@
JBossWS_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBossWS Home Folder
JBossWS_Runtime_List_Field_Editor_Name2=Name:
JBossWS_Runtime_Check_Field_Default_Classpath=Customize JBoss Web Service runtime jars
-JBossWS_Preference_Page_Runtimes=JBossWS Runtimes
\ No newline at end of file
+JBossWS_Preference_Page_Runtimes=JBossWS Runtimes
+JBossWSLibraryListFieldEditor_ActionAdd=&Add
+JBossWSLibraryListFieldEditor_ActionRemove=&Remove
+JBossWSLibraryListFieldEditor_LIBRARY_JARS=Library Jars
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -36,6 +36,14 @@
public static String Error_JBossWS_Basic_Editor_Composite;
public static String Error_JBossWS_Basic_Editor_Support;
public static String Error_JBossWS_Basic_Editor_Different;
+ public static String JBossRuntimeListFieldEditor_ActionAdd;
+
+ public static String JBossRuntimeListFieldEditor_ActionEdit;
+
+ public static String JBossRuntimeListFieldEditor_ActionRemove;
+
+ public static String JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar;
+
public static String JBossWS_Runtime_List_Field_Editor_Name;
public static String JBossWS_Runtime_List_Field_Editor_Version;
public static String JBossWS_Runtime_List_Field_Editor_Path;
@@ -64,6 +72,13 @@
public static String JBossWS_Preference_Page_Runtimes;
+ public static String JBossWSLibraryListFieldEditor_ActionAdd;
+
+ public static String JBossWSLibraryListFieldEditor_ActionRemove;
+
+ public static String JBossWSLibraryListFieldEditor_LIBRARY_JARS;
+
+
static {
NLS.initializeMessages(BUNDLE_NAME, JBossWSUIMessages.class);
}
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossRuntimeListFieldEditor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -409,9 +409,9 @@
public static class JBossWSRuntimeWizardPage extends WizardPage implements
PropertyChangeListener {
- private static final String SRT_NAME = "name";
- private static final String SRT_VERSION = "version";
- private static final String SRT_HOMEDIR = "homeDir";
+ private static final String SRT_NAME = "name"; //$NON-NLS-1$
+ private static final String SRT_VERSION = "version"; //$NON-NLS-1$
+ private static final String SRT_HOMEDIR = "homeDir"; //$NON-NLS-1$
private static final int GL_PARENT_COLUMNS = 1;
private static final int GL_CONTENT_COLUMNS = 3;
@@ -464,7 +464,7 @@
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
- jars = new JBossWSLibraryListFieldEditor("", "", current);
+ jars = new JBossWSLibraryListFieldEditor("", "", current);
//$NON-NLS-1$ //$NON-NLS-2$
jars.doFillIntoGrid(root);
jars.addPropertyChangeListener(this);
setPageComplete(false);
@@ -479,12 +479,12 @@
* PropertyChangeEvent describes changes in wizard
*/
public void propertyChange(java.beans.PropertyChangeEvent evt) {
- if ("homeDir".equals(evt.getPropertyName())) {
+ if ("homeDir".equals(evt.getPropertyName())) { //$NON-NLS-1$
if (name.getValueAsString() == null
- || "".equals(name.getValueAsString().trim())
+ || "".equals(name.getValueAsString().trim()) //$NON-NLS-1$
|| this.getErrorMessage() != null) {
String homeDirName = homeDir.getValueAsString();
- if (homeDirName != null && !"".equals(homeDirName.trim())) {
+ if (homeDirName != null && !"".equals(homeDirName.trim())) {
//$NON-NLS-1$
File folder = new File(homeDirName);
homeDirName = folder.getName();
}
@@ -535,7 +535,7 @@
if (jarJbws.isUserConfigClasspath()
&& jarJbws.getLibraries().size() == 0) {
- setErrorMessage("The library must contian at least one jar.");
+ setErrorMessage(JBossWSUIMessages.JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar);
setPageComplete(false);
return;
}
@@ -573,7 +573,7 @@
*/
private List<String> getESBFacetVersions(){
List<String> versions = new ArrayList<String>();
- IProjectFacet esbfacet =
ProjectFacetsManager.getProjectFacet("jbossws.core");
+ IProjectFacet esbfacet =
ProjectFacetsManager.getProjectFacet("jbossws.core"); //$NON-NLS-1$
for(IProjectFacetVersion version: esbfacet.getVersions()){
versions.add(version.getVersionString());
}
@@ -968,13 +968,11 @@
*/
public class AddAction extends BaseAction {
- static final String ACTION_NAME = "&Add";
-
/**
* Constructor create Add action with default name
*/
public AddAction() {
- super(ACTION_NAME);
+ super(JBossWSUIMessages.JBossRuntimeListFieldEditor_ActionAdd);
// This action is always available
setEnabled(true);
}
@@ -1012,15 +1010,13 @@
*/
public class EditAction extends BaseAction {
- static final String ACTION_NAME = "&Edit";
-
/**
* Create EditAction with default name
*
* @param text
*/
public EditAction() {
- super(ACTION_NAME);
+ super(JBossWSUIMessages.JBossRuntimeListFieldEditor_ActionEdit);
}
/**
@@ -1079,13 +1075,11 @@
*/
public class RemoveAction extends BaseAction {
- static final String ACTION_NAME = "&Remove";
-
/**
* Create DeleteAction action with default name
*/
public RemoveAction() {
- super(ACTION_NAME);
+ super(JBossWSUIMessages.JBossRuntimeListFieldEditor_ActionRemove);
}
@Override
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2009-03-10
02:12:58 UTC (rev 14120)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JBossWSLibraryListFieldEditor.java 2009-03-10
02:13:52 UTC (rev 14121)
@@ -132,7 +132,7 @@
createCheckButton(root);
jarGroup = new Group(root, SWT.NONE);
- jarGroup.setText("Library Jars");
+ jarGroup.setText(JBossWSUIMessages.JBossWSLibraryListFieldEditor_LIBRARY_JARS);
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;
@@ -255,7 +255,7 @@
public Image getImage(Object element) {
if (jarImg == null) {
ImageDescriptor jarImgDesc = JBossWSUIPlugin
- .getImageDescriptor("obj16/jar_obj.gif");
+ .getImageDescriptor("obj16/jar_obj.gif"); //$NON-NLS-1$
jarImg = jarImgDesc.createImage();
}
return jarImg;
@@ -264,7 +264,7 @@
public String getText(Object element) {
String fullName = (String) element;
File jarFile = new File(fullName);
- return jarFile.getName() + " - "
+ return jarFile.getName() + " - " //$NON-NLS-1$
+ jarFile.getParentFile().toString();
}
});
@@ -498,13 +498,11 @@
*/
public class AddAction extends BaseAction {
- static final String ACTION_NAME = "&Add";
-
/**
* Constructor create Add action with default name
*/
public AddAction() {
- super(ACTION_NAME);
+ super(JBossWSUIMessages.JBossWSLibraryListFieldEditor_ActionAdd);
// This action is always available
setEnabled(true);
}
@@ -526,7 +524,7 @@
public void run() {
FileDialog dialog = new FileDialog(Display.getCurrent()
.getActiveShell(), SWT.MULTI);
- dialog.setFilterExtensions(new String[] { "*.jar;*.zip" });
+ dialog.setFilterExtensions(new String[] { "*.jar;*.zip" }); //$NON-NLS-1$
String fileName = dialog.open();
String[] fileNames = dialog.getFileNames();
if (fileName != null) {
@@ -553,13 +551,11 @@
*/
public class RemoveAction extends BaseAction {
- static final String ACTION_NAME = "&Remove";
-
/**
* Create DeleteAction action with default name
*/
public RemoveAction() {
- super(ACTION_NAME);
+ super(JBossWSUIMessages.JBossWSLibraryListFieldEditor_ActionRemove);
}
@Override