mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
a7a8d608fa
commit
8a36c6376d
1 changed files with 16 additions and 15 deletions
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bala Torati (Symbian) - Initial API and implementation
|
* Bala Torati (Symbian) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.templateengine.process;
|
package org.eclipse.cdt.core.templateengine.process;
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains methods to get first process block element, next process
|
* This class contains methods to get first process block element, next process
|
||||||
* block element and checks for next process block element.
|
* block element and checks for next process block element.
|
||||||
|
@ -65,7 +64,7 @@ public class Process {
|
||||||
ProcessParameter[] params = processRunner.getProcessParameters();
|
ProcessParameter[] params = processRunner.getProcessParameters();
|
||||||
List<ProcessArgument> list = new ArrayList<ProcessArgument>(params.length);
|
List<ProcessArgument> list = new ArrayList<ProcessArgument>(params.length);
|
||||||
int childIndex = 0;
|
int childIndex = 0;
|
||||||
for(int i=0; i<params.length; i++) {
|
for (int i= 0; i < params.length; i++) {
|
||||||
ProcessParameter param = params[i];
|
ProcessParameter param = params[i];
|
||||||
boolean childrenRemain = childIndex < children.size();
|
boolean childrenRemain = childIndex < children.size();
|
||||||
Element child = (childrenRemain ? children.get(childIndex) : null);
|
Element child = (childrenRemain ? children.get(childIndex) : null);
|
||||||
|
@ -88,7 +87,8 @@ public class Process {
|
||||||
* @return boolean, true if the Process is Ready.
|
* @return boolean, true if the Process is Ready.
|
||||||
*/
|
*/
|
||||||
public boolean isReadyToProcess() {
|
public boolean isReadyToProcess() {
|
||||||
if (processRunner == null || !processRunner.areArgumentsMatchingRequiredParameters(args) || !areAllMacrosExpandable()) {
|
if (processRunner == null || !processRunner.areArgumentsMatchingRequiredParameters(args) ||
|
||||||
|
!areAllMacrosExpandable()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -100,7 +100,7 @@ public class Process {
|
||||||
*/
|
*/
|
||||||
private boolean areAllMacrosExpandable() {
|
private boolean areAllMacrosExpandable() {
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
for(int i=0; i<args.length; i++) {
|
for (int i= 0; i < args.length; i++) {
|
||||||
ProcessArgument arg = args[i];
|
ProcessArgument arg = args[i];
|
||||||
if (!arg.areAllMacrosExpandable()) {
|
if (!arg.areAllMacrosExpandable()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -116,10 +116,11 @@ public class Process {
|
||||||
private String getFirstNonExpandableMacroMessage(ProcessArgument[] args2) {
|
private String getFirstNonExpandableMacroMessage(ProcessArgument[] args2) {
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
String macro;
|
String macro;
|
||||||
for(int i=0; i<args.length; i++) {
|
for (int i= 0; i < args.length; i++) {
|
||||||
ProcessArgument arg = args[i];
|
ProcessArgument arg = args[i];
|
||||||
if ((macro = arg.getFirstNonExpandableMacro()) != null) {
|
if ((macro = arg.getFirstNonExpandableMacro()) != null) {
|
||||||
return TemplateEngineMessages.getString("Process.argument") + arg.getName() + TemplateEngineMessages.getString("Process.expandableMacro") + macro; //$NON-NLS-1$ //$NON-NLS-2$
|
return TemplateEngineMessages.getString("Process.argument") + arg.getName() + //$NON-NLS-1$
|
||||||
|
TemplateEngineMessages.getString("Process.expandableMacro") + macro; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,12 +135,12 @@ public class Process {
|
||||||
*/
|
*/
|
||||||
private String getProcessMessage(int code, String msg) {
|
private String getProcessMessage(int code, String msg) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case IStatus.ERROR:
|
case IStatus.ERROR:
|
||||||
return id + TemplateEngineMessages.getString("Process.error") + msg; //$NON-NLS-1$
|
return id + TemplateEngineMessages.getString("Process.error") + msg; //$NON-NLS-1$
|
||||||
case IStatus.OK:
|
case IStatus.OK:
|
||||||
return id + TemplateEngineMessages.getString("Process.success") + msg; //$NON-NLS-1$
|
return id + TemplateEngineMessages.getString("Process.success") + msg; //$NON-NLS-1$
|
||||||
default:
|
default:
|
||||||
return id + TemplateEngineMessages.getString("Process.info") + msg; //$NON-NLS-1$
|
return id + TemplateEngineMessages.getString("Process.info") + msg; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +167,7 @@ public class Process {
|
||||||
|
|
||||||
private void resolve() {
|
private void resolve() {
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
for(int i=0; i<args.length; i++) {
|
for (int i= 0; i < args.length; i++) {
|
||||||
ProcessArgument arg = args[i];
|
ProcessArgument arg = args[i];
|
||||||
if (!arg.isResolved()) {
|
if (!arg.isResolved()) {
|
||||||
arg.resolve();
|
arg.resolve();
|
||||||
|
@ -181,7 +182,7 @@ public class Process {
|
||||||
public Set<String> getMacros() {
|
public Set<String> getMacros() {
|
||||||
Set<String> set = null;
|
Set<String> set = null;
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
for(int i=0; i<args.length; i++) {
|
for (int i= 0; i < args.length; i++) {
|
||||||
ProcessArgument arg = args[i];
|
ProcessArgument arg = args[i];
|
||||||
Set<String> subSet = arg.getMacros();
|
Set<String> subSet = arg.getMacros();
|
||||||
if (subSet != null) {
|
if (subSet != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue