use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class LoggingPage method createLoggingSection.
public void createLoggingSection() {
if (loggingSectionHandler == null || loggingSectionHandler.getLastSectionRoot() != null) {
return;
}
ParserRuleContext sectionRoot = new ParserRuleContext();
loggingSectionHandler.setLastSectionRoot(sectionRoot);
ParseTree header = new AddedParseTree("\n[LOGGING]");
ConfigTreeNodeUtilities.addChild(sectionRoot, header);
ParserRuleContext root = editor.getParseTreeRoot();
if (root != null) {
root.addChild(sectionRoot);
}
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class TestportParametersSectionPage method createNewParameter.
private TestportParameter createNewParameter() {
if (testportParametersHandler == null) {
return null;
}
TestportParameter newTestportParameter = new TestportParameterSectionHandler.TestportParameter();
final ParseTree root = new ParserRuleContext();
newTestportParameter.setRoot(root);
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("\n"));
newTestportParameter.setComponentName(new AddedParseTree("component_name"));
ConfigTreeNodeUtilities.addChild(root, newTestportParameter.getComponentName());
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("."));
newTestportParameter.setTestportName(new AddedParseTree("testport_name"));
ConfigTreeNodeUtilities.addChild(root, newTestportParameter.getTestportName());
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("."));
newTestportParameter.setParameterName(new AddedParseTree("parameter_name"));
ConfigTreeNodeUtilities.addChild(root, newTestportParameter.getParameterName());
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(" := "));
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("\"value\""));
return newTestportParameter;
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class ModuleParameterSectionPage method createNewParameter.
public static ModuleParameter createNewParameter(final String aModuleName, final String aParameterName, final String aValue) {
ModuleParameter newModuleParameter = new ModuleParameterSectionHandler.ModuleParameter();
final ParseTree root = new ParserRuleContext();
newModuleParameter.setRoot(root);
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("\n"));
newModuleParameter.setModuleName(new AddedParseTree(aModuleName));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getModuleName());
final boolean isModuleNameEmpty = aModuleName == null || aModuleName.isEmpty();
newModuleParameter.setSeparator(new AddedParseTree(isModuleNameEmpty ? "" : "."));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getSeparator());
newModuleParameter.setParameterName(new AddedParseTree(aParameterName));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getParameterName());
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree(" := "));
newModuleParameter.setValue(new AddedParseTree(aValue));
ConfigTreeNodeUtilities.addChild(root, newModuleParameter.getValue());
return newModuleParameter;
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class ExecuteItemTransfer method nativeToJava.
@Override
protected ExecuteItem[] nativeToJava(final TransferData transferData) {
byte[] bytes = (byte[]) super.nativeToJava(transferData);
DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));
try {
int n = in.readInt();
ExecuteItem[] items = new ExecuteItem[n];
String moduleName;
String testcaseName;
String hiddenBefore;
for (int i = 0; i < n; i++) {
items[i] = new ExecuteSectionHandler.ExecuteItem();
final ParseTree root = new ParserRuleContext();
items[i].setRoot(root);
hiddenBefore = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, ConfigTreeNodeUtilities.createHiddenTokenNode(hiddenBefore));
moduleName = in.readUTF();
final ParseTree moduleNameNode = new AddedParseTree(moduleName);
items[i].setModuleName(moduleNameNode);
ConfigTreeNodeUtilities.addChild(root, moduleNameNode);
hiddenBefore = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, ConfigTreeNodeUtilities.createHiddenTokenNode(hiddenBefore));
ConfigTreeNodeUtilities.addChild(root, new AddedParseTree("."));
hiddenBefore = in.readUTF();
ConfigTreeNodeUtilities.addChild(root, ConfigTreeNodeUtilities.createHiddenTokenNode(hiddenBefore));
testcaseName = in.readUTF();
final ParseTree testcaseNameNode = new AddedParseTree(testcaseName);
items[i].setTestcaseName(testcaseNameNode);
ConfigTreeNodeUtilities.addChild(root, testcaseNameNode);
}
return items;
} catch (IOException e) {
ErrorReporter.logExceptionStackTrace(e);
return new ExecuteItem[] {};
}
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class ExecuteSubPage method createNewExecuteSection.
private void createNewExecuteSection() {
if (executeSectionHandler == null) {
return;
}
ParserRuleContext sectionRoot = new ParserRuleContext();
executeSectionHandler.setLastSectionRoot(sectionRoot);
ParseTree header = new AddedParseTree("\n[EXECUTE]");
ConfigTreeNodeUtilities.addChild(sectionRoot, header);
ParserRuleContext root = editor.getParseTreeRoot();
if (root != null) {
root.addChild(sectionRoot);
}
}
Aggregations