Author: sflanigan
Date: 2009-04-07 00:47:20 -0400 (Tue, 07 Apr 2009)
New Revision: 14533
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/Messages.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ImageBundle.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/Messages.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/Messages.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/Messages.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/Messages.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XBundle.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/XmlEditorMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/figures/TitleLabel.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/image.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.debug/src/org/jboss/tools/jst/web/debug/internal/JspLineBreakpoint.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionAttrForwardBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionConditionBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionEnterBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionExceptionBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormPopulateBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormValidateBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionForwardBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionIncludeBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionTilesDefinitionForwardBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalExceptionBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalForwardBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/PageEnterBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/TilesDefinitionGlobalForwardBreakpoint.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/AutomationPreferencePage.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsStudioPreferencesPage.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteUIMessages.java
Log:
JBIDE-3557 Externalise English strings
- Marked a number of suspected obsolete messages as non-translatable.
- Replaced concatenated strings with NLS.bind() calls.
- Added some old-style Messages classes to replace direct ResourceBundle
usage.
- Replaced calls to ResourceBundle.getString() with Messages.getString(),
and inlined some property key constants. This
(a) helps "Find Broken Externalized Strings" and
(b) prepares the way for new-style Eclipse message bundles (ie Messages
classes with string fields).
- Deprecated some methods and fields which provide access to ResourceBundles,
bundle names and property key names.
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.common.model.util;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.common.model.util.XBundle"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XBundle.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XBundle.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XBundle.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,8 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.util;
-import java.util.*;
-import java.text.*;
+import java.text.MessageFormat;
import org.jboss.tools.common.meta.key.WizardKeys;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -19,10 +18,6 @@
public class XBundle {
private static XBundle bundle = new XBundle();
- private static ResourceBundle messages =
ResourceBundle.getBundle(XBundle.class.getName());
- private static String ERR_GET_MESSAGE = "ERR_GET_MESSAGE";
- private static String ERR_TEMPLATE_NOT_FOUND = "ERR_TEMPLATE_NOT_FOUND";
-
private XBundle() {}
public static XBundle getInstance() {
@@ -44,7 +39,7 @@
return MessageFormat.format(t, args);
} catch (IllegalArgumentException e) {
ModelPlugin.getPluginLog().logError(e);
- return MessageFormat.format(messages.getString(XBundle.ERR_GET_MESSAGE),new
Object[]{resourceid,templateid,t});
+ return
MessageFormat.format(Messages.getString("ERR_GET_MESSAGE"),new
Object[]{resourceid,templateid,t}); //$NON-NLS-1$
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,20 +10,20 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.preferences;
-import java.util.Locale;
-import java.util.ResourceBundle;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
public class CompanyPreferencesPage extends PreferencePage implements
IWorkbenchPreferencePage {
- public static final String WEB_PREFERENCES_ID =
"org.jboss.tools.common.model.ui";
+ public static final String WEB_PREFERENCES_ID =
"org.jboss.tools.common.model.ui"; //$NON-NLS-1$
protected Control contents;
@@ -48,15 +48,14 @@
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
StyledText newControl = new StyledText(parent, SWT.WRAP);
- ResourceBundle bundle = ResourceBundle.getBundle(getClass().getPackage().getName() +
".preferences", Locale.getDefault(), getClass().getClassLoader());
- newControl.setText(bundle.getString(getKey()));
+ newControl.setText(getPrefsName());
newControl.setBackground(parent.getBackground());
newControl.setEditable(false);
return contents = newControl;
}
- protected String getKey() {
- return "REDHAT";
+ protected String getPrefsName() {
+ return Messages.getString("REDHAT"); //$NON-NLS-1$
}
public void init(IWorkbench workbench) {}
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/Messages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/Messages.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.common.model.ui.preferences;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.common.model.ui.preferences.preferences"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/XmlEditorMessages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/XmlEditorMessages.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/XmlEditorMessages.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -1,4 +1,6 @@
-
+# START NON-TRANSLATABLE
+# There don't seem to be any references to XmlEditorMessages in the
+# codebase, so translation is disabled until proven otherwise!
ContentAssistProposal.label=Content Assist@Ctrl+SPACE
ContentAssistProposal.tooltip=Content Assist
ContentAssistProposal.image=
@@ -59,3 +61,4 @@
XmlSyntaxPreferencePage.InternalDTD.Type=XML Internal DTD Type
XmlSyntaxPreferencePage.InternalDTD.Contentspec=XML Internal DTD Contentspec
XmlSyntaxPreferencePage.InternalDTD.Conditional=XML Conditional Section
+# END NON-TRANSLATABLE
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -183,7 +183,7 @@
}
public void setName(String name) {
- throw new IllegalStateException(getName() +
HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed);
+ throw new
IllegalStateException(NLS.bind(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed,
getName()));
}
public void writeStateTo(Element node) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -13,7 +13,8 @@
EclipseConsoleConfigurationPreferences_could_not_resolve_to_file=Could not resolve {0} to
a file
EclipseConsoleConfigurationPreferences_could_not_resolve_classpaths=Could not resolve
classpaths
EclipseConsoleConfigurationPreferences_errors_while_parsing=Errors while parsing
-EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed=\ cannot be renamed
+# {0}=name
+EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed={0} cannot be renamed
EclipseLaunchConsoleConfigurationPreferences_cannot_read_from_xml=Cannot read from xml
EclipseLaunchConsoleConfigurationPreferences_cannot_write_to_xml=Cannot write to xml
EclipseLaunchConsoleConfigurationPreferences_could_not_compute_classpath=Could not
compute classpath
@@ -128,7 +129,8 @@
ReloadConfigurationAction_rebuild_configuration=Rebuild configuration
ReloadConfigurationAction_starting_hibernate_resulted_exception=Starting Hibernate
resulted in a UnsupportedClassVersionError.\nThis can occur if you are running eclipse
with JDK 1.4 and your domain classes require JDK 1.5. \n\nResolution: Run eclipse with JDK
1.5.
SchemaExportAction_errornum_while_performing_schemaexport=Error \# {0} while performing
SchemaExport
-SchemaExportAction_error_while_performing_schemaexport=\ error(s) while performing
SchemaExport, see Error Log for details
+# {0}=count
+SchemaExportAction_error_while_performing_schemaexport={0} error(s) while performing
SchemaExport, see Error Log for details
SchemaExportAction_exception_running_schemaexport=Exception while running SchemaExport
SchemaExportAction_run_schemaexport=Run SchemaExport
SchemaExportAction_sure_run_schemaexport=Are you sure you want to run SchemaExport on
''{0}''?
@@ -140,11 +142,13 @@
EntityPropertySource_identifier=Identifier
EntityPropertySource_properties=Properties
QueryPagePropertySource_console_configuration=Console configuration
-QueryPagePropertySource_millisec=\ millisec
+# {0}=count in millisec
+QueryPagePropertySource_millisec={0} millisec
QueryPagePropertySource_query_run_time=Query run time
QueryPagePropertySource_query_size=Query size
QueryPagePropertySource_query_string=Query string
-QueryPagePropertySource_sec=\ sec
+# {0}=count in seconds
+QueryPagePropertySource_sec={0} sec
QueryPagePropertySource_unknown=(unknown)
ConsoleConfigurationWizardPage_config_name_already_exist=A configuration with this name
already exists\!
@@ -272,8 +276,8 @@
JavaCompletionProcessor_no_console_configuration_found=No console configuration found
JavaCompletionProcessor_session_session=Session session;
-HibernateConfigurationPartFactory_not_known_by_factory=\ not known by factory
-
+# {0}=classname
+HibernateConfigurationPartFactory_not_known_by_factory={0} not known by factory
ToggleLayoutAction_auto_layout=Automatic Layout
ToggleLayoutAction_auto_layout_active=Automatic layout active
ToggleLayoutAction_enable_auto_layout=Enable automatic layout
@@ -342,11 +346,13 @@
CodeGenerationSettingsTab_detect_one_to_one_associations=Detect one-to-one associations
CodeGenerationSettingsTab_detect_optimistic_lock_columns=Detect optimistic lock columns
CodeGenerationSettingsTab_do_you_want_create_reveng_xml=Do you want to create a new
reveng.xml or use an existing file ?
-CodeGenerationSettingsTab_does_not_exist=\ does not exist
+# {0}=name
+CodeGenerationSettingsTab_does_not_exist={0} does not exist
CodeGenerationSettingsTab_filesystem=&Filesystem...
CodeGenerationSettingsTab_generate_basic_typed_composite_ids=Generate basic typed
composite ids
CodeGenerationSettingsTab_main=Main
-CodeGenerationSettingsTab_must_be_file=\ must be a file
+# {0}=name
+CodeGenerationSettingsTab_must_be_file={0} must be a file
CodeGenerationSettingsTab_output_dir=Output &directory:
CodeGenerationSettingsTab_output_directory=Output directory
CodeGenerationSettingsTab_package=&Package:
@@ -382,8 +388,10 @@
ConsoleConfigurationMainTab_DatabaseConnection=Database connection:
ConsoleConfigurationMainTab_do_you_want_to_create_new_cfgxml=Do you want to create a new
*.cfg.xml or use an existing one ?
ConsoleConfigurationMainTab_do_you_want_to_create_new_property_file=Do you want to create
a new property file or use an existing one ?
-ConsoleConfigurationMainTab_does_not_exist=\ does not exist
-ConsoleConfigurationMainTab_is_not_file=\ is not a file
+# {0}=name
+ConsoleConfigurationMainTab_does_not_exist={0} does not exist
+# {0}=name
+ConsoleConfigurationMainTab_is_not_file={0} is not a file
ConsoleConfigurationMainTab_java_project_to_determine_default_classpath=The (optional)
java project is used to determine the default classpath
ConsoleConfigurationMainTab_jpa=JPA (jdk 1.5+)
ConsoleConfigurationMainTab_main=Main
@@ -428,14 +436,17 @@
ExporterSettingsTab_console_configuration_must_be_specified=Console configuration must be
specified
ExporterSettingsTab_description=Description
ExporterSettingsTab_deselect_all=Deselect all
-ExporterSettingsTab_does_not_exist=\ does not exist
+# {0}=name
+ExporterSettingsTab_does_not_exist={0} does not exist
ExporterSettingsTab_edit=Edit...
ExporterSettingsTab_exporters=Exporters:
ExporterSettingsTab_exporters_2=Exporters
ExporterSettingsTab_general_settings=General settings:
ExporterSettingsTab_generate_ejb3annotations=Generate EJB3 annotations
-ExporterSettingsTab_has_to_be_folder_or_project=\ has to be a folder or project
-ExporterSettingsTab_must_be_file=\ must be a file
+# {0}=name
+ExporterSettingsTab_has_to_be_folder_or_project={0} has to be a folder or project
+# {0}=name
+ExporterSettingsTab_must_be_file={0} must be a file
ExporterSettingsTab_output_directory_for=Output directory for
ExporterSettingsTab_problem_when_reading_hibernate_tools_launch_configuration=Problem
when reading hibernate tools launch configuration
ExporterSettingsTab_project_for_is_closed=Project for {0} is closed
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -83,9 +83,7 @@
HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element );
}
HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(),
- cnt
- - 1
- +
HibernateConsoleMessages.SchemaExportAction_error_while_performing_schemaexport,
+ NLS.bind(HibernateConsoleMessages.SchemaExportAction_error_while_performing_schemaexport,
cnt - 1),
(Throwable)null );
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -21,6 +21,7 @@
*/
package org.hibernate.eclipse.console.views.properties;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource2;
import org.eclipse.ui.views.properties.PropertyDescriptor;
@@ -104,8 +105,12 @@
if(QUERY_TIME.equals(id) ) {
long resultTime = page.getQueryTime();
if (resultTime==-1) return HibernateConsoleMessages.QueryPagePropertySource_unknown;
- if (resultTime > 1000) return (resultTime / 1000) + "." + (resultTime /
100) % 10 +HibernateConsoleMessages.QueryPagePropertySource_sec; //$NON-NLS-1$
- return resultTime + HibernateConsoleMessages.QueryPagePropertySource_millisec;
+ if (resultTime > 1000) {
+ return NLS.bind(
+ HibernateConsoleMessages.QueryPagePropertySource_sec,
+ (resultTime / 1000) + "." + (resultTime / 100) % 10); //$NON-NLS-1$
+ }
+ return NLS.bind(HibernateConsoleMessages.QueryPagePropertySource_millisec,
resultTime);
}
return null;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -23,6 +23,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.graph.model.AssociationViewAdapter;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
@@ -50,7 +51,9 @@
return new TableEditPart( (TableViewAdapter) model);
}
- throw new IllegalArgumentException(model.getClass() +
HibernateConsoleMessages.HibernateConfigurationPartFactory_not_known_by_factory);
+ throw new IllegalArgumentException(NLS.bind(
+ HibernateConsoleMessages.HibernateConfigurationPartFactory_not_known_by_factory,
+ model.getClass()));
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -44,6 +44,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Image;
@@ -351,10 +352,10 @@
if (resType == IResource.FILE) {
return null;
} else {
- return name +
HibernateConsoleMessages.CodeGenerationSettingsTab_must_be_file;
+ return
NLS.bind(HibernateConsoleMessages.CodeGenerationSettingsTab_must_be_file, name);
}
} else {
- return name +
HibernateConsoleMessages.CodeGenerationSettingsTab_does_not_exist;
+ return
NLS.bind(HibernateConsoleMessages.CodeGenerationSettingsTab_does_not_exist, name);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -487,10 +487,10 @@
if(resource instanceof IFile) {
return null;
} else {
- return msgPrefix + HibernateConsoleMessages.ConsoleConfigurationMainTab_is_not_file;
+ return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationMainTab_is_not_file,
msgPrefix);
}
} else {
- return msgPrefix +
HibernateConsoleMessages.ConsoleConfigurationMainTab_does_not_exist;
+ return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationMainTab_does_not_exist,
msgPrefix);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -832,11 +832,11 @@
}
}
else {
- return name +
HibernateConsoleMessages.ExporterSettingsTab_has_to_be_folder_or_project;
+ return
NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_has_to_be_folder_or_project, name);
}
}
else {
- return name + HibernateConsoleMessages.ExporterSettingsTab_does_not_exist;
+ return NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_does_not_exist, name);
}
return null;
}
@@ -850,11 +850,11 @@
return null;
}
else {
- return name + HibernateConsoleMessages.ExporterSettingsTab_must_be_file;
+ return NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_must_be_file, name);
}
}
else {
- return name + HibernateConsoleMessages.ExporterSettingsTab_does_not_exist;
+ return NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_does_not_exist, name);
}
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/EditorActionContributor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -17,13 +17,14 @@
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.jboss.tools.hibernate.ui.veditor.UIVEditorMessages;
+import org.jboss.tools.hibernate.ui.view.ImageBundle;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
public class EditorActionContributor extends ActionBarContributor {
protected void buildActions() {
IWorkbenchAction workbenchAction =
ActionFactory.REFRESH.create(getPage().getWorkbenchWindow());
- workbenchAction.setImageDescriptor(ViewPlugin.getImageDescriptor(ViewPlugin.BUNDLE_IMAGE.getString("Explorer.refreshOrmGef")));
//$NON-NLS-1$
+ workbenchAction.setImageDescriptor(ViewPlugin.getImageDescriptor(ImageBundle.getString("Explorer.refreshOrmGef")));
//$NON-NLS-1$
workbenchAction.setToolTipText(UIVEditorMessages.EditorActionContributor_refresh_visual_mapping);
addAction(workbenchAction);
addRetargetAction(new UndoRetargetAction());
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/figures/TitleLabel.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/figures/TitleLabel.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/figures/TitleLabel.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -14,13 +14,14 @@
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.hibernate.ui.view.ImageBundle;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
public class TitleLabel extends Label {
- static Image shevronUp =
ViewPlugin.getImageDescriptor(ViewPlugin.BUNDLE_IMAGE.getString("VisualMapping.shevronUp")).createImage();
//$NON-NLS-1$
- static Image shevronDown =
ViewPlugin.getImageDescriptor(ViewPlugin.BUNDLE_IMAGE.getString("VisualMapping.shevronDown")).createImage();
//$NON-NLS-1$
+ static Image shevronUp =
ViewPlugin.getImageDescriptor(ImageBundle.getString("VisualMapping.shevronUp")).createImage();
//$NON-NLS-1$
+ static Image shevronDown =
ViewPlugin.getImageDescriptor(ImageBundle.getString("VisualMapping.shevronDown")).createImage();
//$NON-NLS-1$
protected boolean hiden = false;
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ImageBundle.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ImageBundle.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ImageBundle.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,29 @@
+package org.jboss.tools.hibernate.ui.view;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class ImageBundle {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.view.image"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private ImageBundle() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * @deprecated use bundle via ImageBundle.getString()
+ */
+ public static ResourceBundle getBundle() {
+ return RESOURCE_BUNDLE;
+ }
+}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -35,7 +35,10 @@
private static ViewPlugin plugin;
private ResourceBundle resourceBundle;
- public static final ResourceBundle BUNDLE_IMAGE =
ResourceBundle.getBundle(ViewPlugin.class.getPackage().getName() + ".image");
//$NON-NLS-1$
+ /**
+ * @deprecated use bundle via ImageBundle.getString()
+ */
+ public static final ResourceBundle BUNDLE_IMAGE = ImageBundle.getBundle();
public static boolean TRACE = false;
public static boolean TRACE_VIEW = false;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/image.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/image.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/image.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -41,7 +41,7 @@
OrmModelImageVisitor.PersistentFieldParent=parent.gif
##OrmModelImageVisitor for Collection
-OrmModelImageVisitor.PersistentFieldCollection=collection.gif
+OrmModelImageVisitor.Collection=collection.gif
OrmModelImageVisitor.Collection_array=collection_array.gif
OrmModelImageVisitor.Collection_primitive_array=collection_primitive_array.gif
OrmModelImageVisitor.Collection_set=collection_set.gif
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ContentProviderVisitor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.view.views;
-import java.util.ResourceBundle;
-
import org.hibernate.mapping.Column;
@@ -19,8 +17,6 @@
private static final Object[] nullChildren = new Object[0];
- private ResourceBundle BUNDLE =
ResourceBundle.getBundle(ContentProviderVisitor.class.getPackage().getName() +
".views"); //$NON-NLS-1$
-
public Object visitDatabaseColumn(Column column, Object argument) {
return null;
}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.hibernate.ui.view.views;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.ui.view.views.views"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -12,7 +12,6 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.hibernate.console.ConsoleConfiguration;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -35,6 +35,7 @@
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.UnionSubclass;
+import org.jboss.tools.hibernate.ui.view.ImageBundle;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
/**
@@ -43,34 +44,32 @@
*/
public class OrmModelImageVisitor implements PersistentClassVisitor {
- private ResourceBundle BUNDLE = ViewPlugin.BUNDLE_IMAGE;
-
public Object visitDatabaseTable(Table table) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabaseTable")); //$NON-NLS-1$
}
public Object visitDatabaseColumn(Column column) {
if (column.isUnique()) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabaseUniqueKeyColumn"));
//$NON-NLS-1$
} else if (HibernateUtils.isPrimaryKey(column)
&& HibernateUtils.getTable(column) != null
&& HibernateUtils.isForeignKey(column)) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabasePrimaryForeignKeysColumn"));
//$NON-NLS-1$
} else if (HibernateUtils.isPrimaryKey(column)) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabasePrimaryKeyColumn"));
//$NON-NLS-1$
} else if (HibernateUtils.getTable(column) != null
&& HibernateUtils.isForeignKey(column)) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabaseForeignKeyColumn"));
//$NON-NLS-1$
} else
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.DatabaseColumn")); //$NON-NLS-1$
}
@@ -79,30 +78,30 @@
if (field != null) {
if (field.getPersistentClass() != null &&
field.getPersistentClass().getVersion() == field) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldSimple_version"));
//$NON-NLS-1$
}
if (field.getPersistentClass() != null &&
field.getPersistentClass().getIdentifierProperty() == field) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldSimple_id"));
//$NON-NLS-1$
}
if (field.getValue() != null) {
if (field.getValue() instanceof OneToMany)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldOne-to-many"));
//$NON-NLS-1$
else if (field.getValue() instanceof OneToOne)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldOne-to-one"));
//$NON-NLS-1$
else if (field.getValue() instanceof ManyToOne)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldMany-to-one"));
//$NON-NLS-1$
else if (field.getValue() instanceof Any)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldAny")); //$NON-NLS-1$
try {
@@ -110,112 +109,112 @@
&& field.getType().isCollectionType()) {
if (field.getValue() instanceof PrimitiveArray)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_primitive_array"));
//$NON-NLS-1$
else if (field.getValue() instanceof Array)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_array")); //$NON-NLS-1$
else if (field.getValue() instanceof List)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_list")); //$NON-NLS-1$
else if (field.getValue() instanceof Set)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_set")); //$NON-NLS-1$
else if (field.getValue() instanceof Map)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_map")); //$NON-NLS-1$
else if (field.getValue() instanceof Bag)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_bag")); //$NON-NLS-1$
else if (field.getValue() instanceof IdentifierBag)
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection_idbag")); //$NON-NLS-1$
else
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.Collection")); //$NON-NLS-1$
}
} catch (Exception e) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
//$NON-NLS-1$
}
}
if("parent".equals(field.getName())) //$NON-NLS-1$
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldParent")); //$NON-NLS-1$
}
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
public Object visitManyToOneMapping(ManyToOne field) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldMany-to-many"));
//$NON-NLS-1$
}
public Object visitOneToManyMapping(OneToMany field) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldOne-to-many"));
//$NON-NLS-1$
}
public Object visitSimpleValueMapping(SimpleValue field) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
public Object visitAnyMapping(Any field) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldMany-to-any"));
//$NON-NLS-1$
}
public Object visitComponentMapping(Component mapping) {
if (mapping != null) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldComponent"));
//$NON-NLS-1$
}
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
//$NON-NLS-1$
}
public Object visitComponentKeyMapping(DependantValue mapping) {
if (mapping.getTable().getIdentifierValue() == mapping) {
return ViewPlugin
- .getImageDescriptor(BUNDLE
+ .getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldComponent_id"));
//$NON-NLS-1$
}
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
public Object accept(RootClass arg0) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
}
public Object accept(UnionSubclass arg0) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
}
public Object accept(SingleTableSubclass arg0) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
}
public Object accept(JoinedSubclass arg0) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
}
public Object accept(Subclass arg0) {
- return ViewPlugin.getImageDescriptor(BUNDLE
+ return ViewPlugin.getImageDescriptor(ImageBundle
.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -12,8 +12,6 @@
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
-import java.util.ResourceBundle;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment;
@@ -38,10 +36,6 @@
static private String SPACE = " "; //$NON-NLS-1$
static private String POINTER = " -> "; //$NON-NLS-1$
- private ResourceBundle BUNDLE = ResourceBundle
- .getBundle(OrmModelNameVisitor.class.getPackage().getName()
- + ".views"); //$NON-NLS-1$
-
public OrmModelNameVisitor() {
super();
}
@@ -184,7 +178,7 @@
StringBuffer name = new StringBuffer();
name.append(field.getName());
name.append(" "); //$NON-NLS-1$
- name.append(BUNDLE.getString("OrmModelNameVisitor.Colon")); //$NON-NLS-1$
+ name.append(Messages.getString("OrmModelNameVisitor.Colon")); //$NON-NLS-1$
String typeString = null;
try {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ViewsAction.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -11,7 +11,6 @@
package org.jboss.tools.hibernate.ui.view.views;
import java.util.HashMap;
-import java.util.ResourceBundle;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
@@ -21,8 +20,6 @@
public class ViewsAction {
static ActionOrmTree openEditorAction;
- static private ResourceBundle BUNDLE =
ResourceBundle.getBundle(ViewsAction.class.getPackage().getName() + ".views");
//$NON-NLS-1$
-
static {
openEditorAction = new ActionOrmTree() {
HashMap<Object,ObjectEditorInput> hashMap = new
HashMap<Object,ObjectEditorInput>();
@@ -39,7 +36,7 @@
}
}
};
- openEditorAction.setText(BUNDLE.getString("Explorer.OpenEditorActionName"));
//$NON-NLS-1$
- openEditorAction.setToolTipText(BUNDLE.getString("Explorer.OpenEditorActionToolTipText"));
//$NON-NLS-1$
+ openEditorAction.setText(Messages.getString("Explorer.OpenEditorActionName"));
//$NON-NLS-1$
+ openEditorAction.setToolTipText(Messages.getString("Explorer.OpenEditorActionToolTipText"));
//$NON-NLS-1$
}
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/views.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -1,3 +1,5 @@
+# START NON-TRANSLATABLE
+# suspected OBSOLETE
//Explorer
Explorer.ActionRootPackageClassFieldName=project -> mapping -> package ->
class(table) -> field -> column(s)
Explorer.ActionRootPackageClassFieldContentDescription=project -> mapping ->
package -> class(table) -> field
@@ -58,7 +60,7 @@
Explorer.GenerateDDLErrorTitle=Generate DDL Error
Explorer.AutoBuildingFalseTitle=Warning
-Explorer.AutoBuildingFalseMessage=Build Automaticaly is switch off.\nContinue?
+Explorer.AutoBuildingFalseMessage="Build Automatically" is switched
off.\nContinue?
Explorer.HibernateCacheWizardName=Hibernate Cache Wizard...
Explorer.HibernateCacheWizardToolTipText=Hibernate cache wizard
@@ -219,10 +221,13 @@
Explorer.HQLConsoleToolTipText=HQL Console
Explorer.HibernateConsole=Hibernate Console
Explorer.HibernateConsoleToolTipText=Hibernate Console
+# END NON-TRANSLATABLE
Explorer.OpenEditorActionName=Open Mapping Diagram
Explorer.OpenEditorActionToolTipText=Open Mapping Diagram
+# START NON-TRANSLATABLE
+# suspected OBSOLETE
#ExplorerBase
ExplorerBase.ActionRootSchemaTableColumnName=project -> mapping -> schema ->
table -> column
ExplorerBase.ActionRootSchemaTableColumnContentDescription=project -> mapping ->
schema -> table -> column
@@ -236,10 +241,17 @@
#OrmModelNameVisitor
OrmModelNameVisitor.DefaultPackageName=Default Package
OrmModelNameVisitor.DefaultDatabaseSchema=Default Schema
+# END NON-TRANSLATABLE
+
+
+
+# START NON-TRANSLATABLE
OrmModelNameVisitor.Colon=:
+# suspected OBSOLETE
OrmModelNameVisitor.OpenBrackets=(
OrmModelNameVisitor.Comma=,
OrmModelNameVisitor.CloseBrackets=)
#Job
Job.LoadMapping=Loading mappings...
+# END NON-TRANSLATABLE
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -14,10 +14,11 @@
public class JSFStudioPreferencesPage extends CompanyPreferencesPage {
- public static final String ID = "org.jboss.tools.jsf.ui";
+ public static final String ID = "org.jboss.tools.jsf.ui"; //$NON-NLS-1$
- protected String getKey() {
- return "JSFSTUDIO";
+ @Override
+ protected String getPrefsName() {
+ return Messages.getString("JSFSTUDIO"); //$NON-NLS-1$
}
}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/Messages.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/Messages.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jsf.ui.preferences;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.jsf.ui.preferences.preferences"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -91,13 +91,6 @@
public static final String EDITOR_ID =
"org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; //$NON-NLS-1$
- private static final String VISUALSOURCE_TAB_LABEL =
"JSPMultiPageEditor.TabLabel.VisualSource"; //$NON-NLS-1$
-
- private static final String SOURCE_TAB_LABEL =
"JSPMultiPageEditor.TabLabel.Source"; //$NON-NLS-1$
-
- /** PREVIEW_TAB_LABEL */
- private static final String PREVIEW_TAB_LABEL =
"JSPMultiPageEditor.TabLabel.Preview"; //$NON-NLS-1$
-
//option loads preview tab
private static final String PREVIEW_TAB="Preview"; //$NON-NLS-1$
//visual tab
@@ -473,7 +466,7 @@
if(visualEditor!=null) {
visualSourceIndex = addPage(visualEditor, getEditorInput());
setPageText(visualSourceIndex, JSPEditorMessages
- .getString(VISUALSOURCE_TAB_LABEL));
+ .getString("JSPMultiPageEditor.TabLabel.VisualSource")); //$NON-NLS-1$
setPartName(visualEditor.getTitle());
}
} catch (PartInitException e) {
@@ -489,15 +482,15 @@
}*/
try {
+ String sourceTabLabel = JSPEditorMessages.getString(
+ "JSPMultiPageEditor.TabLabel.Source"); //$NON-NLS-1$
if(visualEditor!=null) {
sourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(sourceIndex, JSPEditorMessages
- .getString(SOURCE_TAB_LABEL));
+ setPageText(sourceIndex, sourceTabLabel);
setPartName(visualEditor.getTitle());
} else {
sourceIndex = addPage(sourceEditor, getEditorInput());
- setPageText(sourceIndex, JSPEditorMessages
- .getString(SOURCE_TAB_LABEL));
+ setPageText(sourceIndex, sourceTabLabel);
setPartName(sourceEditor.getTitle());
}
} catch (PartInitException e) {
@@ -509,7 +502,7 @@
if(visualEditor!=null) {
previewIndex = addPage(visualEditor, getEditorInput());
setPageText(previewIndex, JSPEditorMessages
- .getString(PREVIEW_TAB_LABEL));
+ .getString("JSPMultiPageEditor.TabLabel.Preview")); //$NON-NLS-1$
setPartName(visualEditor.getTitle());
}
} catch (PartInitException e) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -160,8 +160,6 @@
private TextEditorDropProviderImpl textEditorDropProvider;
- private static final String SHOW_IN_MENU =
"JSPMultiPageEditor.ContextMenu.ShowInMenu"; //$NON-NLS-1$
-
public JSPTextEditor(JSPMultiPageEditor parentEditor) {
JspEditorPlugin.getDefault().initDefaultPluginPreferences();
textEditorDropProvider = new TextEditorDropProviderImpl();
@@ -298,7 +296,7 @@
ConfigurablePropertySheetPage sheet) {
try {
Method method = PropertySheetPage.class.getDeclaredMethod(
- "setSorter", new Class[] { PropertySheetSorter.class });
+ "setSorter", new Class[] { PropertySheetSorter.class }); //$NON-NLS-1$
method.setAccessible(true);
method.invoke(sheet, new Object[] { sorter });
} catch (InvocationTargetException e) {
@@ -341,7 +339,7 @@
getSourceViewer().removeTextListener(this);
getSourceViewer().addTextListener(this);
- Object dtid = getSourceViewer().getTextWidget().getData("DropTarget");
+ Object dtid = getSourceViewer().getTextWidget().getData("DropTarget");
//$NON-NLS-1$
if (dtid != null) {
if (dtid instanceof DropTarget) {
DropTarget dropTarget = (DropTarget) dtid;
@@ -571,8 +569,8 @@
return;
}
Properties p = new Properties();
- XActionInvoker.invoke("DiscardActions.Discard", o, p);
- if (!"true".equals(p.getProperty("done")))
+ XActionInvoker.invoke("DiscardActions.Discard", o, p); //$NON-NLS-1$
+ if (!"true".equals(p.getProperty("done"))) //$NON-NLS-1$
//$NON-NLS-2$
return;
super.doRevertToSaved();
if (o.isModified())
@@ -601,8 +599,8 @@
}
if (wtpTextJspKbConnector == null
&& model != null
- && (getContentType().toLowerCase().indexOf("jsp") != -1 ||
getContentType()
- .toLowerCase().indexOf("html") != -1)) {
+ && (getContentType().toLowerCase().indexOf("jsp") != -1 ||
getContentType() //$NON-NLS-1$
+ .toLowerCase().indexOf("html") != -1)) { //$NON-NLS-1$
wtpTextJspKbConnector = new WTPTextJspKbConnector(getEditorInput(),
document, model);
wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
@@ -615,7 +613,7 @@
type = getModel().getContentTypeIdentifier();
} finally {
if (type == null)
- type = "";
+ type = ""; //$NON-NLS-1$
}
return type;
}
@@ -758,7 +756,7 @@
.getDropCommand(flavor,
JSPTagProposalFactory.getInstance());
- boolean promptAttributes = "yes"
+ boolean promptAttributes = "yes" //$NON-NLS-1$
.equals(VpePreference.ALWAYS_REQUEST_FOR_ATTRIBUTE
.getValue());
dropCommand
@@ -813,7 +811,7 @@
return;
}
// Drop from VPE to Source is forbidden
- if (dropContext.getFlavor().equals("text/html")) {
+ if (dropContext.getFlavor().equals("text/html")) { //$NON-NLS-1$
if (InnerDragBuffer.object != null) {
event.detail = DND.DROP_NONE;
}
@@ -1115,7 +1113,7 @@
try {
if (m == null) {
Class c = getSelectionProvider().getClass();
- m = c.getDeclaredMethod("isFiringSelection", new Class[0]);
+ m = c.getDeclaredMethod("isFiringSelection", new Class[0]); //$NON-NLS-1$
m.setAccessible(true);
}
Boolean b = (Boolean) m.invoke(getSelectionProvider(),
@@ -1251,8 +1249,8 @@
boolean isInsideResponseRedirect(Text textNode, int off) {
if (off < 0)
return false;
- String START = "response.sendRedirect(\"";
- String END = "\")";
+ String START = "response.sendRedirect(\""; //$NON-NLS-1$
+ String END = "\")"; //$NON-NLS-1$
String text = textNode.getNodeValue();
int i = 0;
while (i < text.length() && i < off) {
@@ -1290,7 +1288,6 @@
}
private String getShowInMenuLabel() {
-
- return JSPEditorMessages.getString(SHOW_IN_MENU);
+ return
JSPEditorMessages.getString("JSPMultiPageEditor.ContextMenu.ShowInMenu");
//$NON-NLS-1$
}
}
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/Messages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/Messages.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jst.web.context;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.jst.web.context.RegisterServerContext"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.jst.web.context;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
import org.eclipse.core.resources.IProject;
@@ -19,8 +18,9 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.*;
-
+import org.eclipse.wst.server.core.internal.Module;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.jboss.tools.common.model.options.Preference;
import org.jboss.tools.jst.web.WebModelPlugin;
import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
@@ -34,15 +34,9 @@
static String HELP_KEY_BASE = "FileSystems_RegisterInServerXML";
//$NON-NLS-1$
- static final private String ERR_APP_NAME_IS_NOT_SPECIFIED =
"ERR_APP_NAME_IS_NOT_SPECIFIED"; //$NON-NLS-1$
- static final private String ERR_SERVLET_VERSION_IS_NOT_SET =
"ERR_SERVLET_VERSION_IS_NOT_SET"; //$NON-NLS-1$
- static final private String ERR_SERVLET_VERSION_IS_NOT_VALID =
"ERR_SERVLET_VERSION_IS_NOT_VALID"; //$NON-NLS-1$
-
IProject project = null;
String servletVersion = ""; //$NON-NLS-1$
- static final private ResourceBundle MESSAGES =
ResourceBundle.getBundle(RegisterServerContext.class.getName());
-
int mode;
boolean isEnabled = false;
boolean isInitiallyEnabled = false;
@@ -146,13 +140,13 @@
if(!isEnabled()) {
if(servletVersion != null && servletVersion.length() == 0) {
- return MESSAGES.getString(ERR_SERVLET_VERSION_IS_NOT_SET);
+ return Messages.getString("ERR_SERVLET_VERSION_IS_NOT_SET"); //$NON-NLS-1$
}
return null;
}
if(applicationName == null || applicationName.length() == 0) {
- return MESSAGES.getString(ERR_APP_NAME_IS_NOT_SPECIFIED);
+ return Messages.getString("ERR_APP_NAME_IS_NOT_SPECIFIED");
//$NON-NLS-1$
}
if(true) {
@@ -176,9 +170,9 @@
}
}
if(servletVersion != null && servletVersion.length() == 0) {
- return MESSAGES.getString(ERR_SERVLET_VERSION_IS_NOT_SET);
+ return Messages.getString("ERR_SERVLET_VERSION_IS_NOT_SET"); //$NON-NLS-1$
} else if(!checkServletVersionFormat()) {
- return MESSAGES.getString(ERR_SERVLET_VERSION_IS_NOT_VALID);
+ return Messages.getString("ERR_SERVLET_VERSION_IS_NOT_VALID");
//$NON-NLS-1$
}
return null;
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.debug/src/org/jboss/tools/jst/web/debug/internal/JspLineBreakpoint.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.debug/src/org/jboss/tools/jst/web/debug/internal/JspLineBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.debug/src/org/jboss/tools/jst/web/debug/internal/JspLineBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -34,9 +34,7 @@
public class JspLineBreakpoint extends JavaPatternBreakpoint implements
IBreakpointSourceFinder, IBreakpointPresentation {
- private static final String JSP_BREAKPOINT =
"org.jboss.tools.jst.web.debug.jspLineBreakpointMarker";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"JspLineBreakpoint.name";
-
+ private static final String JSP_BREAKPOINT =
"org.jboss.tools.jst.web.debug.jspLineBreakpointMarker"; //$NON-NLS-1$
private JDIDebugTarget debugTarget = null;
private boolean startServer = false;
@@ -79,7 +77,7 @@
if (debugTarget != null) {
result = JspDebugUtils.getGeneratedJavaClassName(
super.getPattern(),
- debugTarget.getLaunch().getLaunchConfiguration().getAttribute(WebUtils.ATTR_WEB_SERVER_NAME,
"")
+ debugTarget.getLaunch().getLaunchConfiguration().getAttribute(WebUtils.ATTR_WEB_SERVER_NAME,
"") //$NON-NLS-1$
);
}
if(result==null) {
@@ -123,7 +121,7 @@
IJavaStackFrame javaStackFrame = (IJavaStackFrame)stackFrame;
try {
String receivingTypeName = javaStackFrame.getReceivingTypeName();
- String configName =
javaStackFrame.getLaunch().getLaunchConfiguration().getAttribute(WebUtils.ATTR_WEB_SERVER_NAME,
"");
+ String configName =
javaStackFrame.getLaunch().getLaunchConfiguration().getAttribute(WebUtils.ATTR_WEB_SERVER_NAME,
""); //$NON-NLS-1$
String generatedClassName =
JspDebugUtils.getGeneratedJavaClassName(super.getPattern(), configName);
result = receivingTypeName.equals(generatedClassName);
@@ -149,7 +147,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new String[]{getPattern(),
"" + getLineNumber()});
+ return DebugMessages.getString("JspLineBreakpoint.name", new
String[]{getPattern(), "" + getLineNumber()}); //$NON-NLS-1$ //$NON-NLS-2$
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
return "error";
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractImplementationsPreferencesPage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -36,7 +36,13 @@
public class AbstractImplementationsPreferencesPage extends PreferencePage implements
IWorkbenchPreferencePage {
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String BUNDLE_NAME = "preferences"; //$NON-NLS-1$
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final ResourceBundle BUNDLE =
ResourceBundle.getBundle(AbstractImplementationsPreferencesPage.class.getPackage().getName()
+ "." + BUNDLE_NAME); //$NON-NLS-1$
private AbstractWebProjectTemplate helper;
@@ -121,10 +127,10 @@
heightHint = convertVerticalDLUsToPixels(14 /*IDialogConstants.BUTTON_HEIGHT*/);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- addButtonImpl = createButton(impl,
BUNDLE.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonImpl = createButton(impl,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
if (errorMessage != null) addButtonImpl.setEnabled(false);
- removeButtonImpl = createButton(impl,
BUNDLE.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonImpl = createButton(impl,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
removeButtonImpl.setEnabled(false);
// TabFolder
@@ -133,10 +139,10 @@
tabbedComposite.setLayoutData(gridDataTab);
TabItem librariesTab = new TabItem(tabbedComposite,SWT.NULL);
- librariesTab.setText(BUNDLE.getString("ImplementationsPreferencesPage.Library.Sets"));
//$NON-NLS-1$
+ librariesTab.setText(Messages.getString("ImplementationsPreferencesPage.Library.Sets"));
//$NON-NLS-1$
TabItem projectTab = new TabItem(tabbedComposite,SWT.NULL);
- projectTab.setText(BUNDLE.getString("ImplementationsPreferencesPage.Project.Templates"));
//$NON-NLS-1$
+ projectTab.setText(Messages.getString("ImplementationsPreferencesPage.Project.Templates"));
//$NON-NLS-1$
// listLibraries
Composite entryLibraries = new Composite(tabbedComposite, SWT.NULL);
@@ -150,10 +156,10 @@
listLibraries.setLayoutData(gridDataListLibraries);
- addButtonLibraries = createButton(entryLibraries,
BUNDLE.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonLibraries = createButton(entryLibraries,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
addButtonLibraries.setEnabled(false);
- removeButtonLibraries = createButton(entryLibraries,
BUNDLE.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonLibraries = createButton(entryLibraries,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
removeButtonLibraries.setEnabled(false);
librariesTab.setControl(entryLibraries);
@@ -170,23 +176,23 @@
listProject.setLayoutData(gridDataListProject);
- addButtonProject = createButton(entryProject,
BUNDLE.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
+ addButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Add")); //$NON-NLS-1$
addButtonProject.setEnabled(false);
- editButtonProject = createButton(entryProject,
BUNDLE.getString("ImplementationsPreferencesPage.Edit")); //$NON-NLS-1$
+ editButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Edit")); //$NON-NLS-1$
editButtonProject.setEnabled(false);
- upButtonProject = createButton(entryProject, BUNDLE
+ upButtonProject = createButton(entryProject, Messages
.getString("ImplementationsPreferencesPage.Up")); //$NON-NLS-1$
upButtonProject.setEnabled(false);
GridData d = (GridData)upButtonProject.getLayoutData();
d.verticalIndent = 5;
- downButtonProject = createButton(entryProject, BUNDLE
+ downButtonProject = createButton(entryProject, Messages
.getString("ImplementationsPreferencesPage.Down")); //$NON-NLS-1$
downButtonProject.setEnabled(false);
- removeButtonProject = createButton(entryProject,
BUNDLE.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
+ removeButtonProject = createButton(entryProject,
Messages.getString("ImplementationsPreferencesPage.Remove")); //$NON-NLS-1$
removeButtonProject.setEnabled(false);
d = (GridData)removeButtonProject.getLayoutData();
d.verticalIndent = 5;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/AbstractPagesPreferencesPage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -34,7 +34,13 @@
* @author Gavrs
*/
public abstract class AbstractPagesPreferencesPage extends PreferencePage implements
IWorkbenchPreferencePage {
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String BUNDLE_NAME = "preferences";
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static ResourceBundle BUNDLE =
ResourceBundle.getBundle(AbstractPagesPreferencesPage.class.getPackage().getName() +
"." + BUNDLE_NAME);
protected AbstractWebProjectTemplate helper;
protected String[] pages;
@@ -77,7 +83,7 @@
String[] pageLabels = new String[pages == null ? 0 : pages.length];
for (int i = 0; pageLabels != null && i < pageLabels.length; i++) {
pageLabels[i] = pages[i];
- if (pages[i].equals(defaultPage)) pageLabels[i] += " " +
BUNDLE.getString("AbstractPagesPreferencePage.3");
+ if (pages[i].equals(defaultPage)) pageLabels[i] += " " +
Messages.getString("AbstractPagesPreferencePage.3");
}
return pageLabels;
}
@@ -109,14 +115,14 @@
listPages.setLayoutData(gridDataList);
addButtonPages = new Button(entryPage, SWT.PUSH);
- addButtonPages.setText(BUNDLE.getString("AbstractPagesPreferencePage.0"));
+ addButtonPages.setText(Messages.getString("AbstractPagesPreferencePage.0"));
GridData gridDataAddButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataAddButton.widthHint = widthHint;
gridDataAddButton.heightHint=heightHint;
addButtonPages.setLayoutData(gridDataAddButton);
removeButton = new Button(entryPage, SWT.PUSH);
- removeButton.setText(BUNDLE.getString("AbstractPagesPreferencePage.1"));
+ removeButton.setText(Messages.getString("AbstractPagesPreferencePage.1"));
GridData gridDataRemoveButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataRemoveButton.widthHint = widthHint;
gridDataRemoveButton.heightHint=heightHint;
@@ -127,7 +133,7 @@
if (isSetDefaultAllowed()) {
setDefaultButton = new Button(entryPage, SWT.PUSH);
- setDefaultButton.setText(BUNDLE.getString("AbstractPagesPreferencePage.2"));
+ setDefaultButton.setText(Messages.getString("AbstractPagesPreferencePage.2"));
GridData gridDataSetDefaultButton = new GridData(GridData.HORIZONTAL_ALIGN_END);
gridDataSetDefaultButton.widthHint = widthHint;
gridDataSetDefaultButton.heightHint=heightHint;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -28,7 +28,13 @@
public class LibrarySetsPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
public static final String ID = "org.jboss.tools.common.xstudio.libsets";
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String BUNDLE_NAME = "preferences";
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final ResourceBundle BUNDLE =
ResourceBundle.getBundle(LibrarySetsPreferencePage.class.getPackage().getName() +
"." + BUNDLE_NAME);
String[] librarySets;
LibrarySets helper;
@@ -70,7 +76,7 @@
listLib.setLayoutData(gridDataList);
Button addButtonLib = new Button(entryLib, SWT.PUSH);
- addButtonLib.setText(BUNDLE.getString("LibrarySetsPreferencePage.0"));
+ addButtonLib.setText(Messages.getString("LibrarySetsPreferencePage.0"));
//addButtonLib.setText("Add");
GridData gridDataAddButton = new GridData(GridData.BEGINNING);
gridDataAddButton.widthHint = widthHint;
@@ -78,7 +84,7 @@
addButtonLib.setLayoutData(gridDataAddButton);
removeButtonLib = new Button(entryLib, SWT.PUSH);
- removeButtonLib.setText(BUNDLE.getString("LibrarySetsPreferencePage.1"));
+ removeButtonLib.setText(Messages.getString("LibrarySetsPreferencePage.1"));
GridData gridDataRemoveButton = new GridData(GridData.BEGINNING);
gridDataRemoveButton.widthHint = widthHint;
gridDataRemoveButton.heightHint = heightHint;
@@ -87,7 +93,7 @@
removeButtonLib.setEnabled(false);
Label jarsIncludedLabel = new Label(entryLib, SWT.NONE);
- jarsIncludedLabel.setText(BUNDLE.getString("LibrarySetsPreferencePage.jarsIncluded"));
+ jarsIncludedLabel.setText(Messages.getString("LibrarySetsPreferencePage.jarsIncluded"));
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
jarsIncludedLabel.setLayoutData(data);
@@ -104,7 +110,7 @@
listLibJar.setLayoutData(gridDatalistLibJar);
addButtonLibJar = new Button(entryLib, SWT.PUSH);
- addButtonLibJar.setText(BUNDLE.getString("LibrarySetsPreferencePage.0"));
+ addButtonLibJar.setText(Messages.getString("LibrarySetsPreferencePage.0"));
GridData gridDataAddButtonLibJar = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridDataAddButtonLibJar.widthHint = widthHint;
gridDataAddButtonLibJar.heightHint = heightHint;
@@ -112,7 +118,7 @@
addButtonLibJar.setEnabled(false);
removeButtonLibJar = new Button(entryLib, SWT.PUSH);
- removeButtonLibJar.setText(BUNDLE.getString("LibrarySetsPreferencePage.1"));
+ removeButtonLibJar.setText(Messages.getString("LibrarySetsPreferencePage.1"));
GridData gridDataRemoveButtonLibJar = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridDataRemoveButtonLibJar.widthHint = widthHint;
gridDataRemoveButtonLibJar.heightHint = heightHint;
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jst.web.ui.internal.preferences;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.jst.web.ui.internal.preferences.preferences"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/Messages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/Messages.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jst.web.ui.operation;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.jst.web.ui.operation.WebProjectCreationOperation";
//$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectAdoptOperation.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -15,7 +15,6 @@
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;
-import java.util.ResourceBundle;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
@@ -23,8 +22,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.w3c.dom.Element;
-
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
@@ -33,8 +30,9 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XMLUtil;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.jst.web.context.*;
+import org.jboss.tools.jst.web.context.IImportWebProjectContext;
import org.jboss.tools.jst.web.ui.WebUiPlugin;
+import org.w3c.dom.Element;
public abstract class WebProjectAdoptOperation extends WebNatureOperation {
protected IImportWebProjectContext context;
@@ -150,9 +148,8 @@
if(dots == null) return true;
ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
- ResourceBundle bundle =
ResourceBundle.getBundle(WebProjectCreationOperation.class.getName());
String message = MessageFormat.format(
- bundle.getString("ADOPT_WILL_OVERWRITE_DOT_FILES_MESSAGE"),new
Object[]{dots} //$NON-NLS-1$
+ Messages.getString("ADOPT_WILL_OVERWRITE_DOT_FILES_MESSAGE"),new
Object[]{dots} //$NON-NLS-1$
);
int q = d.showDialog("Warning", message, new String[]{"Continue",
"Cancel"}, null, ServiceDialog.WARNING);
if(q != 0) return false;
@@ -175,9 +172,8 @@
if(cs == null || cs.length == 0) return true;
ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
- ResourceBundle bundle =
ResourceBundle.getBundle(WebProjectCreationOperation.class.getName());
String message = MessageFormat.format(
- bundle.getString("ADOPT_WILL_CLEAR_WORKSPACE_MESSAGE"),new
Object[]{getProject().getName()} //$NON-NLS-1$
+ Messages.getString("ADOPT_WILL_CLEAR_WORKSPACE_MESSAGE"),new
Object[]{getProject().getName()} //$NON-NLS-1$
);
int q = d.showDialog("Warning", message, new String[]{"Continue",
"Cancel"}, null, ServiceDialog.WARNING);
if(q != 0) return false;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebProjectCreationOperation.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -14,14 +14,12 @@
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;
-import java.util.ResourceBundle;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModel;
@@ -33,9 +31,9 @@
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.jst.web.context.RegisterServerContext;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
import org.jboss.tools.jst.web.project.helpers.IWebProjectTemplate;
@@ -98,16 +96,16 @@
IModelNature strutsProject = (IModelNature)getProject().getNature(getNatureID());
model = strutsProject.getModel();
XModelObject fso = FileSystemsHelper.getFileSystems(model);
- properties.setProperty("skipWizard", "yes");
- properties.setProperty("name", getProject().getName());
- XActionInvoker.invoke("CreateStrutsProject", fso, properties);
+ properties.setProperty("skipWizard", "yes");
//$NON-NLS-1$//$NON-NLS-2$
+ properties.setProperty("name", getProject().getName()); //$NON-NLS-1$
+ XActionInvoker.invoke("CreateStrutsProject", fso, properties); //$NON-NLS-1$
- XModelObject web = model.getByPath("Web");
+ XModelObject web = model.getByPath("Web"); //$NON-NLS-1$
if (web != null &&
properties.containsKey(NewWebProjectContext.ATTR_SERVLET_VERSION))
- model.changeObjectAttribute(web, NewWebProjectContext.ATTR_SERVLET_VERSION,
properties.getProperty("servlet version"));
+ model.changeObjectAttribute(web, NewWebProjectContext.ATTR_SERVLET_VERSION,
properties.getProperty("servlet version")); //$NON-NLS-1$
XModelObject webxml = WebAppHelper.getWebApp(model);
if(webxml != null) {
- model.changeObjectAttribute(webxml, "display-name", "" +
getProject().getName());
+ model.changeObjectAttribute(webxml, "display-name", "" +
getProject().getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -119,10 +117,10 @@
protected void copyProjectFile(Properties p) {
String templateFolder = template.getProjectTemplatesLocation(
- getProperty(TEMPLATE_VERSION_ID)) + "/" +
- getProperty(TEMPLATE_ID) + "/";
+ getProperty(TEMPLATE_VERSION_ID)) + "/" + //$NON-NLS-1$
+ getProperty(TEMPLATE_ID) + "/"; //$NON-NLS-1$
File sf = new File(templateFolder + IModelNature.PROJECT_FILE);
- String tf = p.getProperty(NewWebProjectContext.ATTR_LOCATION) + "/" +
IModelNature.PROJECT_FILE;
+ String tf = p.getProperty(NewWebProjectContext.ATTR_LOCATION) + "/" +
IModelNature.PROJECT_FILE; //$NON-NLS-1$
if(sf.exists()) {
FileUtil.copyFile(sf, new File(tf), true);
projectFile = new File(tf);
@@ -145,8 +143,8 @@
protected String getTemplateLocation() {
String fileName = template.getProjectTemplatesLocation(
- getProperty(TEMPLATE_VERSION_ID)) + "/" +
- getProperty(TEMPLATE_ID) + "/";
+ getProperty(TEMPLATE_VERSION_ID)) + "/" + //$NON-NLS-1$
+ getProperty(TEMPLATE_ID) + "/"; //$NON-NLS-1$
try {
return new File(fileName).getCanonicalPath();
} catch (IOException e) {
@@ -155,9 +153,21 @@
}
}
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String WARNING_MESSAGE = "COD_MESSAGE"; //$NON-NLS-1$
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String WARNING_TITLE = "COD_TITLE"; //$NON-NLS-1$
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String BTN_CANCEL = "BTN_CANCEL"; //$NON-NLS-1$
+ /**
+ * @deprecated use bundle via Messages.getString()
+ */
public static final String BTN_OK = "BTN_OK"; //$NON-NLS-1$
protected boolean checkOverwrite() {
@@ -171,16 +181,15 @@
if(cs != null && cs.length > 0) {
ServiceDialog dlg = PreferenceModelUtilities.getPreferenceModel().getService();
- ResourceBundle bundle =
ResourceBundle.getBundle(WebProjectCreationOperation.class.getName());
String message = MessageFormat.format(
- bundle.getString(WARNING_MESSAGE),new Object[]{location}
+ Messages.getString("COD_MESSAGE"),new Object[]{location}
//$NON-NLS-1$
);
int selAction = dlg.showDialog(
- bundle.getString(WARNING_TITLE),
+ Messages.getString("COD_TITLE"), //$NON-NLS-1$
message,
- new String[]{bundle.getString(BTN_OK),bundle.getString(BTN_CANCEL)},
+ new
String[]{Messages.getString("BTN_OK"),Messages.getString("BTN_CANCEL")},
//$NON-NLS-1$//$NON-NLS-2$
null,
ServiceDialog.WARNING
);
@@ -198,7 +207,7 @@
WebUiPlugin.getPluginLog().logError(e);
}
if(templateModel != null) {
- XModelObject o = FileSystemsHelper.getFileSystem(templateModel, "src");
+ XModelObject o = FileSystemsHelper.getFileSystem(templateModel, "src");
//$NON-NLS-1$
if(o instanceof FileSystemImpl) {
String s = ((FileSystemImpl)o).getAbsoluteLocation();
File f = new File(s);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/messages.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/messages.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -2,6 +2,9 @@
MappingModel.SourceIsNull=Source is NULL
MappingModel.Target=;Target :
MappingModel.TargetIsNull=;Target is NULL
+# START NON-TRANSLATABLE
+# suspected OBSOLETE
SmooksFileBuilder.NullAnalyzer1=Can not find the Analyzer for SourceID :
SmooksFileBuilder.NullAnalyzer2=\ and the TargetID :
+# END NON-TRANSLATABLE
SmooksFileBuilder.ResourceIsNull=SmooksResource is NULL
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/messages.properties 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/messages.properties 2009-04-07
04:47:20 UTC (rev 14533)
@@ -5,8 +5,11 @@
SmooksConfigFileNewWizard.NewConfigFileWizardTitle=New Smooks Configuration File
SmooksConfigFileNewWizard.SourceDataTypeSelectionTitle=Source Data Selection
SmooksConfigFileNewWizard.TargetDataTypeSelectionTitle=Target Data Selection
+# START NON-TRANSLATABLE
+# suspected OBSOLETE
# translators: please ensure the filename still ends in ".smooks"
SmooksConfigFileNewWizardPage.NewConfigFileWizardPageDefaultFileName=newConfig.smooks
+# END NON-TRANSLATABLE
SmooksConfigFileNewWizardPage.NewConfigFileWizardPageDescription=Create a new Smooks
configuration file
SmooksConfigFileNewWizardPage.NewConfigFileWizardPageErrorMessage1=File extension must be
"smooks"
SmooksConfigFileNewWizardPage.NewConfigFileWizardPageTitle=Smooks Configuration
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/Messages.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/Messages.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -1,6 +1,5 @@
package org.jboss.tools.smooks.utils;
-import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -21,7 +20,4 @@
}
}
- public static String getString(String key, Object... args) {
- return MessageFormat.format(getString(key), args);
- }
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -23,6 +23,7 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Shell;
@@ -146,8 +147,8 @@
if (selector.indexOf(splitString) != -1) {
throw new InvocationTargetException(
new Exception(
- Messages
- .getString("UIUtils.SelectorCheckErrorMessage", //$NON-NLS-1$
+ NLS.bind(Messages
+ .getString("UIUtils.SelectorCheckErrorMessage"), //$NON-NLS-1$
splitString,
selector)));
}
@@ -276,8 +277,8 @@
context);
compositeCommand.setResolveDescription(Messages
.getString("UIUtils.ConnectAllConnections")); //$NON-NLS-1$
- disconnectCommand.setResolveDescription(Messages
- .getString("UIUtils.DisconnectAllConnections", //$NON-NLS-1$
+ disconnectCommand.setResolveDescription(NLS.bind(Messages
+ .getString("UIUtils.DisconnectAllConnections"), //$NON-NLS-1$
currentNode.getName()));
AbstractStructuredDataModel targetNode = UIUtils.findGraphModel(root,
currentNode);
@@ -303,8 +304,8 @@
if (tempMap.get(sourceParentNode) == null) {
JavaModelConnectionResolveCommand connectParent = new
JavaModelConnectionResolveCommand(
context);
- String desc = Messages
- .getString("UIUtils.ConnectNode", //$NON-NLS-1$
+ String desc = NLS.bind(Messages
+ .getString("UIUtils.ConnectNode"), //$NON-NLS-1$
context.getSourceViewerLabelProvider().getText(
sourceParent),
parentNode.getName());
@@ -350,8 +351,8 @@
if (pgm != null && pgm instanceof IConnectableModel) {
if (((IConnectableModel) pgm)
.getModelTargetConnections().isEmpty()) {
- String errorMessage = Messages
- .getString("UIUtils.ParentNodeConnectErrorMessage", //$NON-NLS-1$
+ String errorMessage = NLS.bind(Messages
+ .getString("UIUtils.ParentNodeConnectErrorMessage"), //$NON-NLS-1$
javaModel.getName(),
parent.getName());
DesignTimeAnalyzeResult dr = new DesignTimeAnalyzeResult();
@@ -397,15 +398,15 @@
if (instanceClazz == null) {
DesignTimeAnalyzeResult result = new DesignTimeAnalyzeResult();
result
- .setErrorMessage(Messages
- .getString("UIUtils.InstanceLoadedErrorMessage", //$NON-NLS-1$
+ .setErrorMessage(NLS.bind(Messages
+ .getString("UIUtils.InstanceLoadedErrorMessage"), //$NON-NLS-1$
((JavaBeanModel) refObj).getName(),
instanceName));
JavaModelResolveCommand command = new JavaModelResolveCommand(
context);
command
- .setResolveDescription(Messages
- .getString("UIUtils.InstanceLoadedResolveMessage", //$NON-NLS-1$
+ .setResolveDescription(NLS.bind(Messages
+ .getString("UIUtils.InstanceLoadedResolveMessage"), //$NON-NLS-1$
instanceName));
command.setInstanceName(instanceName);
command.setJavaBean((JavaBeanModel) refObj);
@@ -415,8 +416,8 @@
if (instanceClazz != null && instanceClazz.isInterface()) {
DesignTimeAnalyzeResult result = new DesignTimeAnalyzeResult();
result
- .setErrorMessage(Messages
- .getString("UIUtils.JavaModelLoadedErrorMessage", //$NON-NLS-1$
+ .setErrorMessage(NLS.bind(Messages
+ .getString("UIUtils.JavaModelLoadedErrorMessage"), //$NON-NLS-1$
((JavaBeanModel) refObj).getName(),
instanceName));
if (List.class.isAssignableFrom(instanceClazz)) {
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionAttrForwardBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionAttrForwardBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionAttrForwardBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -25,10 +25,9 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor";
- private static final String BREAKPOINT_METHOD_NAME = "processForward";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Z";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionForwardBreakpoint.name";
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor"; //$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_NAME = "processForward";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Z";
//$NON-NLS-1$
public ActionAttrForwardBreakpoint() {
}
@@ -51,16 +50,16 @@
}
protected String getForwardName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_FORWARD_NAME, "");
+ return ensureMarker().getAttribute(ATTR_FORWARD_NAME, ""); //$NON-NLS-1$
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
+ return DebugMessages.getString("ActionForwardBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
//$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionConditionBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionConditionBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionConditionBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -42,7 +42,7 @@
*/
public abstract class ActionConditionBreakpoint extends ActionBreakpoint {
- private static final String ACTION_CONDITION_BREAKPOINT_MANAGER =
"org.jboss.tools.struts.debug.actionConditionBreakpointManager";
+ private static final String ACTION_CONDITION_BREAKPOINT_MANAGER =
"org.jboss.tools.struts.debug.actionConditionBreakpointManager"; //$NON-NLS-1$
private static boolean suspend = false;
protected Map fSuspendEvents = new HashMap();
@@ -126,7 +126,7 @@
return true;
}
if (thread.isPerformingEvaluation()) {
- StrutsDebugPlugin.log("Thread alraedy is performing evaluation.");
+ StrutsDebugPlugin.log("Thread is already performing evaluation.");
// If an evaluation is already being computed for this thread,
// we can't perform another
return !suspendForEvent(event, thread);
@@ -157,7 +157,7 @@
IJavaProject project = getJavaProject();
IAstEvaluationEngine engine = getEvaluationEngine(target, project);
if (project == null) {
- StrutsDebugPlugin.log("Struts debbuger: Java project is NULL!!!");
+ StrutsDebugPlugin.log("Struts debugger: Java project is NULL!!!");
return threadResumeQuiet(jdiThread);
}
if (engine == null) {
@@ -218,7 +218,7 @@
// Suspend when the condition evaluates true
IJavaPrimitiveValue javaValue = (IJavaPrimitiveValue)value;
if (isConditionSuspendOnTrue()) {
- if (javaValue.getJavaType().getName().equals("boolean") &&
javaValue.getBooleanValue()) {
+ if (javaValue.getJavaType().getName().equals("boolean") &&
javaValue.getBooleanValue()) { //$NON-NLS-1$
suspendForCondition(event, thread);
getActionConditionBreakpointManager().setStopHandleBreakpoints(true);
return;
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionEnterBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionEnterBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionEnterBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -19,11 +19,9 @@
public class ActionEnterBreakpoint extends ActionBreakpoint {
- public static final String BREAKPOINT_METHOD_NAME = "execute";
- public static final String BREAKPOINT_METHOD_SIGNATURE =
"(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;";
+ public static final String BREAKPOINT_METHOD_NAME = "execute"; //$NON-NLS-1$
+ public static final String BREAKPOINT_METHOD_SIGNATURE =
"(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;";
//$NON-NLS-1$
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionEnterBreakpoint.name";
-
public ActionEnterBreakpoint() {
}
@@ -36,16 +34,16 @@
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
protected String getActionTypeName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, "");
+ return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, ""); //$NON-NLS-1$
}
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath()});
+ return DebugMessages.getString("ActionEnterBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionExceptionBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionExceptionBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionExceptionBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -22,10 +22,9 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor";
- private static final String BREAKPOINT_METHOD_NAME = "processException";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Exception;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionExceptionBreakpoint.name";
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor"; //$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_NAME = "processException";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Exception;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;";
//$NON-NLS-1$
public ActionExceptionBreakpoint() {
}
@@ -51,20 +50,20 @@
}
public String getActionTypeName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, "");
+ return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, ""); //$NON-NLS-1$
}
public String getExceptionTypeName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_EXCEPTION_TYPE_NAME, "");
+ return ensureMarker().getAttribute(ATTR_EXCEPTION_TYPE_NAME, "");
//$NON-NLS-1$
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath(),
getExceptionTypeName()});
+ return DebugMessages.getString("ActionExceptionBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath(),
getExceptionTypeName()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -25,7 +25,7 @@
*/
public abstract class ActionFormBreakpoint extends ActionConditionBreakpoint {
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor";
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor"; //$NON-NLS-1$
public ActionFormBreakpoint() {
}
@@ -36,7 +36,7 @@
protected JDIStackFrame computeNewStackFrame(JDIThread jdiThread) throws DebugException
{
JDIStackFrame frame = (JDIStackFrame)jdiThread.computeNewStackFrames().get(1);
- if("process".equals(frame.getMethodName())) {
+ if("process".equals(frame.getMethodName())) { //$NON-NLS-1$
return frame;
}
return null;
@@ -48,6 +48,6 @@
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
}
\ No newline at end of file
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormPopulateBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormPopulateBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormPopulateBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -24,9 +24,8 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_METHOD_NAME = "processPopulate";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)V";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionFormPopulateBreakpoint.name";
+ private static final String BREAKPOINT_METHOD_NAME = "processPopulate";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)V";
//$NON-NLS-1$
public ActionFormPopulateBreakpoint() {
}
@@ -45,7 +44,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath()});
+ return DebugMessages.getString("ActionFormPopulateBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormValidateBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormValidateBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionFormValidateBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -24,10 +24,8 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_METHOD_NAME = "processValidate";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Z";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionFormValidateBreakpoint.name";
-
+ private static final String BREAKPOINT_METHOD_NAME = "processValidate";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Z";
//$NON-NLS-1$
public ActionFormValidateBreakpoint() {
}
@@ -45,7 +43,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath()});
+ return DebugMessages.getString("ActionFormValidateBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionForwardBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionForwardBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionForwardBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -26,10 +26,9 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor";
- private static final String BREAKPOINT_METHOD_NAME = "processForwardConfig";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/config/ForwardConfig;)V";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionForwardBreakpoint.name";
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor"; //$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_NAME = "processForwardConfig";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/config/ForwardConfig;)V";
//$NON-NLS-1$
public ActionForwardBreakpoint() {
}
@@ -58,13 +57,13 @@
protected JDIStackFrame computeNewStackFrame(JDIThread jdiThread) throws DebugException
{
List frames = jdiThread.computeNewStackFrames();
JDIStackFrame frame = (JDIStackFrame)frames.get(1);
- if("process".equals(frame.getMethodName())) {
+ if("process".equals(frame.getMethodName())) { //$NON-NLS-1$
// RequestProcessor
return frame;
- } else if ("processForwardConfig".equals(frame.getMethodName())) {
+ } else if ("processForwardConfig".equals(frame.getMethodName())) {
//$NON-NLS-1$
// TilesRequestProcessor
frame = (JDIStackFrame)frames.get(2);
- if("process".equals(frame.getMethodName())) {
+ if("process".equals(frame.getMethodName())) { //$NON-NLS-1$
// RequestProcessor
return frame;
}
@@ -73,20 +72,20 @@
}
protected String getActionTypeName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, "");
+ return ensureMarker().getAttribute(ATTR_ACTION_TYPE_NAME, ""); //$NON-NLS-1$
}
protected String getForwardName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_FORWARD_NAME, "");
+ return ensureMarker().getAttribute(ATTR_FORWARD_NAME, ""); //$NON-NLS-1$
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
+ return DebugMessages.getString("ActionForwardBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
//$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionIncludeBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionIncludeBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionIncludeBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -25,11 +25,9 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor";
- private static final String BREAKPOINT_METHOD_NAME = "processForward";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Z";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionIncludeBreakpoint.name";
-
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.action.RequestProcessor"; //$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_NAME = "processForward";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/ActionMapping;)Z";
//$NON-NLS-1$
public ActionIncludeBreakpoint() {
}
@@ -51,16 +49,16 @@
}
protected String getIncludeName() throws CoreException {
- return ensureMarker().getAttribute(ATTR_INCLUDE_NAME, "");
+ return ensureMarker().getAttribute(ATTR_INCLUDE_NAME, ""); //$NON-NLS-1$
}
protected String getActionMappingPath() throws CoreException {
- return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
"");
+ return ensureMarker().getAttribute(ActionBreakpoint.ATTR_ACTION_MAPPING_PATH,
""); //$NON-NLS-1$
}
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getIncludeName()});
+ return DebugMessages.getString("ActionIncludeBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getIncludeName()});
//$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionTilesDefinitionForwardBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionTilesDefinitionForwardBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/ActionTilesDefinitionForwardBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -28,10 +28,9 @@
private static IActionConditionBreakpointManager actionConditionBreakpointManager = new
ActionConditionBreakpointManager();
- private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.tiles.TilesRequestProcessor";
- private static final String BREAKPOINT_METHOD_NAME =
"processTilesDefinition";
- private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljava/lang/String;ZLjavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Z";
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"ActionTilesDefinitionForwardBreakpoint.name";
+ private static final String BREAKPOINT_CLASS_NAME =
"org.apache.struts.tiles.TilesRequestProcessor"; //$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_NAME = "processTilesDefinition";
//$NON-NLS-1$
+ private static final String BREAKPOINT_METHOD_SIGNATURE =
"(Ljava/lang/String;ZLjavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Z";
//$NON-NLS-1$
public ActionTilesDefinitionForwardBreakpoint() {
}
@@ -51,7 +50,7 @@
protected JDIStackFrame computeNewStackFrame(JDIThread jdiThread) throws DebugException
{
List frames = jdiThread.computeNewStackFrames();
JDIStackFrame frame = (JDIStackFrame)frames.get(2);
- if("process".equals(frame.getMethodName())) {
+ if("process".equals(frame.getMethodName())) { //$NON-NLS-1$
// RequestProcessor
return frame;
}
@@ -60,7 +59,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
+ return
DebugMessages.getString("ActionTilesDefinitionForwardBreakpoint.name", new
String[]{getMarker().getResource().getName(), getActionMappingPath(), getForwardName()});
//$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalExceptionBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalExceptionBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalExceptionBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -20,7 +20,6 @@
public class GlobalExceptionBreakpoint extends ActionExceptionBreakpoint {
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"GlobalExceptionBreakpoint.name";
public GlobalExceptionBreakpoint() {
}
@@ -43,7 +42,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getExceptionTypeName()});
+ return DebugMessages.getString("GlobalExceptionBreakpoint.name", new
String[]{getMarker().getResource().getName(), getExceptionTypeName()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalForwardBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalForwardBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/GlobalForwardBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -20,8 +20,6 @@
public class GlobalForwardBreakpoint extends ActionForwardBreakpoint {
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"GlobalForwardBreakpoint.name";
-
public GlobalForwardBreakpoint(){
}
@@ -40,7 +38,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getForwardName()});
+ return DebugMessages.getString("GlobalForwardBreakpoint.name", new
String[]{getMarker().getResource().getName(), getForwardName()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/PageEnterBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/PageEnterBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/PageEnterBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -20,8 +20,6 @@
public class PageEnterBreakpoint extends JspLineBreakpoint {
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"PageEnterBreakpoint.name";
-
public PageEnterBreakpoint() throws CoreException {
}
@@ -31,7 +29,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getPattern()});
+ return DebugMessages.getString("PageEnterBreakpoint.name", new
String[]{getPattern()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/TilesDefinitionGlobalForwardBreakpoint.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/TilesDefinitionGlobalForwardBreakpoint.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.debug/src/org/jboss/tools/struts/debug/internal/TilesDefinitionGlobalForwardBreakpoint.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -23,8 +23,6 @@
*/
public class TilesDefinitionGlobalForwardBreakpoint extends
ActionTilesDefinitionForwardBreakpoint {
- private static final String BREAKPOINT_LABEL_TEXT_KEY =
"TilesDefinitionGlobalForwardBreakpoint.name";
-
public TilesDefinitionGlobalForwardBreakpoint(){
}
@@ -43,7 +41,7 @@
public String getLabelText() {
try {
- return DebugMessages.getString(BREAKPOINT_LABEL_TEXT_KEY, new
String[]{getMarker().getResource().getName(), getForwardName()});
+ return
DebugMessages.getString("TilesDefinitionGlobalForwardBreakpoint.name", new
String[]{getMarker().getResource().getName(), getForwardName()}); //$NON-NLS-1$
} catch (CoreException e) {
StrutsDebugPlugin.log(e);
return "error";
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/AutomationPreferencePage.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/AutomationPreferencePage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/AutomationPreferencePage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.struts.ui.preferences;
-import java.util.ResourceBundle;
-
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
@@ -40,11 +38,9 @@
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
StyledText newControl = new StyledText(parent,SWT.WRAP);
- newControl.setText(ResourceBundle.getBundle(this.getClass().getPackage().getName()+".preferences").getString("AUTOMATION_PD"));
+ newControl.setText(Messages.getString("AUTOMATION_PD")); //$NON-NLS-1$
newControl.setBackground(parent.getBackground());
newControl.setEditable(false);
return newControl;
-
-
}
}
Added:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/Messages.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/Messages.java
(rev 0)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -0,0 +1,22 @@
+package org.jboss.tools.struts.ui.preferences;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.struts.ui.preferences.preferences"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsStudioPreferencesPage.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsStudioPreferencesPage.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/preferences/StrutsStudioPreferencesPage.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -17,8 +17,9 @@
*/
public class StrutsStudioPreferencesPage extends CompanyPreferencesPage {
- protected String getKey() {
- return "XSTUDIO_PD";
+ @Override
+ protected String getPrefsName() {
+ return Messages.getString("XSTUDIO_PD"); //$NON-NLS-1$
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,25 +10,30 @@
******************************************************************************/
package org.jboss.tools.vpe.ui.palette;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import java.lang.reflect.Field;
+/**
+ * @deprecated use the fields of PaletteUIMessages instead
+ */
public class Messages {
- private static final String BUNDLE_NAME =
"org.jboss.tools.vpe.ui.palette.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
private Messages() {
}
-
- public static String getString(String key) {
- // TODO Auto-generated method stub
+
+ /**
+ * Gets a resource string by field name. This is useful when the field name
+ * is constructed ad hoc.
+ *
+ * @param fieldName
+ * @return
+ */
+ public static String getString(String fieldName) {
+ Class c = PaletteUIMessages.class;
try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
+ Field field = c.getDeclaredField(fieldName);
+ return (String) field.get(null);
+ } catch (Exception e) {
PalettePlugin.getPluginLog().logError(e);
- return '!' + key + '!';
+ return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteUIMessages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteUIMessages.java 2009-04-07
04:30:28 UTC (rev 14532)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteUIMessages.java 2009-04-07
04:47:20 UTC (rev 14533)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.vpe.ui.palette;
+import java.util.ResourceBundle;
+
import org.eclipse.osgi.util.NLS;
@@ -25,4 +27,15 @@
public static String SHOW_HIDE;
public static String IMPORT_TLD;
public static String IMPORT;
+
+ private PaletteUIMessages() {
+ }
+
+ /**
+ * @deprecated use the fields of PaletteUIMessages instead
+ */
+ static final ResourceBundle getBundle() {
+ return ResourceBundle.getBundle(BUNDLE_NAME);
+ }
+
}