diff options
Diffstat (limited to 'bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit')
4 files changed, 27 insertions, 34 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java index 214c98cee1..3d8278c182 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java @@ -36,8 +36,7 @@ import org.eclipse.wst.sse.ui.GotoAnnotationAction; import org.eclipse.wst.sse.ui.ISourceViewerActionBarContributor; import org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder; import org.eclipse.wst.sse.ui.extension.IExtendedContributor; -import org.eclipse.wst.sse.ui.nls.ResourceHandler; - +import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; /** * XMLEditorActionContributor @@ -79,7 +78,7 @@ public class ActionContributor extends BasicTextEditorActionContributor implemen public ActionContributor() { super(); - ResourceBundle resourceBundle = ResourceHandler.getResourceBundle(); + ResourceBundle resourceBundle = SSEUIPlugin.getDefault().getResourceBundle(); fCommandsSeparator = new Separator(); @@ -96,7 +95,7 @@ public class ActionContributor extends BasicTextEditorActionContributor implemen fStructureSelectHistoryAction = new RetargetTextEditorAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY + StructuredTextEditorActionConstants.DOT); fStructureSelectHistoryAction.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_HISTORY); - fExpandSelectionToMenu = new MenuManager(ResourceHandler.getString("ExpandSelectionToMenu.label")); //$NON-NLS-1$ + fExpandSelectionToMenu = new MenuManager(SSEUIPlugin.getResourceString("%ExpandSelectionToMenu.label")); //$NON-NLS-1$ fExpandSelectionToMenu.add(fStructureSelectEnclosingAction); fExpandSelectionToMenu.add(fStructureSelectNextAction); fExpandSelectionToMenu.add(fStructureSelectPreviousAction); @@ -151,7 +150,7 @@ public class ActionContributor extends BasicTextEditorActionContributor implemen } // source commands - String sourceMenuLabel = ResourceHandler.getString("SourceMenu.label"); //$NON-NLS-1$ + String sourceMenuLabel = SSEUIPlugin.getResourceString("%SourceMenu.label"); //$NON-NLS-1$ String sourceMenuId = "sourceMenuId"; // This is just a menu id. No // need to translate. // //$NON-NLS-1$ diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java index 46c747b2a0..202741822a 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java @@ -23,8 +23,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.TextEditorAction; import org.eclipse.wst.sse.core.cleanup.IStructuredCleanupProcessor; import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.nls.ResourceHandler; - +import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; public abstract class CleanupAction extends TextEditorAction { protected Dialog fCleanupDialog; @@ -55,7 +54,7 @@ public abstract class CleanupAction extends TextEditorAction { try { // begin recording ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); - editor.getModel().beginRecording(this, ResourceHandler.getString("Cleanup_Document_UI_"), ResourceHandler.getString("Cleanup_Document_UI_"), selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ + editor.getModel().beginRecording(this, SSEUIPlugin.getResourceString("%Cleanup_Document_UI_"), SSEUIPlugin.getResourceString("%Cleanup_Document_UI_"), selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ // tell the model that we are about to make a big // model change diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java index 12ec44150e..397da69f72 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java @@ -35,10 +35,8 @@ import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.editors.text.TextFileDocumentProvider; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; import org.eclipse.wst.sse.ui.internal.Logger; -import org.eclipse.wst.sse.ui.nls.ResourceHandler; - +import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDelegate { @@ -108,7 +106,7 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel if (fErrorStatus.getChildren().length > 0) { status = fErrorStatus; - fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ + fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ } return status; @@ -116,7 +114,7 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel } - private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ + private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ protected String fLineDelimiter = "\r\n"; //$NON-NLS-1$ protected void convert(IProgressMonitor monitor, IFile file) { @@ -129,7 +127,7 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel IContentType contentType = contentDescription.getContentType(); if (contentType.isKindOf(Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.text"))) { //$NON-NLS-1$ if (monitor == null || !monitor.isCanceled()) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.3"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.3"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ monitor.subTask(message); IFileEditorInput input = new FileEditorInput(file); @@ -153,10 +151,10 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel } } } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } catch (BadLocationException e) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } } @@ -177,14 +175,14 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel convert(monitor, members[i]); } } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } } } protected Job getJob() { - return new ConvertLineDelimitersJob(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.jobName")); //$NON-NLS-1$ + return new ConvertLineDelimitersJob(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.jobName")); //$NON-NLS-1$ } /* @@ -199,7 +197,7 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel try { resource.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException e) { - monitor.setTaskName(ResourceHandler.getString("ActionDelegate.0") + resource.getName()); //$NON-NLS-1$ + monitor.setTaskName(SSEUIPlugin.getResourceString("%ActionDelegate.0") + resource.getName()); //$NON-NLS-1$ } } @@ -255,10 +253,10 @@ public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDel outputStream = new FileOutputStream(file.getLocation().toString()); outputStream.write(outputString.getBytes(file.getCharset())); } catch (IOException e) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ + String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } finally { try { diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java index 742f7c0e1e..52a01d2bee 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java @@ -13,7 +13,6 @@ package org.eclipse.wst.sse.ui.edit.util; import java.io.IOException; -import java.text.MessageFormat; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; @@ -29,10 +28,8 @@ import org.eclipse.core.runtime.jobs.Job; import org.eclipse.wst.common.encoding.exceptions.MalformedInputExceptionWithDetail; import org.eclipse.wst.sse.core.format.IStructuredFormatProcessor; import org.eclipse.wst.sse.ui.extension.FormatProcessorsExtensionReader; -import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; import org.eclipse.wst.sse.ui.internal.Logger; -import org.eclipse.wst.sse.ui.nls.ResourceHandler; - +import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; public class FormatActionDelegate extends ResourceActionDelegate { @@ -102,7 +99,7 @@ public class FormatActionDelegate extends ResourceActionDelegate { if (fErrorStatus.getChildren().length > 0) { status = fErrorStatus; - fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, ResourceHandler.getString("FormatActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ + fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%FormatActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ } return status; @@ -110,7 +107,7 @@ public class FormatActionDelegate extends ResourceActionDelegate { } - private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, ResourceHandler.getString("FormatActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ + private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%FormatActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ protected void format(IProgressMonitor monitor, IFile file) { try { @@ -122,19 +119,19 @@ public class FormatActionDelegate extends ResourceActionDelegate { IContentType contentType = contentDescription.getContentType(); IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId()); if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.3"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.3", new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ monitor.subTask(message); formatProcessor.setProgressMonitor(monitor); formatProcessor.formatFile(file); } } catch (MalformedInputExceptionWithDetail e) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.5"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.5", new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } catch (IOException e) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.4"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.4", new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.4"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.4", new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } } @@ -155,7 +152,7 @@ public class FormatActionDelegate extends ResourceActionDelegate { format(monitor, members[i]); } } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.4"), new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.4", new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } } @@ -166,7 +163,7 @@ public class FormatActionDelegate extends ResourceActionDelegate { } protected Job getJob() { - return new FormatJob(ResourceHandler.getString("FormatActionDelegate.jobName")); //$NON-NLS-1$ + return new FormatJob(SSEUIPlugin.getResourceString("%FormatActionDelegate.jobName")); //$NON-NLS-1$ } /* @@ -181,7 +178,7 @@ public class FormatActionDelegate extends ResourceActionDelegate { try { resource.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException e) { - String message = MessageFormat.format(ResourceHandler.getString("FormatActionDelegate.4"), new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ + String message = SSEUIPlugin.getResourceString("%FormatActionDelegate.4", new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); } } |