1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

Externalized strings

This commit is contained in:
Alena Laskavaia 2010-05-07 02:58:31 +00:00
parent c2bf10a787
commit e0ee9359b1
22 changed files with 149 additions and 47 deletions

View file

@ -11,7 +11,7 @@ import org.osgi.framework.BundleContext;
public class CheckersUiActivator extends AbstractUIPlugin { public class CheckersUiActivator extends AbstractUIPlugin {
// The plug-in ID // The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers.ui"; public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers.ui"; //$NON-NLS-1$
// The shared instance // The shared instance
private static CheckersUiActivator plugin; private static CheckersUiActivator plugin;

View file

@ -32,6 +32,6 @@ public class CxxBranchNode extends BranchNode {
*/ */
@Override @Override
public String toString() { public String toString() {
return labelData.getRawSignature()+":"; return labelData.getRawSignature()+":"; //$NON-NLS-1$
} }
} }

View file

@ -37,7 +37,7 @@ public class CxxDecisionNode extends DecisionNode {
*/ */
public String toStringData() { public String toStringData() {
if (getNode() == null) if (getNode() == null)
return ""; return ""; //$NON-NLS-1$
return getNode().getRawSignature(); return getNode().getRawSignature();
} }
} }

View file

@ -38,7 +38,7 @@ public class CxxExitNode extends ExitNode implements IExitNode {
*/ */
public String toStringData() { public String toStringData() {
if (getNode() == null) if (getNode() == null)
return "return; // fake"; return "return; // fake"; //$NON-NLS-1$
return getNode().getRawSignature(); return getNode().getRawSignature();
} }
} }

View file

@ -39,7 +39,7 @@ public class CxxPlainNode extends PlainNode {
*/ */
public String toStringData() { public String toStringData() {
if (getNode() == null) if (getNode() == null)
return ""; return ""; //$NON-NLS-1$
return getNode().getRawSignature(); return getNode().getRawSignature();
} }
} }

View file

@ -30,6 +30,6 @@ public class CxxStartNode extends StartNode {
*/ */
@Override @Override
public String toString() { public String toString() {
return "start"; return "start"; //$NON-NLS-1$
} }
} }

View file

@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2009,2010 Alena Laskavaia
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core;
import org.eclipse.osgi.util.NLS;
/**
* TODO: add description
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.codan.core.messages"; //$NON-NLS-1$
public static String CodanApplication_3;
public static String CodanApplication_all_option;
public static String CodanApplication_Error_ProjectDoesNotExists;
public static String CodanApplication_LogRunProject;
public static String CodanApplication_LogRunWorkspace;
public static String CodanApplication_Options;
public static String CodanApplication_Usage;
public static String CodanApplication_verbose_option;
public static String CodanBuilder_Code_Analysis_On;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,8 @@
CodanApplication_Error_ProjectDoesNotExists=Error: project {0} does not exist
CodanApplication_LogRunProject=Launching analysis on project
CodanApplication_LogRunWorkspace=Launching analysis on workspace
CodanApplication_Usage=Usage: [options] <project1> <project2> ...
CodanApplication_Options=Options:
CodanApplication_all_option= -all - run on all projects in workspace
CodanApplication_verbose_option= -verbose - print extra build information
CodanBuilder_Code_Analysis_On=Code analysis on

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import org.eclipse.cdt.codan.core.CodanRuntime; import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.Messages;
import org.eclipse.cdt.codan.internal.core.model.CodanMarkerProblemReporter; import org.eclipse.cdt.codan.internal.core.model.CodanMarkerProblemReporter;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -12,6 +13,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.osgi.util.NLS;
/** /**
* *
@ -40,21 +42,23 @@ public class CodanApplication implements IApplication {
public void reportProblem(String id, String markerType, public void reportProblem(String id, String markerType,
int severity, IFile file, int lineNumber, int startChar, int severity, IFile file, int lineNumber, int startChar,
int endChar, String message) { int endChar, String message) {
System.out.println(file.getLocation() + ":" + lineNumber + ": " System.out.println(file.getLocation() + ":" + lineNumber + ": " //$NON-NLS-1$ //$NON-NLS-2$
+ message); + message);
} }
}); });
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if (all) { if (all) {
log("Launching analysis on workspace"); log(Messages.CodanApplication_LogRunWorkspace);
codanBuilder.processResource(root, new NullProgressMonitor()); codanBuilder.processResource(root, new NullProgressMonitor());
} else { } else {
for (String project : projects) { for (String project : projects) {
log("Launching analysis on project " + project); log(Messages.CodanApplication_LogRunProject + project);
IProject wProject = root.getProject(project); IProject wProject = root.getProject(project);
if (!wProject.exists()) { if (!wProject.exists()) {
System.err.println("Error: project " + project System.err.println( //
+ " does not exist"); NLS.bind(
Messages.CodanApplication_Error_ProjectDoesNotExists,
project));
continue; continue;
} }
codanBuilder.processResource(wProject, codanBuilder.processResource(wProject,
@ -78,9 +82,9 @@ public class CodanApplication implements IApplication {
private void extractArguments(String[] args) { private void extractArguments(String[] args) {
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
String string = args[i]; String string = args[i];
if (string.equals("-verbose")) { if (string.equals("-verbose")) { //$NON-NLS-1$
verbose = true; verbose = true;
} else if (string.equals("-all")) { } else if (string.equals("-all")) { //$NON-NLS-1$
all = true; all = true;
} else { } else {
projects.add(string); projects.add(string);
@ -92,10 +96,10 @@ public class CodanApplication implements IApplication {
* *
*/ */
private void help() { private void help() {
System.out.println("Usage: [options] <project1> <project2> ..."); System.out.println(Messages.CodanApplication_Usage);
System.out.println("Options:"); System.out.println(Messages.CodanApplication_Options);
System.out.println(" -all - run on all projects in workspace"); System.out.println(Messages.CodanApplication_all_option);
System.out.println(" -verbose - print extra build information"); System.out.println(Messages.CodanApplication_verbose_option);
} }
public void stop() { public void stop() {

View file

@ -14,6 +14,7 @@ import java.util.Map;
import org.eclipse.cdt.codan.core.CodanCorePlugin; import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.CodanRuntime; import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.Messages;
import org.eclipse.cdt.codan.core.model.IChecker; import org.eclipse.cdt.codan.core.model.IChecker;
import org.eclipse.cdt.codan.core.model.ICodanBuilder; import org.eclipse.cdt.codan.core.model.ICodanBuilder;
import org.eclipse.cdt.codan.core.model.IProblemReporter; import org.eclipse.cdt.codan.core.model.IProblemReporter;
@ -105,7 +106,7 @@ public class CodanBuilder extends IncrementalProjectBuilder implements
} }
int tick = 1000; int tick = 1000;
// System.err.println("processing " + resource); // System.err.println("processing " + resource);
monitor.beginTask("Code analysis on " + resource, checkers + memsize monitor.beginTask(Messages.CodanBuilder_Code_Analysis_On + resource, checkers + memsize
* tick); * tick);
try { try {
IProblemReporter problemReporter = CodanRuntime.getInstance() IProblemReporter problemReporter = CodanRuntime.getInstance()

View file

@ -44,13 +44,13 @@ public abstract class AbstractBasicBlock implements IBasicBlock {
*/ */
public String toStringData() { public String toStringData() {
if (getData() == null) if (getData() == null)
return "0x" + Integer.toHexString(System.identityHashCode(this)); return "0x" + Integer.toHexString(System.identityHashCode(this)); //$NON-NLS-1$
return getData().toString(); return getData().toString();
} }
@Override @Override
public String toString() { public String toString() {
return getClass().getSimpleName() + ": " + toStringData(); return getClass().getSimpleName() + ": " + toStringData(); //$NON-NLS-1$
} }
/** /**

View file

@ -75,7 +75,7 @@ public class ControlFlowGraph implements IControlFlowGraph {
} }
public void print(IBasicBlock node) { public void print(IBasicBlock node) {
System.out.println(node.getClass().getSimpleName() + ": " System.out.println(node.getClass().getSimpleName() + ": " //$NON-NLS-1$
+ ((AbstractBasicBlock) node).toStringData()); + ((AbstractBasicBlock) node).toStringData());
if (node instanceof IDecisionNode) { if (node instanceof IDecisionNode) {
// todo // todo
@ -83,9 +83,9 @@ public class ControlFlowGraph implements IControlFlowGraph {
.getOutgoingIterator(); .getOutgoingIterator();
for (; branches.hasNext();) { for (; branches.hasNext();) {
IBasicBlock brNode = branches.next(); IBasicBlock brNode = branches.next();
System.out.println("{"); System.out.println("{"); //$NON-NLS-1$
print(brNode); print(brNode);
System.out.println("}"); System.out.println("}"); //$NON-NLS-1$
} }
print(((IDecisionNode) node).getMergeNode()); print(((IDecisionNode) node).getMergeNode());
} else if (node instanceof ISingleOutgoing) { } else if (node instanceof ISingleOutgoing) {
@ -118,15 +118,14 @@ public class ControlFlowGraph implements IControlFlowGraph {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see org.eclipse.cdt.codan.core.model.cfg.IControlFlowGraph#getNodes ()
* org.eclipse.cdt.codan.core.model.cfg.IControlFlowGraph#getNodes
* ()
*/ */
public Collection<IBasicBlock> getNodes() { public Collection<IBasicBlock> getNodes() {
Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>(); Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>();
getNodes(getStartNode(), result); getNodes(getStartNode(), result);
for (Iterator iterator = deadNodes.iterator(); iterator.hasNext();) { for (Iterator<IBasicBlock> iterator = deadNodes.iterator(); iterator
IBasicBlock d = (IBasicBlock) iterator.next(); .hasNext();) {
IBasicBlock d = iterator.next();
getNodes(d, result); getNodes(d, result);
} }
return result; return result;

View file

@ -98,7 +98,7 @@ public class CodanMarkerProblemReporter implements IProblemReporterPersistent {
marker.setAttribute(IMarker.PROBLEM, id); marker.setAttribute(IMarker.PROBLEM, id);
marker.setAttribute(IMarker.CHAR_END, endChar); marker.setAttribute(IMarker.CHAR_END, endChar);
marker.setAttribute(IMarker.CHAR_START, startChar); marker.setAttribute(IMarker.CHAR_START, startChar);
marker.setAttribute("org.eclipse.cdt.core.problem", 42); marker.setAttribute("org.eclipse.cdt.core.problem", 42); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -15,7 +15,8 @@
defaultSeverity="Info" defaultSeverity="Info"
id="org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionProblem" id="org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionProblem"
messagePattern="Bad function name (example) &quot;{0}&quot; (pattern /{1}/)" messagePattern="Bad function name (example) &quot;{0}&quot; (pattern /{1}/)"
name="Name convention for function (example)"> name="Name convention for function (example)"
markerType="org.eclipse.cdt.codan.core.codanProblem">
</problem> </problem>
</checker> </checker>
</extension> </extension>

View file

@ -63,7 +63,7 @@ public abstract class AbstractCodanCQuickFixProcessor implements IQuickFixProces
IMarker m = markers[i]; IMarker m = markers[i];
int start = m.getAttribute(IMarker.CHAR_START, -1); int start = m.getAttribute(IMarker.CHAR_START, -1);
if (start==loc.getOffset()) { if (start==loc.getOffset()) {
String id = m.getAttribute(IMarker.PROBLEM,""); String id = m.getAttribute(IMarker.PROBLEM,""); //$NON-NLS-1$
return getCorrections(context, id, m); return getCorrections(context, id, m);
} }
} }

View file

@ -28,7 +28,7 @@ import org.osgi.framework.BundleContext;
*/ */
public class CodanUIActivator extends AbstractUIPlugin { public class CodanUIActivator extends AbstractUIPlugin {
// The plug-in ID // The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.cdt.codan.ui"; public static final String PLUGIN_ID = "org.eclipse.cdt.codan.ui"; //$NON-NLS-1$
// The shared instance // The shared instance
private static CodanUIActivator plugin; private static CodanUIActivator plugin;
private IPreferenceStore preferenceCoreStore; private IPreferenceStore preferenceCoreStore;

View file

@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright (c) 2009,2010 Alena Laskavaia
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui;
import org.eclipse.osgi.util.NLS;
/**
* TODO: add description
*/
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.codan.internal.ui.messages"; //$NON-NLS-1$
public static String BuildPropertyPage_RunAsYouType;
public static String BuildPropertyPage_RunWithBuild;
public static String CheckedTreeEditor_SelectionCannotBeEmpty;
public static String CodanPreferencePage_Customize;
public static String CodanPreferencePage_HasParameters;
public static String CodanPreferencePage_Info;
public static String CodanPreferencePage_NoInfo;
public static String CodanPreferencePage_NoParameters;
public static String ProblemsTreeEditor_NameColumn;
public static String ProblemsTreeEditor_Problems;
public static String ProblemsTreeEditor_SeverityColumn;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -1,6 +1,17 @@
BuildPropertyPage_RunAsYouType=Run as you &type (selected checkers)
BuildPropertyPage_RunWithBuild=&Run with build
CheckedTreeEditor_SelectionCannotBeEmpty=Selection cannot be empty
CodanPreferencePage_Customize=Customize...
CodanPreferencePage_HasParameters=This problem has parameters
CodanPreferencePage_Info=Info
CodanPreferencePage_NoInfo=No additional information
CodanPreferencePage_NoParameters=No parameters
CustomizeProblemComposite_TabParameters=Parameters CustomizeProblemComposite_TabParameters=Parameters
CustomizeProblemComposite_TabScope=Scope CustomizeProblemComposite_TabScope=Scope
CustomizeProblemDialog_Message=Edit problem parameters, scope and launch options CustomizeProblemDialog_Message=Edit problem parameters, scope and launch options
CustomizeProblemDialog_Title=Customize Problem... CustomizeProblemDialog_Title=Customize Problem...
Job_TitleRunningAnalysis=Running Code Analysis Job_TitleRunningAnalysis=Running Code Analysis
ParametersComposite_None=No Parameters ParametersComposite_None=No Parameters
ProblemsTreeEditor_NameColumn=Name
ProblemsTreeEditor_Problems=Problems
ProblemsTreeEditor_SeverityColumn=Severity

View file

@ -2,6 +2,7 @@ package org.eclipse.cdt.codan.internal.ui.preferences;
import org.eclipse.cdt.codan.core.PreferenceConstants; import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator; import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
import org.eclipse.cdt.codan.internal.ui.Messages;
import org.eclipse.cdt.codan.internal.ui.actions.ToggleNatureAction; import org.eclipse.cdt.codan.internal.ui.actions.ToggleNatureAction;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
@ -31,9 +32,9 @@ public class BuildPropertyPage extends FieldEditorPreferencePage implements
@Override @Override
protected void createFieldEditors() { protected void createFieldEditors() {
addField(new BooleanFieldEditor(PreferenceConstants.P_RUN_ON_BUILD, addField(new BooleanFieldEditor(PreferenceConstants.P_RUN_ON_BUILD,
"&Run with build", getFieldEditorParent())); Messages.BuildPropertyPage_RunWithBuild, getFieldEditorParent()));
addField(new BooleanFieldEditor(PreferenceConstants.P_RUN_IN_EDITOR, addField(new BooleanFieldEditor(PreferenceConstants.P_RUN_IN_EDITOR,
"Run as you &type (selected checkers)", getFieldEditorParent())); Messages.BuildPropertyPage_RunAsYouType, getFieldEditorParent()));
} }
@Override @Override
@ -90,6 +91,6 @@ public class BuildPropertyPage extends FieldEditorPreferencePage implements
} }
protected String getPageId() { protected String getPageId() {
return "org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage"; return "org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage"; //$NON-NLS-1$
} }
} }

View file

@ -10,6 +10,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.preferences; package org.eclipse.cdt.codan.internal.ui.preferences;
import org.eclipse.cdt.codan.internal.ui.Messages;
import org.eclipse.jface.preference.FieldEditor; import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer; import org.eclipse.jface.viewers.CheckboxTreeViewer;
@ -312,7 +313,7 @@ public abstract class CheckedTreeEditor extends FieldEditor implements
if (!emptySelectionAllowed) { if (!emptySelectionAllowed) {
Object[] checkedElements = getTreeViewer().getCheckedElements(); Object[] checkedElements = getTreeViewer().getCheckedElements();
if (checkedElements.length == 0) { if (checkedElements.length == 0) {
showErrorMessage("Selection cannot be empty"); showErrorMessage(Messages.CheckedTreeEditor_SelectionCannotBeEmpty);
return false; return false;
} }
} }

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.codan.core.model.ICheckersRegistry;
import org.eclipse.cdt.codan.core.model.IProblem; import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemParameterInfo; import org.eclipse.cdt.codan.core.model.IProblemParameterInfo;
import org.eclipse.cdt.codan.core.model.IProblemProfile; import org.eclipse.cdt.codan.core.model.IProblemProfile;
import org.eclipse.cdt.codan.internal.ui.Messages;
import org.eclipse.cdt.codan.internal.ui.dialogs.CustomizeProblemDialog; import org.eclipse.cdt.codan.internal.ui.dialogs.CustomizeProblemDialog;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.core.runtime.preferences.InstanceScope;
@ -126,14 +127,14 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements
info = new Group(comp, SWT.NONE); info = new Group(comp, SWT.NONE);
info.setLayoutData(new GridData(GridData.FILL_BOTH)); info.setLayoutData(new GridData(GridData.FILL_BOTH));
info.setLayout(new GridLayout(2, false)); info.setLayout(new GridLayout(2, false));
info.setText("Info"); info.setText(Messages.CodanPreferencePage_Info);
infoParams = new Label(info, SWT.NONE); infoParams = new Label(info, SWT.NONE);
infoParams.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, infoParams.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false,
false)); false));
infoButton = new Button(info, SWT.PUSH); infoButton = new Button(info, SWT.PUSH);
infoButton infoButton
.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false)); .setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
infoButton.setText("Customize..."); infoButton.setText(Messages.CodanPreferencePage_Customize);
infoButton.addSelectionListener(new SelectionAdapter() { infoButton.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -180,17 +181,17 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements
*/ */
private void updateProblemInfo() { private void updateProblemInfo() {
if (selectedProblem == null) { if (selectedProblem == null) {
infoMessage.setText(""); infoMessage.setText(""); //$NON-NLS-1$
infoParams.setText(""); infoParams.setText(""); //$NON-NLS-1$
infoButton.setEnabled(false); infoButton.setEnabled(false);
} else { } else {
IProblemParameterInfo parameterInfo = selectedProblem IProblemParameterInfo parameterInfo = selectedProblem
.getParameterInfo(); .getParameterInfo();
String desc = selectedProblem.getDescription(); String desc = selectedProblem.getDescription();
infoMessage.setText(desc == null ? "No additional information" infoMessage.setText(desc == null ? Messages.CodanPreferencePage_NoInfo
: desc); : desc);
infoParams.setText(parameterInfo == null ? "No parameters" infoParams.setText(parameterInfo == null ? Messages.CodanPreferencePage_NoParameters
: "This problem has parameters"); : Messages.CodanPreferencePage_HasParameters);
infoButton.setEnabled(true); infoButton.setEnabled(true);
} }
info.layout(true); info.layout(true);

View file

@ -18,6 +18,7 @@ import org.eclipse.cdt.codan.core.model.IProblemElement;
import org.eclipse.cdt.codan.core.model.IProblemProfile; import org.eclipse.cdt.codan.core.model.IProblemProfile;
import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy; import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
import org.eclipse.cdt.codan.internal.core.CodanPreferencesLoader; import org.eclipse.cdt.codan.internal.core.CodanPreferencesLoader;
import org.eclipse.cdt.codan.internal.ui.Messages;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.viewers.CellEditor; import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckStateChangedEvent;
@ -145,7 +146,7 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
public ProblemsTreeEditor(Composite parent, IProblemProfile profile) { public ProblemsTreeEditor(Composite parent, IProblemProfile profile) {
super(PreferenceConstants.P_PROBLEMS, "Problems", parent); super(PreferenceConstants.P_PROBLEMS, Messages.ProblemsTreeEditor_Problems, parent);
setEmptySelectionAllowed(true); setEmptySelectionAllowed(true);
getTreeViewer().getTree().setHeaderVisible(true); getTreeViewer().getTree().setHeaderVisible(true);
// getTreeViewer().getTree(). // getTreeViewer().getTree().
@ -154,7 +155,7 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
// column Name // column Name
TreeViewerColumn column1 = new TreeViewerColumn(getTreeViewer(), SWT.NONE); TreeViewerColumn column1 = new TreeViewerColumn(getTreeViewer(), SWT.NONE);
column1.getColumn().setWidth(300); column1.getColumn().setWidth(300);
column1.getColumn().setText("Name"); column1.getColumn().setText(Messages.ProblemsTreeEditor_NameColumn);
column1.setLabelProvider(new ColumnLabelProvider() { column1.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) { public String getText(Object element) {
if (element instanceof IProblem) { if (element instanceof IProblem) {
@ -171,7 +172,7 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
// column Severity // column Severity
TreeViewerColumn column2 = new TreeViewerColumn(getTreeViewer(), SWT.NONE); TreeViewerColumn column2 = new TreeViewerColumn(getTreeViewer(), SWT.NONE);
column2.getColumn().setWidth(100); column2.getColumn().setWidth(100);
column2.getColumn().setText("Severity"); column2.getColumn().setText(Messages.ProblemsTreeEditor_SeverityColumn);
column2.setLabelProvider(new ColumnLabelProvider() { column2.setLabelProvider(new ColumnLabelProvider() {
@Override @Override
public Image getImage(Object element) { public Image getImage(Object element) {
@ -298,6 +299,6 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
*/ */
@Override @Override
protected String modelToString(Object model) { protected String modelToString(Object model) {
return ""; return ""; //$NON-NLS-1$
} }
} }