1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixed NLS warnings and removed excess semicolon

Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
Change-Id: Ife6550a77af5e410fd7b252a239dfa1ae6ae36f5
This commit is contained in:
Torbjörn Svensson 2020-06-29 19:09:02 +02:00 committed by Jonah Graham
parent 742dc05cb8
commit 803d6cd8ad
27 changed files with 106 additions and 100 deletions

View file

@ -41,7 +41,7 @@ import org.eclipse.core.runtime.Path;
*
*/
public class CToolChecker extends AbstractCElementChecker {
public final static String ID = "org.eclipse.cdt.codan.examples.checkers.CToolChecker.error";
public final static String ID = "org.eclipse.cdt.codan.examples.checkers.CToolChecker.error"; //$NON-NLS-1$
public static final String MAKE_PLUGIN_ID = "org.eclipse.cdt.make.core"; //$NON-NLS-1$
final ExternalToolInvoker externalToolInvoker = new ExternalToolInvoker();
@ -56,16 +56,16 @@ public class CToolChecker extends AbstractCElementChecker {
public void processUnit(ITranslationUnit unit) {
IScannerInfo scannerInfo = unit.getScannerInfo(true);
List<String> res = getCompilerOptionsList(scannerInfo);
res.add("-c");
res.add("-o/dev/null");
res.add("-O2");
res.add("-Wall");
res.add("-Werror");
res.add("-c"); //$NON-NLS-1$
res.add("-o/dev/null"); //$NON-NLS-1$
res.add("-O2"); //$NON-NLS-1$
res.add("-Wall"); //$NON-NLS-1$
res.add("-Werror"); //$NON-NLS-1$
res.add(unit.getFile().getLocation().toPortableString());
String args[] = res.toArray(new String[res.size()]);
try {
externalToolInvoker.launchOnBuildConsole(unit.getResource().getProject(),
new IConsoleParser[] { getConsoleParser(unit) }, "check", getToolPath(), args, new String[] {},
new IConsoleParser[] { getConsoleParser(unit) }, "check", getToolPath(), args, new String[] {}, //$NON-NLS-1$
getWorkingDirectory(), new NullProgressMonitor());
} catch (CoreException | InvocationFailure e) {
Activator.log(e);
@ -76,24 +76,24 @@ public class CToolChecker extends AbstractCElementChecker {
final Map<String, String> symbols = scannerInfo.getDefinedSymbols();
List<String> res = new ArrayList<>();
for (String macro : symbols.keySet()) {
if (macro.startsWith("_")) {
if (macro.startsWith("_")) { //$NON-NLS-1$
continue; // likely embedded macro
}
String value = symbols.get(macro);
if (value.isEmpty()) {
res.add("-D" + macro);
res.add("-D" + macro); //$NON-NLS-1$
} else {
res.add("-D" + macro + "=" + value);
res.add("-D" + macro + "=" + value); //$NON-NLS-1$ //$NON-NLS-2$
}
}
for (String inc : scannerInfo.getIncludePaths()) {
res.add("-I" + inc);
res.add("-I" + inc); //$NON-NLS-1$
}
return res;
}
protected Path getToolPath() {
return new Path("gcc");
return new Path("gcc"); //$NON-NLS-1$
}
protected IConsoleParser getConsoleParser(ITranslationUnit unit) {

View file

@ -35,8 +35,8 @@ import org.eclipse.core.runtime.CoreException;
* This checker is parametrized by the search strings
*/
public class GrepChecker extends AbstractCheckerWithProblemPreferences {
public final static String ID = "org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblemError";
private static final String PARAM_STRING_LIST = "searchlist";
public final static String ID = "org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblemError"; //$NON-NLS-1$
private static final String PARAM_STRING_LIST = "searchlist"; //$NON-NLS-1$
@Override
public synchronized boolean processResource(IResource resource) {

View file

@ -17,6 +17,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.cdt.codan.ui.AbstractCodanProblemDetailsProvider;
import org.eclipse.osgi.util.NLS;
/**
* Example of codan problem details provider for flexlint integration
@ -45,7 +46,8 @@ public class FlexlintHelpLink extends AbstractCodanProblemDetailsProvider {
@Override
public String getStyledProblemDescription() {
String helpId = parseHelpId(getProblemMessage());
String url = "http://www.gimpel-online.com/MsgRef.html#" + helpId;
return "<a href=\"" + url + "\">" + url + "</a>";
return NLS.bind(
"<a href=\"http://www.gimpel-online.com/MsgRef.html#{0}\">http://www.gimpel-online.com/MsgRef.html#{0}</a>",
helpId);
}
}

View file

@ -68,11 +68,11 @@ public class GrepCheckerExamplePreferenceChangeListener implements INodeChangeLi
if (GrepChecker.ID.equals(event.getKey())) {
// severity or enablement has changed
String val = (String) event.getNewValue();
String fors = (" for " + ((project == null) ? "workspace" : project.getName()));
if (val != null && !val.startsWith("-")) {
trace("grep checker enabled :)" + fors);
String fors = (" for " + ((project == null) ? "workspace" : project.getName())); //$NON-NLS-1$ //$NON-NLS-2$
if (val != null && !val.startsWith("-")) { //$NON-NLS-1$
trace("grep checker enabled :)" + fors); //$NON-NLS-1$
} else {
trace("grep checker disabled :(" + fors);
trace("grep checker disabled :(" + fors); //$NON-NLS-1$
}
}
@ -86,12 +86,12 @@ public class GrepCheckerExamplePreferenceChangeListener implements INodeChangeLi
@Override
public void added(NodeChangeEvent event) {
trace("node added " + event);
trace("node added " + event); //$NON-NLS-1$
}
@Override
public void removed(NodeChangeEvent event) {
trace("node removed " + event);
trace("node removed " + event); //$NON-NLS-1$
}
/**

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.codan.examples.uicontrib;
import org.eclipse.cdt.codan.internal.core.model.CodanProblemMarker;
import org.eclipse.cdt.codan.ui.AbstractCodanProblemDetailsProvider;
import org.eclipse.osgi.util.NLS;
/**
* Example of codan problem details provider for string search integration
@ -22,13 +23,12 @@ import org.eclipse.cdt.codan.ui.AbstractCodanProblemDetailsProvider;
public class GrepCheckerHelpLink extends AbstractCodanProblemDetailsProvider {
@Override
public boolean isApplicable(String id) {
return id.startsWith("org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblem");
return id.startsWith("org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblem"); //$NON-NLS-1$
}
@Override
public String getStyledProblemDescription() {
String arg = CodanProblemMarker.getProblemArgument(marker, 0);
String url = "http://www.google.ca/search?q=" + arg;
return "Google " + "<a href=\"" + url + "\">" + arg + "</a>";
return NLS.bind("Google <a href=\"http://www.google.ca/search?q={0}\">{0}</a>", arg);
}
}

View file

@ -93,7 +93,7 @@ public class ControlFlowGraphView extends ViewPart {
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "org.eclipse.cdt.codan.ui.cfgview.views.ControlFlowGraphView";
public static final String ID = "org.eclipse.cdt.codan.ui.cfgview.views.ControlFlowGraphView"; //$NON-NLS-1$
private TreeViewer viewer;
private DrillDownAdapter drillDownAdapter;
private Action actionSync;
@ -188,7 +188,7 @@ public class ControlFlowGraphView extends ViewPart {
public String getText(Object obj) {
if (obj == null)
return null;
String strdata = "";
String strdata = ""; //$NON-NLS-1$
if (obj instanceof ICfgData) {
strdata = ((AbstractBasicBlock) obj).toStringData();
}
@ -205,25 +205,25 @@ public class ControlFlowGraphView extends ViewPart {
* @return
*/
protected String blockHexLabel(Object obj) {
return "0x" + Integer.toHexString(System.identityHashCode(obj));
return "0x" + Integer.toHexString(System.identityHashCode(obj)); //$NON-NLS-1$
}
@Override
public Image getImage(Object obj) {
String imageKey = "task.png";
String imageKey = "task.png"; //$NON-NLS-1$
if (obj instanceof IDecisionNode || obj instanceof IControlFlowGraph)
imageKey = "decision.png";
imageKey = "decision.png"; //$NON-NLS-1$
else if (obj instanceof IExitNode)
imageKey = "exit.png";
imageKey = "exit.png"; //$NON-NLS-1$
else if (obj instanceof IStartNode)
imageKey = "start.png";
imageKey = "start.png"; //$NON-NLS-1$
else if (obj instanceof IJumpNode)
imageKey = "jump.png";
imageKey = "jump.png"; //$NON-NLS-1$
else if (obj instanceof IBranchNode)
imageKey = "labeled.png";
imageKey = "labeled.png"; //$NON-NLS-1$
else if (obj instanceof IConnectorNode)
imageKey = "connector.png";
return ControlFlowGraphPlugin.getDefault().getImage("icons/" + imageKey);
imageKey = "connector.png"; //$NON-NLS-1$
return ControlFlowGraphPlugin.getDefault().getImage("icons/" + imageKey); //$NON-NLS-1$
}
}
@ -251,7 +251,7 @@ public class ControlFlowGraphView extends ViewPart {
}
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(manager -> ControlFlowGraphView.this.fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(viewer.getControl());
@ -305,7 +305,7 @@ public class ControlFlowGraphView extends ViewPart {
};
actionSync.setText("Synchronize");
actionSync.setToolTipText("Synchronize");
actionSync.setImageDescriptor(ControlFlowGraphPlugin.getDefault().getImageDescriptor("icons/refresh_view.gif"));
actionSync.setImageDescriptor(ControlFlowGraphPlugin.getDefault().getImageDescriptor("icons/refresh_view.gif")); //$NON-NLS-1$
}
protected void processAst(IASTTranslationUnit ast) {

View file

@ -401,7 +401,7 @@ public class LineWrappingTabPage extends FormatterTabPage {
private final Category fMessageSendArgumentsCategory = new Category(
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION,
"class Other {static void bar(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) {}};" //$NON-NLS-1$
+ "void foo() {Other::bar(100, 200, 300, 400, 500, 600, 700, 800, 900);}",
+ "void foo() {Other::bar(100, 200, 300, 400, 500, 600, 700, 800, 900);}", //$NON-NLS-1$
FormatterMessages.LineWrappingTabPage_arguments, FormatterMessages.LineWrappingTabPage_arguments_lowercase);
private final Category fMethodThrowsClauseCategory = new Category(

View file

@ -53,8 +53,8 @@ public class SetCrossCommandWizardPage extends MBSCustomPage {
// Note: The shared defaults keys don't have "cross" in them because we want to keep
// compatibility with defaults that were saved when it used to be a template
static final String SHARED_DEFAULTS_PREFIX_KEY = "prefix";
static final String SHARED_DEFAULTS_PATH_KEY = "path";
static final String SHARED_DEFAULTS_PREFIX_KEY = "prefix"; //$NON-NLS-1$
static final String SHARED_DEFAULTS_PATH_KEY = "path"; //$NON-NLS-1$
public SetCrossCommandWizardPage() {
pageID = PAGE_ID;

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.connector.cdtserial;singleton:=true
Bundle-Version: 4.7.0.qualifier
Bundle-Version: 4.7.100.qualifier
Bundle-Activator: org.eclipse.tm.terminal.connector.cdtserial.activator.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
@ -21,3 +21,4 @@ Export-Package: org.eclipse.tm.terminal.connector.cdtserial.activator;x-internal
org.eclipse.tm.terminal.connector.cdtserial.controls,
org.eclipse.tm.terminal.connector.cdtserial.launcher,
org.eclipse.tm.terminal.connector.cdtserial.nls;x-internal:=true
Automatic-Module-Name: org.eclipse.tm.terminal.connector.cdtserial

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.connector.remote;singleton:=true
Bundle-Version: 4.6.0.qualifier
Bundle-Version: 4.6.100.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
@ -28,3 +28,4 @@ Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Import-Package: org.eclipse.core.resources,
org.eclipse.ui.ide
Automatic-Module-Name: org.eclipse.tm.terminal.connector.remote

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.connector.ssh;singleton:=true
Bundle-Version: 4.6.0.qualifier
Bundle-Version: 4.6.100.qualifier
Bundle-Activator: org.eclipse.tm.terminal.connector.ssh.activator.UIPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
@ -22,3 +22,4 @@ Export-Package: org.eclipse.tm.terminal.connector.ssh.activator;x-internal:=true
org.eclipse.tm.terminal.connector.ssh.controls,
org.eclipse.tm.terminal.connector.ssh.launcher,
org.eclipse.tm.terminal.connector.ssh.nls;x-internal:=true
Automatic-Module-Name: org.eclipse.tm.terminal.connector.ssh

View file

@ -74,7 +74,7 @@ public abstract class TemplateWizard extends BasicNewResourceWizard {
IDE.openEditor(activePage, file);
}
} catch (PartInitException e) {
log("Failed to open editor", e);
log("Failed to open editor", e); //$NON-NLS-1$
}
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.util;singleton:=true
Bundle-Version: 5.0.200.qualifier
Bundle-Version: 5.0.300.qualifier
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.cdt.core,
org.junit,

View file

@ -137,7 +137,7 @@ public class DOMSearchUtil {
IBinding binding = searchName.resolveBinding();
if (binding instanceof IIndexBinding) {
fail("Not implemented");
fail("Not implemented"); //$NON-NLS-1$
// try {
// ArrayList pdomNames = new ArrayList();
// IPDOMResolver pdom= ((PDOMBinding) binding).getPDOM();

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.cdt.visualizer.core;singleton:=true
Bundle-Version: 1.0.100.qualifier
Bundle-Version: 1.0.200.qualifier
Bundle-Activator: org.eclipse.cdt.visualizer.core.plugin.CDTVisualizerCorePlugin
Bundle-Vendor: %provider.name
Require-Bundle: org.eclipse.ui,

View file

@ -67,7 +67,7 @@ public class ExtensionElement {
/** Creates and returns instance of implementing class, using class name found in "class" attribute. */
public <T> T getClassAttribute() {
return getClassAttribute("class");
return getClassAttribute("class"); //$NON-NLS-1$
}
/** Creates and returns instance of implementing class, using class name found in specified attribute. */

View file

@ -56,7 +56,7 @@ public class ResourceManager {
* Assumes string resources are in the file "messages.properties".
*/
public ResourceManager(Plugin plugin) {
this(plugin, "messages.properties");
this(plugin, "messages.properties"); //$NON-NLS-1$
}
/** Constructor */
@ -102,7 +102,7 @@ public class ResourceManager {
String filename = m_stringResourceFilename;
// The ".properties" extension is assumed, so we trim it here
String propertiesExtension = ".properties";
String propertiesExtension = ".properties"; //$NON-NLS-1$
if (filename.endsWith(propertiesExtension)) {
filename = filename.substring(0, filename.length() - propertiesExtension.length());
}
@ -116,7 +116,7 @@ public class ResourceManager {
// we'll check for .properties file first
// in the same directory as the plugin activator class
String propertyFileName1 = m_pluginID + ".plugin." + filename;
String propertyFileName1 = m_pluginID + ".plugin." + filename; //$NON-NLS-1$
try {
m_stringResources = ResourceBundle.getBundle(propertyFileName1, locale, classLoader);
} catch (MissingResourceException e) {
@ -155,7 +155,7 @@ public class ResourceManager {
if (strings == null) {
// if we can't get the registry, display the key instead,
// so we know what's missing (e.g. the .properties file)
result = "(" + key + ")";
result = "(" + key + ")"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
try {
result = strings.getString(key);
@ -175,7 +175,7 @@ public class ResourceManager {
// if we still fail, display the key instead,
// so we know what's missing
if (result == null)
result = "[" + key + "]";
result = "[" + key + "]"; //$NON-NLS-1$ //$NON-NLS-2$
return result;
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.cdt.visualizer.ui;singleton:=true
Bundle-Version: 1.3.200.qualifier
Bundle-Version: 1.3.300.qualifier
Bundle-Activator: org.eclipse.cdt.visualizer.ui.plugin.CDTVisualizerUIPlugin
Bundle-Vendor: %provider.name
Require-Bundle: org.eclipse.ui,

View file

@ -274,7 +274,7 @@ public class VisualizerViewer extends PageBook
if (visualizers != null) {
for (Extension e : visualizers) {
String id = e.getAttribute("id");
String id = e.getAttribute("id"); //$NON-NLS-1$
IVisualizer visualizerInstance = e.getClassAttribute();
if (id != null && visualizerInstance != null) {
// Add visualizer's control to viewer's "pagebook" of controls.
@ -412,8 +412,8 @@ public class VisualizerViewer extends PageBook
public void paint(GC gc) {
gc.fillRectangle(getClientArea());
if (m_visualizers == null || m_visualizers.size() == 0) {
String noVisualizersMessage = CDTVisualizerUIPlugin.getString("VisualizerViewer.no.visualizers.defined");
gc.drawString("(" + noVisualizersMessage + ")", 10, 10);
String noVisualizersMessage = CDTVisualizerUIPlugin.getString("VisualizerViewer.no.visualizers.defined"); //$NON-NLS-1$
gc.drawString("(" + noVisualizersMessage + ")", 10, 10); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -165,7 +165,8 @@ public class BufferedCanvas extends Canvas implements PaintListener, ControlList
} catch (Throwable t) {
// Throwing an exception in painting code can hang Eclipse,
// so catch any exceptions here.
System.err.println("BufferedCanvas: Exception thrown in painting code: \n" + t);
System.err.println("BufferedCanvas: Exception thrown in painting code: \n"); //$NON-NLS-1$
t.printStackTrace(System.err);
}
// then copy image buffer to actual canvas (reduces repaint flickering)

View file

@ -97,7 +97,7 @@ public class VirtualBoundsGraphicObject extends GraphicObject {
/** Returns string representation. */
@Override
public String toString() {
return String.format("Class: %s, Real bounds: %s, Virtual bounds: %s" + ", Draw container bounds: %s ",
return String.format("Class: %s, Real bounds: %s, Virtual bounds: %s, Draw container bounds: %s ", //$NON-NLS-1$
this.getClass().getSimpleName(), this.getBounds().toString(), m_virtualBounds.toString(),
m_drawContainerBounds);
}
@ -211,16 +211,16 @@ public class VirtualBoundsGraphicObject extends GraphicObject {
/** Performs a sanity check of the virtual bounds of this object */
private void checkVirtualBounds() {
if (m_virtualBounds.x < 0) {
throw new IllegalArgumentException("Illegal x: " + m_virtualBounds.x);
throw new IllegalArgumentException("Illegal x: " + m_virtualBounds.x); //$NON-NLS-1$
}
if (m_virtualBounds.y < 0) {
throw new IllegalArgumentException("Illegal y: " + m_virtualBounds.y);
throw new IllegalArgumentException("Illegal y: " + m_virtualBounds.y); //$NON-NLS-1$
}
if (m_virtualBounds.width <= 0) {
throw new IllegalArgumentException("Illegal width: " + m_virtualBounds.width);
throw new IllegalArgumentException("Illegal width: " + m_virtualBounds.width); //$NON-NLS-1$
}
if (m_virtualBounds.height <= 0) {
throw new IllegalArgumentException("Illegal height: " + m_virtualBounds.height);
throw new IllegalArgumentException("Illegal height: " + m_virtualBounds.height); //$NON-NLS-1$
}
}

View file

@ -66,10 +66,10 @@ public class VisualizerViewerEvent extends Event {
/** Converts event type to string */
@Override
public String typeToString(int type) {
String result = "";
String result = ""; //$NON-NLS-1$
switch (type) {
case VISUALIZER_CHANGED:
result = "VISUALIZER_CHANGED";
result = "VISUALIZER_CHANGED"; //$NON-NLS-1$
break;
default:
result = super.typeToString(type);

View file

@ -93,7 +93,7 @@ public class TestCanvas extends GraphicCanvas {
/** Draw string, wrapping if there are any newline chars. */
public static void drawStringWrapNewlines(GC gc, String text, int x, int y, int lineHeight) {
if (text != null) {
String[] lines = text.split("\n");
String[] lines = text.split("\n"); //$NON-NLS-1$
for (int i = 0; i < lines.length; i++) {
gc.drawString(lines[i], x, y, true); // transparent
y += lineHeight;

View file

@ -34,7 +34,7 @@ public class TestCanvasVisualizer extends GraphicCanvasVisualizer {
// --- constants ---
/** Eclipse ID for this visualizer */
public static final String ECLIPSE_ID = "org.eclipse.cdt.visualizer.ui.test.TestCanvasVisualizer";
public static final String ECLIPSE_ID = "org.eclipse.cdt.visualizer.ui.test.TestCanvasVisualizer"; //$NON-NLS-1$
// --- members ---
@ -55,7 +55,7 @@ public class TestCanvasVisualizer extends GraphicCanvasVisualizer {
/** Returns non-localized unique name for this visualizer. */
@Override
public String getName() {
return "default";
return "default"; //$NON-NLS-1$
}
/** Returns localized name to display for this visualizer. */

View file

@ -61,23 +61,23 @@ public class Event {
public String toString() {
StringBuilder result = new StringBuilder();
result.append(getClass().getSimpleName());
result.append("[");
result.append("["); //$NON-NLS-1$
if (m_type != UNDEFINED) {
result.append(typeToString(m_type));
}
result.append("]");
result.append("]"); //$NON-NLS-1$
return result.toString();
}
/** Converts event type to string */
public String typeToString(int type) {
String result = "";
String result = ""; //$NON-NLS-1$
switch (type) {
case UNDEFINED:
result = "UNDEFINED";
result = "UNDEFINED"; //$NON-NLS-1$
break;
default:
result = "OTHER(" + type + ")";
result = "OTHER(" + type + ")"; //$NON-NLS-1$ //$NON-NLS-2$
break;
}
return result;

View file

@ -258,7 +258,7 @@ public class UIResourceManager extends ResourceManager {
/** Gets/creates font with specified properties */
protected Font getCachedFont(String fontName, int height, int style) {
Font result = null;
String fontID = fontName + "," + height + "," + style;
String fontID = fontName + "," + height + "," + style; //$NON-NLS-1$ //$NON-NLS-2$
// look for the cached font (this checks the parent manager too)
result = getCachedFont(fontID);
@ -333,7 +333,7 @@ public class UIResourceManager extends ResourceManager {
/** Gets/creates color with specified properties */
protected Color getCachedColor(int red, int green, int blue) {
Color result = null;
String colorID = "Color[R=" + red + ",G=" + green + ",B=" + blue + "]";
String colorID = "Color[R=" + red + ",G=" + green + ",B=" + blue + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
// look for the cached color (this checks the parent manager too)
result = getCachedColor(colorID);

View file

@ -50,7 +50,7 @@ public class WinEnvironmentVariableSupplier
@Override
public String getDelimiter() {
return ";";
return ";"; //$NON-NLS-1$
}
@Override
@ -98,10 +98,10 @@ public class WinEnvironmentVariableSupplier
}
private static String getSoftwareKey(WindowsRegistry reg, String subkey, String name) {
String value = reg.getLocalMachineValue("SOFTWARE\\" + subkey, name);
String value = reg.getLocalMachineValue("SOFTWARE\\" + subkey, name); //$NON-NLS-1$
// Visual Studio is a 32 bit application so on Windows 64 the keys will be in Wow6432Node
if (value == null) {
value = reg.getLocalMachineValue("SOFTWARE\\Wow6432Node\\" + subkey, name);
value = reg.getLocalMachineValue("SOFTWARE\\Wow6432Node\\" + subkey, name); //$NON-NLS-1$
}
return value;
}
@ -111,36 +111,36 @@ public class WinEnvironmentVariableSupplier
// or Windows SDK 7.0 with Visual C++ 9.0
private static String getSDKDir() {
WindowsRegistry reg = WindowsRegistry.getRegistry();
String sdkDir = getSoftwareKey(reg, "Microsoft\\Microsoft SDKs\\Windows\\v8.0", "InstallationFolder");
String sdkDir = getSoftwareKey(reg, "Microsoft\\Microsoft SDKs\\Windows\\v8.0", "InstallationFolder"); //$NON-NLS-1$ //$NON-NLS-2$
if (sdkDir != null)
return sdkDir;
sdkDir = getSoftwareKey(reg, "Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder");
sdkDir = getSoftwareKey(reg, "Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder"); //$NON-NLS-1$ //$NON-NLS-2$
if (sdkDir != null)
return sdkDir;
return getSoftwareKey(reg, "Microsoft SDKs\\Windows\\v7.0", "InstallationFolder");
return getSoftwareKey(reg, "Microsoft SDKs\\Windows\\v7.0", "InstallationFolder"); //$NON-NLS-1$ //$NON-NLS-2$
}
private static String getVCDir() {
WindowsRegistry reg = WindowsRegistry.getRegistry();
String vcDir = getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "11.0");
String vcDir = getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "11.0"); //$NON-NLS-1$ //$NON-NLS-2$
if (vcDir != null)
return vcDir;
vcDir = getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "10.0");
vcDir = getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "10.0"); //$NON-NLS-1$ //$NON-NLS-2$
if (vcDir != null)
return vcDir;
return getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "9.0");
return getSoftwareKey(reg, "Microsoft\\VisualStudio\\SxS\\VC7", "9.0"); //$NON-NLS-1$ //$NON-NLS-2$
}
public static IPath[] getIncludePath() {
// Include paths
List<IPath> includePaths = new ArrayList<>();
if (sdkDir != null) {
includePaths.add(new Path(sdkDir.concat("Include")));
includePaths.add(new Path(sdkDir.concat("Include\\gl")));
includePaths.add(new Path(sdkDir.concat("Include"))); //$NON-NLS-1$
includePaths.add(new Path(sdkDir.concat("Include\\gl"))); //$NON-NLS-1$
}
if (vcDir != null) {
includePaths.add(new Path(vcDir.concat("Include")));
includePaths.add(new Path(vcDir.concat("Include"))); //$NON-NLS-1$
}
return includePaths.toArray(new IPath[0]);
}
@ -168,32 +168,32 @@ public class WinEnvironmentVariableSupplier
for (IPath path : includePaths) {
buff.append(path.toOSString()).append(';');
}
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(),
addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), //$NON-NLS-1$
IBuildEnvironmentVariable.ENVVAR_PREPEND));
// LIB
buff = new StringBuilder();
if (vcDir != null)
buff.append(vcDir).append("Lib;");
buff.append(vcDir).append("Lib;"); //$NON-NLS-1$
if (sdkDir != null) {
buff.append(sdkDir).append("Lib;");
buff.append(sdkDir).append("Lib\\win8\\um\\x86;");
buff.append(sdkDir).append("Lib;"); //$NON-NLS-1$
buff.append(sdkDir).append("Lib\\win8\\um\\x86;"); //$NON-NLS-1$
}
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND)); //$NON-NLS-1$
// PATH
buff = new StringBuilder();
if (vcDir != null) {
buff.append(vcDir).append("..\\Common7\\IDE;");
buff.append(vcDir).append("..\\Common7\\Tools;");
buff.append(vcDir).append("Bin;");
buff.append(vcDir).append("vcpackages;");
buff.append(vcDir).append("..\\Common7\\IDE;"); //$NON-NLS-1$
buff.append(vcDir).append("..\\Common7\\Tools;"); //$NON-NLS-1$
buff.append(vcDir).append("Bin;"); //$NON-NLS-1$
buff.append(vcDir).append("vcpackages;"); //$NON-NLS-1$
}
if (sdkDir != null) {
buff.append(sdkDir).append("Bin;");
buff.append(sdkDir).append("Bin;"); //$NON-NLS-1$
}
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND));
}
addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND)); //$NON-NLS-1$
};
}