1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

extern'd strings

This commit is contained in:
David Inglis 2004-03-02 17:15:23 +00:00
parent f44a5cb403
commit f0a098779f
11 changed files with 37 additions and 30 deletions

View file

@ -71,6 +71,13 @@ BuildPropertyCommon.label.message=Value:
BuildPropertyCommon.label.browse=Browse... BuildPropertyCommon.label.browse=Browse...
BuildPropertyCommon.label.configs=Defined configurations: 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 # Makefile Editor messages
ContentAssistProposal.label=Content Assist@Ctrl+SPACE ContentAssistProposal.label=Content Assist@Ctrl+SPACE
ContentAssistProposal.tooltip=Content Assist ContentAssistProposal.tooltip=Content Assist

View file

@ -36,9 +36,9 @@ public class AddBuildTargetAction extends Action {
}; };
public AddBuildTargetAction(MakefileContentOutlinePage outliner) { public AddBuildTargetAction(MakefileContentOutlinePage outliner) {
super("Add To Build Target"); super(MakeUIPlugin.getResourceString("AddBuildTargetAction.title")); //$NON-NLS-1$
setDescription("Add To Build Target"); setDescription(MakeUIPlugin.getResourceString("AddBuildTargetAction.description")); //$NON-NLS-1$
setToolTipText("Add To Build Target"); setToolTipText(MakeUIPlugin.getResourceString("AddBuildTargetAction.tooltip")); //$NON-NLS-1$
fOutliner = outliner; fOutliner = outliner;
} }
@ -82,7 +82,7 @@ public class AddBuildTargetAction extends Action {
} }
} }
} catch (CoreException e) { } 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; target = null;
} }
@ -93,7 +93,7 @@ public class AddBuildTargetAction extends Action {
dialog = new MakeTargetDialog(shell, target); dialog = new MakeTargetDialog(shell, target);
dialog.open(); dialog.open();
} catch (CoreException e) { } catch (CoreException e) {
MakeUIPlugin.errorDialog(shell, "Internal Error", "", e); MakeUIPlugin.errorDialog(shell, MakeUIPlugin.getResourceString("AddBuildTargetAction.exception.internal"), e.toString(), e); //$NON-NLS-1$
} }
} }
} }

View file

@ -17,8 +17,8 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
*/ */
public interface IMakefileEditorActionDefinitionIds extends 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$
} }

View file

@ -23,18 +23,18 @@ import org.eclipse.jface.viewers.ViewerSorter;
public class LexicalSortingAction extends Action { public class LexicalSortingAction extends Action {
private static final String ACTION_NAME = "LexicalSortingAction"; private static final String ACTION_NAME = "LexicalSortingAction"; //$NON-NLS-1$
private static final String DIALOG_STORE_KEY = ACTION_NAME + ".sort"; private static final String DIALOG_STORE_KEY = ACTION_NAME + ".sort"; //$NON-NLS-1$
private LexicalMakefileSorter fSorter; private LexicalMakefileSorter fSorter;
private TreeViewer fTreeViewer; private TreeViewer fTreeViewer;
public LexicalSortingAction(TreeViewer treeViewer) { 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")); setDescription(MakeUIPlugin.getResourceString(ACTION_NAME + ".description")); //$NON-NLS-1$
setToolTipText(MakeUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); setToolTipText(MakeUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); //$NON-NLS-1$
MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_ALPHA_SORTING); MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_ALPHA_SORTING); //$NON-NLS-1$
fTreeViewer = treeViewer; fTreeViewer = treeViewer;
fSorter = new LexicalMakefileSorter(); fSorter = new LexicalMakefileSorter();
@ -50,7 +50,7 @@ public class LexicalSortingAction extends Action {
setChecked(on); setChecked(on);
fTreeViewer.setSorter(on ? fSorter : null); 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)); setToolTipText(MakeUIPlugin.getResourceString(key));
if (store) { if (store) {
MakeUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on); MakeUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on);

View file

@ -238,7 +238,7 @@ public class MakefileContentOutlinePage extends ContentOutlinePage implements IC
viewer.setInput(fInput); viewer.setInput(fInput);
} }
MenuManager manager= new MenuManager("#MakefileOutlinerContext"); MenuManager manager= new MenuManager("#MakefileOutlinerContext"); //$NON-NLS-1$
manager.setRemoveAllWhenShown(true); manager.setRemoveAllWhenShown(true);
manager.addMenuListener(new IMenuListener() { manager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager m) { public void menuAboutToShow(IMenuManager m) {

View file

@ -16,6 +16,7 @@ import java.util.Iterator;
import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.makefile.IMakefile; 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.cdt.make.internal.ui.text.makefile.MakefilePartitionScanner;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -95,7 +96,7 @@ public class MakefileDocumentProvider extends FileDocumentProvider implements IM
try { try {
refreshFile(input.getFile()); refreshFile(input.getFile());
} catch (CoreException x) { } catch (CoreException x) {
handleCoreException(x, "FileDocumentProvider.createElementInfo"); handleCoreException(x, MakeUIPlugin.getResourceString("MakeDocumentProvider.exception.createElementInfo")); //$NON-NLS-1$
} }
IDocument d = null; IDocument d = null;

View file

@ -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) * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDefaultPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/ */
public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) {
return new String[]{"#"}; return new String[]{"#"}; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -84,7 +84,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
} else if (o1 instanceof IRule) { } else if (o1 instanceof IRule) {
name1 = ((IRule)o1).getTarget().toString(); name1 = ((IRule)o1).getTarget().toString();
} else { } else {
name1 =""; name1 =""; //$NON-NLS-1$
} }
if (o2 instanceof IMacroDefinition) { if (o2 instanceof IMacroDefinition) {
@ -92,7 +92,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
} else if (o2 instanceof IRule) { } else if (o2 instanceof IRule) {
name2 = ((IRule)o1).getTarget().toString(); name2 = ((IRule)o1).getTarget().toString();
} else { } else {
name2 =""; name2 =""; //$NON-NLS-1$
} }
//return String.CASE_INSENSITIVE_ORDER.compare(name1, name2); //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++) { for (int i = 0; i < statements.length; i++) {
String name = null; String name = null;
Image image = null; Image image = null;
String infoString = "";//getContentInfoString(name); String infoString = "";//getContentInfoString(name); //$NON-NLS-1$
if (statements[i] instanceof IMacroDefinition) { if (statements[i] instanceof IMacroDefinition) {
name = ((IMacroDefinition) statements[i]).getName(); name = ((IMacroDefinition) statements[i]).getName();
image = imageMacro; image = imageMacro;
@ -149,7 +149,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
} }
if (name != null && name.startsWith(wordPart.toString())) { if (name != null && name.startsWith(wordPart.toString())) {
IContextInformation info = new ContextInformation(name, infoString); 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 = ICompletionProposal result =
new CompletionProposal( new CompletionProposal(
name, name,

View file

@ -72,14 +72,14 @@ public class MakefilePartitionScanner extends RuleBasedPartitionScanner {
rules.add(new EndOfLineRule("unexport", tDef)); //$NON-NLS-1$ rules.add(new EndOfLineRule("unexport", tDef)); //$NON-NLS-1$
rules.add(new EndOfLineRule("vpath", 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 EndOfLineRule("override", tDef)); //$NON-NLS-1$
rules.add(new MultiLineRule("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$ rules.add(new MultiLineRule("override define", "endef", tDef)); //$NON-NLS-1$ //$NON-NLS-2$
// Add rules for multi-line comments and javadoc. // Add rules for multi-line comments and javadoc.
rules.add(new MultiLineRule("ifdef", "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$ rules.add(new MultiLineRule("ifndef", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
// Last rule must be supplied with default token! // Last rule must be supplied with default token!
rules.add(new MacroRule(tMacro, tOther)); //$NON-NLS-1$ rules.add(new MacroRule(tMacro, tOther)); //$NON-NLS-1$

View file

@ -50,7 +50,7 @@ public class MakefileTextHover implements ITextHover {
try { try {
int len = hoverRegion.getLength(); int len = hoverRegion.getLength();
int offset = hoverRegion.getOffset(); 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) { if (fEditor != null && len > -1) {
IWorkingCopyManager fManager = MakeUIPlugin.getDefault().getWorkingCopyManager(); IWorkingCopyManager fManager = MakeUIPlugin.getDefault().getWorkingCopyManager();
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());

View file

@ -92,6 +92,7 @@ public class SettingsBlock extends AbstractCOptionPage {
if (fBuildInfo.isStopOnError()) { if (fBuildInfo.isStopOnError()) {
stopOnErrorButton.setSelection(true); stopOnErrorButton.setSelection(true);
} }
stopOnErrorButton.setEnabled(fBuildInfo.isDefaultBuildCmd());
} }
protected void createBuildCmdControls(Composite parent) { protected void createBuildCmdControls(Composite parent) {
@ -143,8 +144,6 @@ public class SettingsBlock extends AbstractCOptionPage {
} }
if (fBuildInfo.isDefaultBuildCmd()) { if (fBuildInfo.isDefaultBuildCmd()) {
buildCommand.setEnabled(false); buildCommand.setEnabled(false);
} else {
stopOnErrorButton.setEnabled(false);
} }
defButton.setSelection(fBuildInfo.isDefaultBuildCmd()); defButton.setSelection(fBuildInfo.isDefaultBuildCmd());
} }