From f0a098779face204ee2221e3954d80b529e6dea9 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Tue, 2 Mar 2004 17:15:23 +0000 Subject: [PATCH] extern'd strings --- .../cdt/make/internal/ui/MakeResources.properties | 7 +++++++ .../internal/ui/editor/AddBuildTargetAction.java | 10 +++++----- .../editor/IMakefileEditorActionDefinitionIds.java | 4 ++-- .../internal/ui/editor/LexicalSortingAction.java | 14 +++++++------- .../ui/editor/MakefileContentOutlinePage.java | 2 +- .../ui/editor/MakefileDocumentProvider.java | 3 ++- .../ui/editor/MakefileSourceConfiguration.java | 2 +- .../text/makefile/MakefileCompletionProcessor.java | 8 ++++---- .../ui/text/makefile/MakefilePartitionScanner.java | 12 ++++++------ .../ui/text/makefile/MakefileTextHover.java | 2 +- .../eclipse/cdt/make/ui/dialogs/SettingsBlock.java | 3 +-- 11 files changed, 37 insertions(+), 30 deletions(-) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties index 0f5021a0b7f..14061379a2a 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties @@ -71,6 +71,13 @@ BuildPropertyCommon.label.message=Value: BuildPropertyCommon.label.browse=Browse... BuildPropertyCommon.label.configs=Defined configurations: +MakeDocumentProvider.exception.createElementInfo=Error creating element. + +AddBuildTargetAction.title=Add To Build Target +AddBuildTargetAction.description=Add To Build Target +AddBuildTargetAction.tooltip= Add To Build Target +AddBuildTargetAction.exception.internal=Internal Error + # Makefile Editor messages ContentAssistProposal.label=Content Assist@Ctrl+SPACE ContentAssistProposal.tooltip=Content Assist diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java index d5fa3060052..519fa297841 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/AddBuildTargetAction.java @@ -36,9 +36,9 @@ public class AddBuildTargetAction extends Action { }; public AddBuildTargetAction(MakefileContentOutlinePage outliner) { - super("Add To Build Target"); - setDescription("Add To Build Target"); - setToolTipText("Add To Build Target"); + super(MakeUIPlugin.getResourceString("AddBuildTargetAction.title")); //$NON-NLS-1$ + setDescription(MakeUIPlugin.getResourceString("AddBuildTargetAction.description")); //$NON-NLS-1$ + setToolTipText(MakeUIPlugin.getResourceString("AddBuildTargetAction.tooltip")); //$NON-NLS-1$ fOutliner = outliner; } @@ -82,7 +82,7 @@ public class AddBuildTargetAction extends Action { } } } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); + MakeUIPlugin.errorDialog(shell, MakeUIPlugin.getResourceString("AddBuildTargetAction.exception.internal"), e.toString(), e); //$NON-NLS-1$ target = null; } @@ -93,7 +93,7 @@ public class AddBuildTargetAction extends Action { dialog = new MakeTargetDialog(shell, target); dialog.open(); } catch (CoreException e) { - MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); + MakeUIPlugin.errorDialog(shell, MakeUIPlugin.getResourceString("AddBuildTargetAction.exception.internal"), e.toString(), e); //$NON-NLS-1$ } } } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java index 86d9c12ecf4..f8fc3bb0893 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/IMakefileEditorActionDefinitionIds.java @@ -17,8 +17,8 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; */ public interface IMakefileEditorActionDefinitionIds extends ITextEditorActionDefinitionIds { - String UNCOMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.comment"; + String UNCOMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.comment"; //$NON-NLS-1$ - String COMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.uncomment"; + String COMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.uncomment"; //$NON-NLS-1$ } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java index 8a726e49010..a37a692fa5a 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java @@ -23,18 +23,18 @@ import org.eclipse.jface.viewers.ViewerSorter; public class LexicalSortingAction extends Action { - private static final String ACTION_NAME = "LexicalSortingAction"; - private static final String DIALOG_STORE_KEY = ACTION_NAME + ".sort"; + private static final String ACTION_NAME = "LexicalSortingAction"; //$NON-NLS-1$ + private static final String DIALOG_STORE_KEY = ACTION_NAME + ".sort"; //$NON-NLS-1$ private LexicalMakefileSorter fSorter; private TreeViewer fTreeViewer; public LexicalSortingAction(TreeViewer treeViewer) { - super(MakeUIPlugin.getResourceString(ACTION_NAME + ".label")); + super(MakeUIPlugin.getResourceString(ACTION_NAME + ".label")); //$NON-NLS-1$ - setDescription(MakeUIPlugin.getResourceString(ACTION_NAME + ".description")); - setToolTipText(MakeUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); - MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_ALPHA_SORTING); + setDescription(MakeUIPlugin.getResourceString(ACTION_NAME + ".description")); //$NON-NLS-1$ + setToolTipText(MakeUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); //$NON-NLS-1$ + MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_ALPHA_SORTING); //$NON-NLS-1$ fTreeViewer = treeViewer; fSorter = new LexicalMakefileSorter(); @@ -50,7 +50,7 @@ public class LexicalSortingAction extends Action { setChecked(on); fTreeViewer.setSorter(on ? fSorter : null); - String key = ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); + String key = ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ setToolTipText(MakeUIPlugin.getResourceString(key)); if (store) { MakeUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java index c534d670eea..2856fd507b9 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileContentOutlinePage.java @@ -238,7 +238,7 @@ public class MakefileContentOutlinePage extends ContentOutlinePage implements IC viewer.setInput(fInput); } - MenuManager manager= new MenuManager("#MakefileOutlinerContext"); + MenuManager manager= new MenuManager("#MakefileOutlinerContext"); //$NON-NLS-1$ manager.setRemoveAllWhenShown(true); manager.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager m) { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java index e347f025e27..63156db939c 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileDocumentProvider.java @@ -16,6 +16,7 @@ import java.util.Iterator; import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.makefile.IMakefile; +import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; import org.eclipse.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; @@ -95,7 +96,7 @@ public class MakefileDocumentProvider extends FileDocumentProvider implements IM try { refreshFile(input.getFile()); } catch (CoreException x) { - handleCoreException(x, "FileDocumentProvider.createElementInfo"); + handleCoreException(x, MakeUIPlugin.getResourceString("MakeDocumentProvider.exception.createElementInfo")); //$NON-NLS-1$ } IDocument d = null; diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java index 0aecea3fe70..830b6df2d4b 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java @@ -163,7 +163,7 @@ public class MakefileSourceConfiguration extends SourceViewerConfiguration { * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) */ public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { - return new String[]{"#"}; + return new String[]{"#"}; //$NON-NLS-1$ } /* (non-Javadoc) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java index 3e9bc9c009b..f2282e03623 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileCompletionProcessor.java @@ -84,7 +84,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { } else if (o1 instanceof IRule) { name1 = ((IRule)o1).getTarget().toString(); } else { - name1 =""; + name1 =""; //$NON-NLS-1$ } if (o2 instanceof IMacroDefinition) { @@ -92,7 +92,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { } else if (o2 instanceof IRule) { name2 = ((IRule)o1).getTarget().toString(); } else { - name2 =""; + name2 =""; //$NON-NLS-1$ } //return String.CASE_INSENSITIVE_ORDER.compare(name1, name2); @@ -137,7 +137,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { for (int i = 0; i < statements.length; i++) { String name = null; Image image = null; - String infoString = "";//getContentInfoString(name); + String infoString = "";//getContentInfoString(name); //$NON-NLS-1$ if (statements[i] instanceof IMacroDefinition) { name = ((IMacroDefinition) statements[i]).getName(); image = imageMacro; @@ -149,7 +149,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor { } if (name != null && name.startsWith(wordPart.toString())) { IContextInformation info = new ContextInformation(name, infoString); - String displayString = (name.equals(infoString) ? name : name + " - " + infoString); + String displayString = (name.equals(infoString) ? name : name + " - " + infoString); //$NON-NLS-1$ ICompletionProposal result = new CompletionProposal( name, diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java index 0d7e3276432..80a48e72967 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefilePartitionScanner.java @@ -72,14 +72,14 @@ public class MakefilePartitionScanner extends RuleBasedPartitionScanner { rules.add(new EndOfLineRule("unexport", tDef)); //$NON-NLS-1$ rules.add(new EndOfLineRule("vpath", tDef)); //$NON-NLS-1$ rules.add(new EndOfLineRule("override", tDef)); //$NON-NLS-1$ - rules.add(new MultiLineRule("define", "endef", tDef)); //$NON-NLS-1$ - rules.add(new MultiLineRule("override define", "endef", tDef)); //$NON-NLS-1$ + rules.add(new MultiLineRule("define", "endef", tDef)); //$NON-NLS-1$ //$NON-NLS-2$ + rules.add(new MultiLineRule("override define", "endef", tDef)); //$NON-NLS-1$ //$NON-NLS-2$ // Add rules for multi-line comments and javadoc. - rules.add(new MultiLineRule("ifdef", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifndef", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ - rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ + rules.add(new MultiLineRule("ifdef", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$ + rules.add(new MultiLineRule("ifndef", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$ + rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$ + rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$ // Last rule must be supplied with default token! rules.add(new MacroRule(tMacro, tOther)); //$NON-NLS-1$ diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java index af7aa54e77a..db22049ce62 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java @@ -50,7 +50,7 @@ public class MakefileTextHover implements ITextHover { try { int len = hoverRegion.getLength(); int offset = hoverRegion.getOffset(); - String word = textViewer.getDocument().get(offset, len); + textViewer.getDocument().get(offset, len); // check off/len validity if (fEditor != null && len > -1) { IWorkingCopyManager fManager = MakeUIPlugin.getDefault().getWorkingCopyManager(); IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java index 20c844d8444..4617434dfb9 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/SettingsBlock.java @@ -92,6 +92,7 @@ public class SettingsBlock extends AbstractCOptionPage { if (fBuildInfo.isStopOnError()) { stopOnErrorButton.setSelection(true); } + stopOnErrorButton.setEnabled(fBuildInfo.isDefaultBuildCmd()); } protected void createBuildCmdControls(Composite parent) { @@ -143,8 +144,6 @@ public class SettingsBlock extends AbstractCOptionPage { } if (fBuildInfo.isDefaultBuildCmd()) { buildCommand.setEnabled(false); - } else { - stopOnErrorButton.setEnabled(false); } defButton.setSelection(fBuildInfo.isDefaultBuildCmd()); }