import java.util.ArrayList;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.MultiStatus;
import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsPlugin;
-import net.sourceforge.phpdt.externaltools.internal.model.ToolMessages;
+import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages;
import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariable;
import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariableRegistry;
import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariable;
import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariableRegistry;
import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.MultiStatus;
+
/**
* General utility class dealing with external tools
*/
// Invalid variable format
if (varDef.end == -1 || varDef.name == null || varDef.name.length() == 0) {
- String msg = ToolMessages.getString("ToolUtil.argumentVarFormatWrong"); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.getString("ToolUtil.argumentVarFormatWrong"); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
registry = ExternalToolsPlugin.getDefault().getArgumentVariableRegistry();
ArgumentVariable variable = registry.getArgumentVariable(varDef.name);
if (variable == null) {
- String msg = ToolMessages.format("ToolUtil.argumentVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.format("ToolUtil.argumentVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Expand the variable as text if possible
String text = variable.getExpander().getText(varDef.name, varDef.argument, context);
if (text == null) {
- String msg = ToolMessages.format("ToolUtil.argumentVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.format("ToolUtil.argumentVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Disallow text before/after variable
if (varDef.start != 0 || (varDef.end < dirLocation.length() && varDef.end != -1)) {
- String msg = ToolMessages.getString("ToolUtil.dirLocVarBetweenText"); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.getString("ToolUtil.dirLocVarBetweenText"); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Invalid variable format
if (varDef.name == null || varDef.name.length() == 0 || varDef.end == -1) {
- String msg = ToolMessages.getString("ToolUtil.dirLocVarFormatWrong"); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.getString("ToolUtil.dirLocVarFormatWrong"); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
registry = ExternalToolsPlugin.getDefault().getDirectoryLocationVariableRegistry();
PathLocationVariable variable = registry.getPathLocationVariable(varDef.name);
if (variable == null) {
- String msg = ToolMessages.format("ToolUtil.dirLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.format("ToolUtil.dirLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Expand the variable into a IPath if possible
IPath path = variable.getExpander().getPath(varDef.name, varDef.argument, context);
if (path == null) {
- String msg = ToolMessages.format("ToolUtil.dirLocVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.format("ToolUtil.dirLocVarExpandFailed", new Object[] {varDef.name}); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Disallow text before/after variable
if (varDef.start != 0 || (varDef.end < fileLocation.length() && varDef.end != -1)) {
- String msg = ToolMessages.getString("ToolUtil.fileLocVarBetweenText"); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.getString("ToolUtil.fileLocVarBetweenText"); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Invalid variable format
if (varDef.name == null || varDef.name.length() == 0 || varDef.end == -1) {
- String msg = ToolMessages.getString("ToolUtil.fileLocVarFormatWrong"); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.getString("ToolUtil.fileLocVarFormatWrong"); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
registry = ExternalToolsPlugin.getDefault().getFileLocationVariableRegistry();
PathLocationVariable variable = registry.getPathLocationVariable(varDef.name);
if (variable == null) {
- String msg = ToolMessages.format("ToolUtil.fileLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
+ String msg = ExternalToolsModelMessages.format("ToolUtil.fileLocVarMissing", new Object[] {varDef.name}); //$NON-NLS-1$
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}
// Expand the variable into a IPath if possible
IPath path = variable.getExpander().getPath(varDef.name, varDef.argument, context);
if (path == null) {
- String msg = ToolMessages.format("The variable {0} with argument {1} could not be expanded to a valid path.", new Object[] {varDef.name, varDef.argument});
+ String msg = ExternalToolsModelMessages.format("The variable {0} with argument {1} could not be expanded to a valid path.", new Object[] {varDef.name, varDef.argument});
status.merge(ExternalToolsPlugin.newErrorStatus(msg, null));
return null;
}