summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Ruiz2012-02-23 16:22:06 (EST)
committerSergey Prigogin2012-02-23 16:22:06 (EST)
commitfba2b5c3e4018002cad69cd30c810dcee96c9572 (patch)
tree810d7061edf5fc48510d5a9d648c971f33b57c94
parent88d576787efa9fd7f64bc58dbd75bfbfc6722200 (diff)
downloadorg.eclipse.cdt-fba2b5c3e4018002cad69cd30c810dcee96c9572.zip
org.eclipse.cdt-fba2b5c3e4018002cad69cd30c810dcee96c9572.tar.gz
org.eclipse.cdt-fba2b5c3e4018002cad69cd30c810dcee96c9572.tar.bz2
Leftover cleanup from previous commit.
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java (renamed from codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterFinder.java)8
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java26
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/CommandLauncher.java13
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ExternalToolInvoker.java17
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/cxx/externaltool/AbstractCxxExternalToolBasedChecker.java4
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java (renamed from codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterFinder.java)8
6 files changed, 40 insertions, 36 deletions
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterFinder.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java
index 93d5420..3b388a5 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterFinder.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/externaltool/IConsolePrinterProvider.java
@@ -11,20 +11,20 @@
package org.eclipse.cdt.codan.core.externaltool;
/**
- * Finds an Eclipse console that uses the name of an external tool as its own.
+ * Creates or finds an Eclipse console that uses the name of an external tool as its own.
*
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
*/
-public interface IConsolePrinterFinder {
+public interface IConsolePrinterProvider {
/**
- * Finds an Eclipse console that uses the name of an external tool as its own.
+ * Creates an Eclipse console that uses the name of an external tool as its own.
* @param externalToolName the name of the external tool that will be used as the name of the
* console.
* @param shouldDisplayOutput indicates whether the user wants to see the output of the external
* tool in the console.
* @return the created or found console.
*/
- IConsolePrinter findConsole(String externalToolName, boolean shouldDisplayOutput);
+ IConsolePrinter createConsole(String externalToolName, boolean shouldDisplayOutput);
} \ No newline at end of file
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java
index 70eafb9..818a947 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractExternalToolBasedChecker.java
@@ -8,7 +8,7 @@ import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.externaltool.AbstractOutputParser;
import org.eclipse.cdt.codan.core.externaltool.ConfigurationSettings;
import org.eclipse.cdt.codan.core.externaltool.IArgsSeparator;
-import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterFinder;
+import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterProvider;
import org.eclipse.cdt.codan.core.externaltool.IInvocationParametersProvider;
import org.eclipse.cdt.codan.core.externaltool.IProblemDisplay;
import org.eclipse.cdt.codan.core.externaltool.ISupportedResourceVerifier;
@@ -45,7 +45,7 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
private final IInvocationParametersProvider parametersProvider;
private final ISupportedResourceVerifier supportedResourceVerifier;
private final IArgsSeparator argsSeparator;
- private final ConfigurationSettings configurationSettings;
+ private final ConfigurationSettings settings;
private final ExternalToolInvoker externalToolInvoker;
private final RootProblemPreference preferences;
@@ -56,18 +56,18 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
* external tool.
* @param argsSeparator separates the arguments to pass to the external tool executable. These
* arguments are stored in a single {@code String}.
- * @param consolePrinterFinder finds an Eclipse console that uses the name of an external tool
- * as its own.
- * @param configurationSettings user-configurable external tool configuration settings.
+ * @param consolePrinterProvider creates an Eclipse console that uses the name of an external
+ * tool as its own.
+ * @param settings user-configurable external tool configuration settings.
*/
public AbstractExternalToolBasedChecker(IInvocationParametersProvider parametersProvider,
ISupportedResourceVerifier supportedResourceVerifier, IArgsSeparator argsSeparator,
- IConsolePrinterFinder consolePrinterFinder, ConfigurationSettings configurationSettings) {
+ IConsolePrinterProvider consolePrinterProvider, ConfigurationSettings settings) {
this.parametersProvider = parametersProvider;
this.supportedResourceVerifier = supportedResourceVerifier;
this.argsSeparator = argsSeparator;
- this.configurationSettings = configurationSettings;
- externalToolInvoker = new ExternalToolInvoker(consolePrinterFinder);
+ this.settings = settings;
+ externalToolInvoker = new ExternalToolInvoker(consolePrinterProvider);
preferences = new SharedRootProblemPreference();
}
@@ -118,7 +118,7 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
updateConfigurationSettingsFromPreferences(parameters.getActualFile());
List<AbstractOutputParser> parsers = createParsers(parameters);
try {
- externalToolInvoker.invoke(parameters, configurationSettings, argsSeparator, parsers);
+ externalToolInvoker.invoke(parameters, settings, argsSeparator, parsers);
} catch (InvocationFailure error) {
handleInvocationFailure(error, parameters);
}
@@ -127,7 +127,7 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
private void updateConfigurationSettingsFromPreferences(IResource fileToProcess) {
IProblem problem = getProblemById(getReferenceProblemId(), fileToProcess);
MapProblemPreference preferences = (MapProblemPreference) problem.getPreference();
- configurationSettings.updateValuesFrom(preferences);
+ settings.updateValuesFrom(preferences);
}
/**
@@ -180,9 +180,9 @@ public abstract class AbstractExternalToolBasedChecker extends AbstractCheckerWi
@Override
public void initPreferences(IProblemWorkingCopy problem) {
super.initPreferences(problem);
- addPreference(problem, configurationSettings.getPath());
- addPreference(problem, configurationSettings.getArgs());
- addPreference(problem, configurationSettings.getShouldDisplayOutput());
+ addPreference(problem, settings.getPath());
+ addPreference(problem, settings.getArgs());
+ addPreference(problem, settings.getShouldDisplayOutput());
}
private void addPreference(IProblemWorkingCopy problem, SingleConfigurationSetting<?> setting) {
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/CommandLauncher.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/CommandLauncher.java
index f70b589..3ea850c 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/CommandLauncher.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/CommandLauncher.java
@@ -19,7 +19,7 @@ import java.util.List;
import org.eclipse.cdt.codan.core.externaltool.AbstractOutputParser;
import org.eclipse.cdt.codan.core.externaltool.IConsolePrinter;
-import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterFinder;
+import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterProvider;
import org.eclipse.cdt.codan.core.externaltool.InvocationFailure;
import org.eclipse.core.runtime.IPath;
@@ -32,14 +32,15 @@ import org.eclipse.core.runtime.IPath;
*/
public class CommandLauncher {
private ProcessInvoker processInvoker = new ProcessInvoker();
- private final IConsolePrinterFinder consolePrinterFinder;
+ private final IConsolePrinterProvider consolePrinterProvider;
/**
* Constructor.
- * @param consolePrinter prints the output of an external tool to an Eclipse Console.
+ * @param consolePrinterProvider creates an Eclipse console that uses the name of an external
+ * tool as its own.
*/
- public CommandLauncher(IConsolePrinterFinder consolePrinter) {
- this.consolePrinterFinder = consolePrinter;
+ public CommandLauncher(IConsolePrinterProvider consolePrinterProvider) {
+ this.consolePrinterProvider = consolePrinterProvider;
}
/**
@@ -60,7 +61,7 @@ public class CommandLauncher {
String command = buildCommand(executablePath, args);
Process process = null;
IConsolePrinter console =
- consolePrinterFinder.findConsole(externalToolName, shouldDisplayOutput);
+ consolePrinterProvider.createConsole(externalToolName, shouldDisplayOutput);
try {
console.clear();
console.println(command);
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ExternalToolInvoker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ExternalToolInvoker.java
index 8d0cf51..7165a69 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ExternalToolInvoker.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/externaltool/ExternalToolInvoker.java
@@ -16,7 +16,7 @@ import java.util.List;
import org.eclipse.cdt.codan.core.externaltool.AbstractOutputParser;
import org.eclipse.cdt.codan.core.externaltool.ConfigurationSettings;
import org.eclipse.cdt.codan.core.externaltool.IArgsSeparator;
-import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterFinder;
+import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterProvider;
import org.eclipse.cdt.codan.core.externaltool.InvocationFailure;
import org.eclipse.cdt.codan.core.externaltool.InvocationParameters;
import org.eclipse.core.runtime.IPath;
@@ -34,15 +34,18 @@ public class ExternalToolInvoker {
/**
* Constructor.
- * @param consolePrinterFinder finds an Eclipse console that uses the name of an external tool
- * as its own.
+ * @param consolePrinterProvider creates an Eclipse console that uses the name of an external
+ * tool as its own.
*/
- public ExternalToolInvoker(IConsolePrinterFinder consolePrinterFinder) {
- this(new CommandLauncher(consolePrinterFinder));
+ public ExternalToolInvoker(IConsolePrinterProvider consolePrinterProvider) {
+ this(new CommandLauncher(consolePrinterProvider));
}
- // Visible for testing.
- ExternalToolInvoker(CommandLauncher commandLauncher) {
+ /**
+ * Constructor.
+ * @param commandLauncher invokes an external tool command.
+ */
+ public ExternalToolInvoker(CommandLauncher commandLauncher) {
this.commandLauncher = commandLauncher;
}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/cxx/externaltool/AbstractCxxExternalToolBasedChecker.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/cxx/externaltool/AbstractCxxExternalToolBasedChecker.java
index 0bc0a79..b77e913 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/cxx/externaltool/AbstractCxxExternalToolBasedChecker.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/cxx/externaltool/AbstractCxxExternalToolBasedChecker.java
@@ -18,7 +18,7 @@ import org.eclipse.cdt.codan.core.externaltool.InvocationParametersProvider;
import org.eclipse.cdt.codan.core.externaltool.SpaceDelimitedArgsSeparator;
import org.eclipse.cdt.codan.core.model.AbstractExternalToolBasedChecker;
import org.eclipse.cdt.codan.internal.ui.cxx.externaltool.CxxSupportedResourceVerifier;
-import org.eclipse.cdt.codan.ui.externaltool.ConsolePrinterFinder;
+import org.eclipse.cdt.codan.ui.externaltool.ConsolePrinterProvider;
/**
* Base class for checkers that invoke external command-line tools to perform code checking
@@ -59,6 +59,6 @@ public abstract class AbstractCxxExternalToolBasedChecker extends AbstractExtern
ISupportedResourceVerifier supportedResourceVerifier, IArgsSeparator argsSeparator,
ConfigurationSettings configurationSettings) {
super(parametersProvider, supportedResourceVerifier, argsSeparator,
- new ConsolePrinterFinder(), configurationSettings);
+ new ConsolePrinterProvider(), configurationSettings);
}
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterFinder.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java
index 66faf99..65cee60 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterFinder.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/externaltool/ConsolePrinterProvider.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.codan.ui.externaltool;
import static org.eclipse.ui.console.IConsoleConstants.ID_CONSOLE_VIEW;
import org.eclipse.cdt.codan.core.externaltool.IConsolePrinter;
-import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterFinder;
+import org.eclipse.cdt.codan.core.externaltool.IConsolePrinterProvider;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
import org.eclipse.cdt.codan.ui.CodanEditorUtility;
import org.eclipse.ui.IWorkbenchPage;
@@ -25,18 +25,18 @@ import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.console.MessageConsole;
/**
- * Default implementation of <code>{@link IConsolePrinterFinder}</code>.
+ * Default implementation of <code>{@link IConsolePrinterProvider}</code>.
*
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
*/
-public class ConsolePrinterFinder implements IConsolePrinterFinder {
+public class ConsolePrinterProvider implements IConsolePrinterProvider {
private static final NullConsolePrinter NULL_CONSOLE = new NullConsolePrinter();
/** {@inheritDoc} */
@Override
- public IConsolePrinter findConsole(String externalToolName, boolean shouldDisplayOutput) {
+ public IConsolePrinter createConsole(String externalToolName, boolean shouldDisplayOutput) {
if (shouldDisplayOutput) {
try {
return createOrFindConsole(externalToolName);