use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class LoggingTreeSubPage method addPluginToList.
/**
* Adds a new logging plugin to the list of logging plugins available
* for a given component. If necessary also creates the list of logging
* plugins.
*
* @param componentName
* the name of the component to add the plugin to.
* @param pluginName
* the name of the plugin to add
* @param path
* the path of the plugin to add, or null if none.
*/
private void addPluginToList(final String componentName, final String pluginName, final String path) {
if (loggingSectionHandler == null) {
return;
}
final StringBuilder pluginBuilder = new StringBuilder();
pluginBuilder.append(pluginName);
if (path != null && path.length() != 0) {
pluginBuilder.append(" := \"").append(path).append('\"');
}
/*
* loggingSectionHandler.getLastSectionRoot()
* entry.getLoggerPluginsRoot()
* entry.getLoggerPluginsListRoot()
* {
* pluginEntry.getLoggerPluginRoot()
* }
*/
LoggingSectionHandler.LoggerPluginsEntry entry = loggingSectionHandler.getLoggerPluginsTree().get(componentName);
if (entry == null) {
entry = new LoggingSectionHandler.LoggerPluginsEntry();
loggingSectionHandler.getLoggerPluginsTree().put(componentName, entry);
final ParseTree loggerPluginsRoot = new ParserRuleContext();
ConfigTreeNodeUtilities.addChild(loggingSectionHandler.getLastSectionRoot(), loggerPluginsRoot);
entry.setLoggerPluginsRoot(loggerPluginsRoot);
final StringBuilder builder = new StringBuilder();
builder.append('\n').append(componentName).append(".LoggerPlugins := ");
ConfigTreeNodeUtilities.addChild(loggerPluginsRoot, new AddedParseTree(builder.toString()));
ConfigTreeNodeUtilities.addChild(loggerPluginsRoot, new AddedParseTree("{"));
final ParseTree loggerPluginsListRoot = new ParserRuleContext();
entry.setLoggerPluginsListRoot(loggerPluginsListRoot);
final LoggingSectionHandler.LoggerPluginEntry pluginEntry = new LoggingSectionHandler.LoggerPluginEntry();
final ParseTree pluginRoot = new ParserRuleContext();
pluginEntry.setLoggerPluginRoot(pluginRoot);
pluginEntry.setName(pluginName);
pluginEntry.setPath(path);
ConfigTreeNodeUtilities.addChild(pluginRoot, new AddedParseTree(pluginBuilder.toString()));
entry.setPluginRoots(new HashMap<String, LoggingSectionHandler.LoggerPluginEntry>(1));
entry.getPluginRoots().put(pluginName, pluginEntry);
ConfigTreeNodeUtilities.addChild(loggerPluginsListRoot, pluginRoot);
ConfigTreeNodeUtilities.addChild(loggerPluginsRoot, loggerPluginsListRoot);
ConfigTreeNodeUtilities.addChild(loggerPluginsRoot, new AddedParseTree("}"));
return;
}
final int childCount = entry.getLoggerPluginsListRoot().getChildCount();
ConfigTreeNodeUtilities.addChild(entry.getLoggerPluginsListRoot(), new AddedParseTree((childCount > 0 ? ", " : "") + pluginBuilder.toString()));
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class ModuleParameterSectionPage method createNewModuleParameterSection.
private void createNewModuleParameterSection() {
if (moduleParametersHandler == null) {
return;
}
ParserRuleContext sectionRoot = new ParserRuleContext();
moduleParametersHandler.setLastSectionRoot(sectionRoot);
ParseTree header = new AddedParseTree("\n[MODULE_PARAMETERS]");
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 GeneralOptionsSubPage method createLogFileNode.
private void createLogFileNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
logentry.setLogFileRoot(new ParserRuleContext());
logentry.setLogFile(new AddedParseTree(value));
createNode(lte, logentry, value, "LogFile", logentry.getLogFileRoot(), logentry.getLogFile());
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class GeneralOptionsSubPage method createSourceInfoFormatNode.
private void createSourceInfoFormatNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
logentry.setSourceInfoFormatRoot(new ParserRuleContext());
logentry.setSourceInfoFormat(new AddedParseTree(value));
createNode(lte, logentry, value, "SourceInfoFormat", logentry.getSourceInfoFormatRoot(), logentry.getSourceInfoFormat());
}
use of org.eclipse.titan.common.parsers.AddedParseTree in project titan.EclipsePlug-ins by eclipse.
the class GeneralOptionsSubPage method createAppendFileNode.
private void createAppendFileNode(final LoggingSectionHandler.LoggerTreeElement lte, final LogParamEntry logentry, final String value) {
logentry.setAppendFileRoot(new ParserRuleContext());
logentry.setAppendFile(new AddedParseTree(value));
createNode(lte, logentry, value, "AppendFile", logentry.getAppendFileRoot(), logentry.getAppendFile());
}
Aggregations