mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 18:45:26 +02:00
[180562][api] dont implement ISystemCompileXMLConstants
This commit is contained in:
parent
b943781c0f
commit
39e168e841
3 changed files with 57 additions and 53 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
|
* Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemCompileXMLConstants
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.rse.useractions.ui.compile;
|
package org.eclipse.rse.useractions.ui.compile;
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ import org.eclipse.rse.useractions.ui.SystemCmdSubstVarList;
|
||||||
* <li>JobEnvironment. This is available for subsystems that need it, and they decide what to put in this attribute.
|
* <li>JobEnvironment. This is available for subsystems that need it, and they decide what to put in this attribute.
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstants, IAdaptable {
|
public class SystemCompileCommand implements Cloneable, IAdaptable {
|
||||||
private SystemCompileType parentType; // reference to parent type
|
private SystemCompileType parentType; // reference to parent type
|
||||||
private String nature;
|
private String nature;
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -165,21 +166,21 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* Indicate this is IBM supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_IBM_VALUE}
|
* Indicate this is IBM supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_IBM_VALUE}
|
||||||
*/
|
*/
|
||||||
public void setIsIBMSupplied() {
|
public void setIsIBMSupplied() {
|
||||||
setNature(NATURE_IBM_VALUE);
|
setNature(ISystemCompileXMLConstants.NATURE_IBM_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate this is user supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_USER_VALUE}
|
* Indicate this is user supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_USER_VALUE}
|
||||||
*/
|
*/
|
||||||
public void setIsUserSupplied() {
|
public void setIsUserSupplied() {
|
||||||
setNature(NATURE_USER_VALUE);
|
setNature(ISystemCompileXMLConstants.NATURE_USER_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate this is ISV supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_ISV_VALUE}
|
* Indicate this is ISV supplied. This sets the nature to {#link ISystemCompileXMLConstants#NATURE_ISV_VALUE}
|
||||||
*/
|
*/
|
||||||
public void setIsISVSupplied() {
|
public void setIsISVSupplied() {
|
||||||
setNature(NATURE_ISV_VALUE);
|
setNature(ISystemCompileXMLConstants.NATURE_ISV_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -196,21 +197,21 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* Return true if this is an IBM-supplied type. If false it is user or ISV supplied.
|
* Return true if this is an IBM-supplied type. If false it is user or ISV supplied.
|
||||||
*/
|
*/
|
||||||
public boolean isIBMSupplied() {
|
public boolean isIBMSupplied() {
|
||||||
return nature.equals(NATURE_IBM_VALUE);
|
return nature.equals(ISystemCompileXMLConstants.NATURE_IBM_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if this is an user-supplied type. If false it is IBM or ISV supplied.
|
* Return true if this is an user-supplied type. If false it is IBM or ISV supplied.
|
||||||
*/
|
*/
|
||||||
public boolean isUserSupplied() {
|
public boolean isUserSupplied() {
|
||||||
return nature.equals(NATURE_USER_VALUE);
|
return nature.equals(ISystemCompileXMLConstants.NATURE_USER_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if this is an ISV-supplied type. If false it is IBM or user supplied.
|
* Return true if this is an ISV-supplied type. If false it is IBM or user supplied.
|
||||||
*/
|
*/
|
||||||
public boolean isISVSupplied() {
|
public boolean isISVSupplied() {
|
||||||
return nature.equals(NATURE_ISV_VALUE);
|
return nature.equals(ISystemCompileXMLConstants.NATURE_ISV_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -263,7 +264,7 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* Fastpath to setting the menu option to both, which is the typical case
|
* Fastpath to setting the menu option to both, which is the typical case
|
||||||
*/
|
*/
|
||||||
public void setMenuOptionBoth() {
|
public void setMenuOptionBoth() {
|
||||||
setMenuOption(MENU_BOTH_VALUE);
|
setMenuOption(ISystemCompileXMLConstants.MENU_BOTH_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -300,7 +301,7 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* @return true if promptable, false otherwise
|
* @return true if promptable, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean isPromptable() {
|
public boolean isPromptable() {
|
||||||
if (menuOption.equals(MENU_BOTH_VALUE) || menuOption.equals(MENU_PROMPTABLE_VALUE))
|
if (menuOption.equals(ISystemCompileXMLConstants.MENU_BOTH_VALUE) || menuOption.equals(ISystemCompileXMLConstants.MENU_PROMPTABLE_VALUE))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -310,7 +311,7 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* Returns if it is non-promptable. Queries the value of the menuOption attribute.
|
* Returns if it is non-promptable. Queries the value of the menuOption attribute.
|
||||||
*/
|
*/
|
||||||
public boolean isNonPromptable() {
|
public boolean isNonPromptable() {
|
||||||
if (menuOption.equals(MENU_BOTH_VALUE) || menuOption.equals(MENU_NON_PROMPTABLE_VALUE))
|
if (menuOption.equals(ISystemCompileXMLConstants.MENU_BOTH_VALUE) || menuOption.equals(ISystemCompileXMLConstants.MENU_NON_PROMPTABLE_VALUE))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -365,7 +366,7 @@ public class SystemCompileCommand implements Cloneable, ISystemCompileXMLConstan
|
||||||
* If a subclass adds additional attributes, this method should be subclassed to clone those attributes.
|
* If a subclass adds additional attributes, this method should be subclassed to clone those attributes.
|
||||||
*/
|
*/
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
SystemCompileCommand clone = new SystemCompileCommand(getParentType(), getId(), getLabel(), NATURE_USER_VALUE, null, getCurrentString(), getMenuOption(), getOrder());
|
SystemCompileCommand clone = new SystemCompileCommand(getParentType(), getId(), getLabel(), ISystemCompileXMLConstants.NATURE_USER_VALUE, null, getCurrentString(), getMenuOption(), getOrder());
|
||||||
if (jobEnv != null) clone.setJobEnvironment(jobEnv);
|
if (jobEnv != null) clone.setJobEnvironment(jobEnv);
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
|
* Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemCompileXMLConstants
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.rse.useractions.ui.compile;
|
package org.eclipse.rse.useractions.ui.compile;
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||||
|
|
||||||
public class SystemCompileContributor implements ISystemCompileXMLConstants {
|
public class SystemCompileContributor {
|
||||||
private IConfigurationElement config;
|
private IConfigurationElement config;
|
||||||
private SystemCompileRemoteObjectMatcher matcher;
|
private SystemCompileRemoteObjectMatcher matcher;
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ public class SystemCompileContributor implements ISystemCompileXMLConstants {
|
||||||
boolean labelExists = compileType.isLabelExists(label);
|
boolean labelExists = compileType.isLabelExists(label);
|
||||||
if (!labelExists) {
|
if (!labelExists) {
|
||||||
int numOfCommands = compileType.getNumOfCommands();
|
int numOfCommands = compileType.getNumOfCommands();
|
||||||
SystemCompileCommand command = new SystemCompileCommand(compileType, id, label, NATURE_ISV_VALUE, commandString, commandString, MENU_BOTH_VALUE, numOfCommands);
|
SystemCompileCommand command = new SystemCompileCommand(compileType, id, label, ISystemCompileXMLConstants.NATURE_ISV_VALUE, commandString, commandString, ISystemCompileXMLConstants.MENU_BOTH_VALUE, numOfCommands);
|
||||||
command.setLabelEditable(isLabelEditable);
|
command.setLabelEditable(isLabelEditable);
|
||||||
command.setCommandStringEditable(isCommandStringEditable);
|
command.setCommandStringEditable(isCommandStringEditable);
|
||||||
compileType.addCompileCommandInOrder(command);
|
compileType.addCompileCommandInOrder(command);
|
||||||
|
@ -121,7 +122,7 @@ public class SystemCompileContributor implements ISystemCompileXMLConstants {
|
||||||
// compile type does not exist, so add a compile type, then add the compile command to it
|
// compile type does not exist, so add a compile type, then add the compile command to it
|
||||||
else {
|
else {
|
||||||
compileType = new SystemCompileType(prf, srcType);
|
compileType = new SystemCompileType(prf, srcType);
|
||||||
SystemCompileCommand command = new SystemCompileCommand(compileType, id, label, NATURE_ISV_VALUE, commandString, commandString, MENU_BOTH_VALUE, 0);
|
SystemCompileCommand command = new SystemCompileCommand(compileType, id, label, ISystemCompileXMLConstants.NATURE_ISV_VALUE, commandString, commandString, ISystemCompileXMLConstants.MENU_BOTH_VALUE, 0);
|
||||||
command.setLabelEditable(isLabelEditable);
|
command.setLabelEditable(isLabelEditable);
|
||||||
command.setCommandStringEditable(isCommandStringEditable);
|
command.setCommandStringEditable(isCommandStringEditable);
|
||||||
compileType.addCompileCommandInOrder(command);
|
compileType.addCompileCommandInOrder(command);
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.eclipse.rse.useractions.ui.compile;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2007 IBM Corporation and others.
|
* Copyright (c) 2002, 2007 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
@ -9,7 +7,11 @@ package org.eclipse.rse.useractions.ui.compile;
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
|
* Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemCompileXMLConstants
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.rse.useractions.ui.compile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
@ -52,7 +54,7 @@ import org.w3c.dom.Text;
|
||||||
* From that, one can get a list of compile commands registered for that type, and the
|
* From that, one can get a list of compile commands registered for that type, and the
|
||||||
* last-used compile command for that type.
|
* last-used compile command for that type.
|
||||||
*/
|
*/
|
||||||
public abstract class SystemCompileProfile implements ISystemCompileXMLConstants {
|
public abstract class SystemCompileProfile {
|
||||||
private SystemCompileManager parentManager;
|
private SystemCompileManager parentManager;
|
||||||
//private SystemProfile systemProfile;
|
//private SystemProfile systemProfile;
|
||||||
private String profileName;
|
private String profileName;
|
||||||
|
@ -237,7 +239,7 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
* The default is "compile.xml" and need not be overridden unless you don't like that name :-).
|
* The default is "compile.xml" and need not be overridden unless you don't like that name :-).
|
||||||
*/
|
*/
|
||||||
protected String getSaveFileName() {
|
protected String getSaveFileName() {
|
||||||
return FILE_NAME;
|
return ISystemCompileXMLConstants.FILE_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -303,18 +305,18 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
private Vector getTypes(Document doc) {
|
private Vector getTypes(Document doc) {
|
||||||
Vector types = new Vector();
|
Vector types = new Vector();
|
||||||
Element root = doc.getDocumentElement();
|
Element root = doc.getDocumentElement();
|
||||||
String oldvrm = root.getAttribute(VERSION_ATTRIBUTE);
|
String oldvrm = root.getAttribute(ISystemCompileXMLConstants.VERSION_ATTRIBUTE);
|
||||||
boolean oldversion = (oldvrm != null) && !oldvrm.equals(VERSION_VALUE);
|
boolean oldversion = (oldvrm != null) && !oldvrm.equals(ISystemCompileXMLConstants.VERSION_VALUE);
|
||||||
NodeList list = doc.getElementsByTagName(TYPE_ELEMENT);
|
NodeList list = doc.getElementsByTagName(ISystemCompileXMLConstants.TYPE_ELEMENT);
|
||||||
if (list == null) return types;
|
if (list == null) return types;
|
||||||
for (int i = 0; i < list.getLength(); i++) {
|
for (int i = 0; i < list.getLength(); i++) {
|
||||||
Node node = list.item(i);
|
Node node = list.item(i);
|
||||||
NamedNodeMap map = node.getAttributes();
|
NamedNodeMap map = node.getAttributes();
|
||||||
// get the type
|
// get the type
|
||||||
Node typeAttr = map.getNamedItem(TYPE_ATTRIBUTE);
|
Node typeAttr = map.getNamedItem(ISystemCompileXMLConstants.TYPE_ATTRIBUTE);
|
||||||
String type = typeAttr.getNodeValue();
|
String type = typeAttr.getNodeValue();
|
||||||
// get the label of the last compile name
|
// get the label of the last compile name
|
||||||
Node lastUsedAttr = map.getNamedItem(LASTUSED_ATTRIBUTE);
|
Node lastUsedAttr = map.getNamedItem(ISystemCompileXMLConstants.LASTUSED_ATTRIBUTE);
|
||||||
String lastUsed = lastUsedAttr.getNodeValue();
|
String lastUsed = lastUsedAttr.getNodeValue();
|
||||||
SystemCompileType newType = new SystemCompileType(this, type);
|
SystemCompileType newType = new SystemCompileType(this, type);
|
||||||
NodeList childList = node.getChildNodes();
|
NodeList childList = node.getChildNodes();
|
||||||
|
@ -322,45 +324,45 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
Node child = childList.item(j);
|
Node child = childList.item(j);
|
||||||
NamedNodeMap childAttrMap = child.getAttributes();
|
NamedNodeMap childAttrMap = child.getAttributes();
|
||||||
// get the name of the compile name
|
// get the name of the compile name
|
||||||
Node nameAttr = childAttrMap.getNamedItem(LABEL_ATTRIBUTE);
|
Node nameAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.LABEL_ATTRIBUTE);
|
||||||
String name = nameAttr.getNodeValue();
|
String name = nameAttr.getNodeValue();
|
||||||
// get the nature of the compile name
|
// get the nature of the compile name
|
||||||
Node natureAttr = childAttrMap.getNamedItem(NATURE_ATTRIBUTE);
|
Node natureAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.NATURE_ATTRIBUTE);
|
||||||
String nature = natureAttr.getNodeValue();
|
String nature = natureAttr.getNodeValue();
|
||||||
// get the default command string
|
// get the default command string
|
||||||
Node defaultAttr = childAttrMap.getNamedItem(DEFAULT_ATTRIBUTE);
|
Node defaultAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.DEFAULT_ATTRIBUTE);
|
||||||
String defaultString = (defaultAttr != null) ? defaultAttr.getNodeValue() : ""; //$NON-NLS-1$
|
String defaultString = (defaultAttr != null) ? defaultAttr.getNodeValue() : ""; //$NON-NLS-1$
|
||||||
// get the current string
|
// get the current string
|
||||||
Node currentAttr = childAttrMap.getNamedItem(CURRENT_ATTRIBUTE);
|
Node currentAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.CURRENT_ATTRIBUTE);
|
||||||
String currentString = currentAttr.getNodeValue();
|
String currentString = currentAttr.getNodeValue();
|
||||||
// get the menu option
|
// get the menu option
|
||||||
Node menuAttr = childAttrMap.getNamedItem(MENU_ATTRIBUTE);
|
Node menuAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.MENU_ATTRIBUTE);
|
||||||
String menuOption = menuAttr.getNodeValue();
|
String menuOption = menuAttr.getNodeValue();
|
||||||
// get the jobenv option
|
// get the jobenv option
|
||||||
Node jobenvAttr = childAttrMap.getNamedItem(JOBENV_ATTRIBUTE);
|
Node jobenvAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.JOBENV_ATTRIBUTE);
|
||||||
String jobEnv = null;
|
String jobEnv = null;
|
||||||
if (jobenvAttr != null) jobEnv = jobenvAttr.getNodeValue();
|
if (jobenvAttr != null) jobEnv = jobenvAttr.getNodeValue();
|
||||||
// get the ordering
|
// get the ordering
|
||||||
int order = j;
|
int order = j;
|
||||||
Node orderAttr = childAttrMap.getNamedItem(ORDER_ATTRIBUTE);
|
Node orderAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.ORDER_ATTRIBUTE);
|
||||||
// to ensure previous beta customers do not have problems
|
// to ensure previous beta customers do not have problems
|
||||||
if (orderAttr != null) {
|
if (orderAttr != null) {
|
||||||
order = Integer.valueOf(orderAttr.getNodeValue()).intValue();
|
order = Integer.valueOf(orderAttr.getNodeValue()).intValue();
|
||||||
}
|
}
|
||||||
// get the id option
|
// get the id option
|
||||||
Node idAttr = childAttrMap.getNamedItem(ID_ATTRIBUTE);
|
Node idAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.ID_ATTRIBUTE);
|
||||||
String id = null;
|
String id = null;
|
||||||
if (idAttr != null) {
|
if (idAttr != null) {
|
||||||
id = idAttr.getNodeValue();
|
id = idAttr.getNodeValue();
|
||||||
}
|
}
|
||||||
// get the label editable option
|
// get the label editable option
|
||||||
Node labelEditableAttr = childAttrMap.getNamedItem(LABEL_EDITABLE_ATTRIBUTE);
|
Node labelEditableAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.LABEL_EDITABLE_ATTRIBUTE);
|
||||||
String labelEditable = null;
|
String labelEditable = null;
|
||||||
if (labelEditableAttr != null) {
|
if (labelEditableAttr != null) {
|
||||||
labelEditable = labelEditableAttr.getNodeValue();
|
labelEditable = labelEditableAttr.getNodeValue();
|
||||||
}
|
}
|
||||||
// get the label editable option
|
// get the label editable option
|
||||||
Node stringEditableAttr = childAttrMap.getNamedItem(STRING_EDITABLE_ATTRIBUTE);
|
Node stringEditableAttr = childAttrMap.getNamedItem(ISystemCompileXMLConstants.STRING_EDITABLE_ATTRIBUTE);
|
||||||
String stringEditable = null;
|
String stringEditable = null;
|
||||||
if (stringEditableAttr != null) {
|
if (stringEditableAttr != null) {
|
||||||
stringEditable = stringEditableAttr.getNodeValue();
|
stringEditable = stringEditableAttr.getNodeValue();
|
||||||
|
@ -432,7 +434,7 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
String commandString = defaultCmds[j].getCommandWithParameters();
|
String commandString = defaultCmds[j].getCommandWithParameters();
|
||||||
// we can pass in null for the id, because the constructor checks if id is null
|
// we can pass in null for the id, because the constructor checks if id is null
|
||||||
// and if so tries to configure id automatically. This will work for IBM supplied commands.
|
// and if so tries to configure id automatically. This will work for IBM supplied commands.
|
||||||
cmds[j] = new SystemCompileCommand(type, null, cmdName, NATURE_IBM_VALUE, commandString, commandString, MENU_BOTH_VALUE, j);
|
cmds[j] = new SystemCompileCommand(type, null, cmdName, ISystemCompileXMLConstants.NATURE_IBM_VALUE, commandString, commandString, ISystemCompileXMLConstants.MENU_BOTH_VALUE, j);
|
||||||
type.addCompileCommandInOrder(cmds[j]);
|
type.addCompileCommandInOrder(cmds[j]);
|
||||||
String jobEnv = defaultCmds[j].getJobEnvironment();
|
String jobEnv = defaultCmds[j].getJobEnvironment();
|
||||||
if (jobEnv != null) {
|
if (jobEnv != null) {
|
||||||
|
@ -503,20 +505,20 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
try {
|
try {
|
||||||
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
|
||||||
DocumentBuilder builder = builderFactory.newDocumentBuilder();
|
DocumentBuilder builder = builderFactory.newDocumentBuilder();
|
||||||
Document doc = builder.getDOMImplementation().createDocument(null, ROOT_ELEMENT, null);
|
Document doc = builder.getDOMImplementation().createDocument(null, ISystemCompileXMLConstants.ROOT_ELEMENT, null);
|
||||||
// get root element and set attributes
|
// get root element and set attributes
|
||||||
Element root = doc.getDocumentElement();
|
Element root = doc.getDocumentElement();
|
||||||
root.setAttribute(VERSION_ATTRIBUTE, VERSION_VALUE);
|
root.setAttribute(ISystemCompileXMLConstants.VERSION_ATTRIBUTE, ISystemCompileXMLConstants.VERSION_VALUE);
|
||||||
// write the copyright info
|
// write the copyright info
|
||||||
Element copyright = doc.createElement(COPYRIGHT_ELEMENT);
|
Element copyright = doc.createElement(ISystemCompileXMLConstants.COPYRIGHT_ELEMENT);
|
||||||
Text copyrightText = doc.createTextNode(COPYRIGHT_TEXT);
|
Text copyrightText = doc.createTextNode(ISystemCompileXMLConstants.COPYRIGHT_TEXT);
|
||||||
copyright.appendChild(copyrightText);
|
copyright.appendChild(copyrightText);
|
||||||
root.appendChild(copyright);
|
root.appendChild(copyright);
|
||||||
// write type and compile commands for each
|
// write type and compile commands for each
|
||||||
for (int i = 0; i < types.size(); i++) {
|
for (int i = 0; i < types.size(); i++) {
|
||||||
SystemCompileType type = (SystemCompileType) (types.get(i));
|
SystemCompileType type = (SystemCompileType) (types.get(i));
|
||||||
Element typeElement = doc.createElement(TYPE_ELEMENT);
|
Element typeElement = doc.createElement(ISystemCompileXMLConstants.TYPE_ELEMENT);
|
||||||
typeElement.setAttribute(TYPE_ATTRIBUTE, type.getType());
|
typeElement.setAttribute(ISystemCompileXMLConstants.TYPE_ATTRIBUTE, type.getType());
|
||||||
SystemCompileCommand lastUsedCompileName = type.getLastUsedCompileCommand();
|
SystemCompileCommand lastUsedCompileName = type.getLastUsedCompileCommand();
|
||||||
String lastUsedName = null;
|
String lastUsedName = null;
|
||||||
if (lastUsedCompileName == null) {
|
if (lastUsedCompileName == null) {
|
||||||
|
@ -524,24 +526,24 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
} else {
|
} else {
|
||||||
lastUsedName = lastUsedCompileName.getLabel();
|
lastUsedName = lastUsedCompileName.getLabel();
|
||||||
}
|
}
|
||||||
typeElement.setAttribute(LASTUSED_ATTRIBUTE, lastUsedName);
|
typeElement.setAttribute(ISystemCompileXMLConstants.LASTUSED_ATTRIBUTE, lastUsedName);
|
||||||
Vector cmds = type.getCompileCommands();
|
Vector cmds = type.getCompileCommands();
|
||||||
for (int j = 0; j < cmds.size(); j++) {
|
for (int j = 0; j < cmds.size(); j++) {
|
||||||
SystemCompileCommand cmd = (SystemCompileCommand) (cmds.get(j));
|
SystemCompileCommand cmd = (SystemCompileCommand) (cmds.get(j));
|
||||||
Element cmdElement = doc.createElement(COMPILECOMMAND_ELEMENT);
|
Element cmdElement = doc.createElement(ISystemCompileXMLConstants.COMPILECOMMAND_ELEMENT);
|
||||||
if (cmd.getId() != null) {
|
if (cmd.getId() != null) {
|
||||||
cmdElement.setAttribute(ID_ATTRIBUTE, cmd.getId());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.ID_ATTRIBUTE, cmd.getId());
|
||||||
}
|
}
|
||||||
cmdElement.setAttribute(LABEL_ATTRIBUTE, cmd.getLabel());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.LABEL_ATTRIBUTE, cmd.getLabel());
|
||||||
cmdElement.setAttribute(NATURE_ATTRIBUTE, cmd.getNature());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.NATURE_ATTRIBUTE, cmd.getNature());
|
||||||
cmdElement.setAttribute(DEFAULT_ATTRIBUTE, cmd.getDefaultString());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.DEFAULT_ATTRIBUTE, cmd.getDefaultString());
|
||||||
cmdElement.setAttribute(CURRENT_ATTRIBUTE, cmd.getCurrentString());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.CURRENT_ATTRIBUTE, cmd.getCurrentString());
|
||||||
cmdElement.setAttribute(MENU_ATTRIBUTE, cmd.getMenuOption());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.MENU_ATTRIBUTE, cmd.getMenuOption());
|
||||||
cmdElement.setAttribute(ORDER_ATTRIBUTE, String.valueOf(j));
|
cmdElement.setAttribute(ISystemCompileXMLConstants.ORDER_ATTRIBUTE, String.valueOf(j));
|
||||||
cmdElement.setAttribute(LABEL_EDITABLE_ATTRIBUTE, String.valueOf(cmd.isLabelEditable()));
|
cmdElement.setAttribute(ISystemCompileXMLConstants.LABEL_EDITABLE_ATTRIBUTE, String.valueOf(cmd.isLabelEditable()));
|
||||||
cmdElement.setAttribute(STRING_EDITABLE_ATTRIBUTE, String.valueOf(cmd.isCommandStringEditable()));
|
cmdElement.setAttribute(ISystemCompileXMLConstants.STRING_EDITABLE_ATTRIBUTE, String.valueOf(cmd.isCommandStringEditable()));
|
||||||
if (cmd.getJobEnvironment() != null) {
|
if (cmd.getJobEnvironment() != null) {
|
||||||
cmdElement.setAttribute(JOBENV_ATTRIBUTE, cmd.getJobEnvironment());
|
cmdElement.setAttribute(ISystemCompileXMLConstants.JOBENV_ATTRIBUTE, cmd.getJobEnvironment());
|
||||||
}
|
}
|
||||||
typeElement.appendChild(cmdElement);
|
typeElement.appendChild(cmdElement);
|
||||||
}
|
}
|
||||||
|
@ -582,7 +584,7 @@ public abstract class SystemCompileProfile implements ISystemCompileXMLConstants
|
||||||
String commandString = defaultCmds[j].getCommandWithParameters();
|
String commandString = defaultCmds[j].getCommandWithParameters();
|
||||||
// we can pass in null for the id, because the constructor checks if id is null
|
// we can pass in null for the id, because the constructor checks if id is null
|
||||||
// and if so tries to configure id automatically. This will work for IBM supplied commands.
|
// and if so tries to configure id automatically. This will work for IBM supplied commands.
|
||||||
cmds[j] = new SystemCompileCommand(type, null, cmdName, NATURE_IBM_VALUE, commandString, commandString, MENU_BOTH_VALUE, j);
|
cmds[j] = new SystemCompileCommand(type, null, cmdName, ISystemCompileXMLConstants.NATURE_IBM_VALUE, commandString, commandString, ISystemCompileXMLConstants.MENU_BOTH_VALUE, j);
|
||||||
type.addCompileCommandInOrder(cmds[j]);
|
type.addCompileCommandInOrder(cmds[j]);
|
||||||
String jobEnv = defaultCmds[j].getJobEnvironment();
|
String jobEnv = defaultCmds[j].getJobEnvironment();
|
||||||
if (jobEnv != null) cmds[j].setJobEnvironment(jobEnv);
|
if (jobEnv != null) cmds[j].setJobEnvironment(jobEnv);
|
||||||
|
|
Loading…
Add table
Reference in a new issue