本文整理汇总了Java中org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode类的典型用法代码示例。如果您正苦于以下问题:Java DocumentRootNode类的具体用法?Java DocumentRootNode怎么用?Java DocumentRootNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentRootNode类属于org.eclipse.xtext.ui.editor.outline.impl包,在下文中一共展示了DocumentRootNode类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: internalCreateChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
@Override
protected void internalCreateChildren(final DocumentRootNode parentNode, final EObject modelElement) {
CheckCatalog catalog = (CheckCatalog) modelElement;
if (catalog.getPackageName() != null) {
getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, catalog, CheckPackage.Literals.CHECK_CATALOG__PACKAGE_NAME, ImageDescriptor.createFromImage(checkImages.forPackage()), catalog.getPackageName(), true);
}
if (catalog.getImports() != null && !catalog.getImports().getImportDeclarations().isEmpty()) {
EStructuralFeatureNode importNode = getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, catalog, CheckPackage.Literals.CHECK_CATALOG__IMPORTS, ImageDescriptor.createFromImage(checkImages.forImportContainer()), "Import declarations", false);
for (final org.eclipse.xtext.xtype.XImportDeclaration imported : catalog.getImports().getImportDeclarations()) {
createNode(importNode, imported);
}
}
EObjectNode catalogNode = createNode(parentNode, catalog);
for (final Category category : catalog.getCategories()) {
createNode(catalogNode, category);
}
for (final Check check : catalog.getChecks()) {
createNode(catalogNode, check);
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:25,代码来源:CheckOutlineTreeProvider.java
示例2: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Create child-nodes for the document. This means creating project-nodes.
*
* @param parentNode The document root node (virtual node, not displayed).
* @param unit The top-level element of the IVML-gramar (VariabilityUnit).
*/
protected void _createChildren(DocumentRootNode parentNode,
VariabilityUnit unit) {
/*
* if (null != unit.getLevel()) { // the language level is currently not
* official createNode(parentNode, unit.getLevel()); }
*/
/*
* Display all available projects in the outline.
*/
if (unit != null && !isEmpty(unit.getProjects())) {
for (Project project: unit.getProjects()) {
//Leave creation of project node to Xtext!
createNode(parentNode, project);
}
}
}
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:24,代码来源:IvmlOutlineTreeProvider.java
示例3: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
protected void _createChildren(DocumentRootNode parentNode, EObject node) {
if (node instanceof Agent) {
for (Belief b : ((Agent) node).getBelief()) {
_createNode(parentNode, b);
}
for (Plan p : ((Agent) node).getPlan()) {
_createNode(parentNode, p);
}
}
}
开发者ID:jason-lang,项目名称:jason-eclipse-plugin,代码行数:13,代码来源:AslOutlineTreeProvider.java
示例4: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Do not create Model nodes in the outline. When the valid model is processed it is not
* added to the outline but its children are.
*
* @param parentNode
* the parent node, this should be the tree root
* @param modelElement
* a valid model
*/
// CHECKSTYLE:OFF
protected void _createChildren(final DocumentRootNode parentNode, final ValidModel modelElement) {
// CHECKSTYLE:ON
Image importContainerImage = JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_OBJS_IMPCONT);
if (!modelElement.getImports().isEmpty()) {
createEStructuralFeatureNode(parentNode, modelElement, ValidPackage.Literals.VALID_MODEL__IMPORTS, importContainerImage, "import declarations", false);
}
for (EObject content : modelElement.getCategories()) {
createNode(parentNode, content);
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:23,代码来源:ValidOutlineTreeProvider.java
示例5: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Create the child nodes for a given native Context. We only show quick fixes.
*
* @param parentNode
* the parent node
* @param modelElement
* the scope model
*/
//CHECKSTYLE:OFF
protected void _createChildren(final DocumentRootNode parentNode, final ScopeModel modelElement) {
//CHECKSTYLE:ON
Image importContainerImage = JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_OBJS_IMPCONT);
if (!modelElement.getImports().isEmpty()) {
createEStructuralFeatureNode(parentNode, modelElement, ScopePackage.Literals.SCOPE_MODEL__IMPORTS, importContainerImage, "import declarations", false);
}
for (EObject content : modelElement.getScopes()) {
createNode(parentNode, content);
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:22,代码来源:ScopeOutlineTreeProvider.java
示例6: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Default for createChildrenDispatcher with outline node as a parent node.
*
* @param parentNode
* the {@link IOutlineNode}
* @param modelElement
* the {@link EObject} model element
*/
// CHECKSTYLE:CHECK-OFF Name (dispatcher enforces names starting with underscore)
public void _createChildren(final IOutlineNode parentNode, final EObject modelElement) {
// CHECKSTYLE:CHECK-ON
if (modelElement != null && parentNode.hasChildren()) {
if (parentNode instanceof DocumentRootNode) {
internalCreateChildren((DocumentRootNode) parentNode, modelElement);
} else if (parentNode instanceof EStructuralFeatureNode) {
internalCreateChildren((EStructuralFeatureNode) parentNode, modelElement);
} else {
internalCreateChildren(parentNode, modelElement);
}
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:22,代码来源:AbstractOutlineTreeProvider.java
示例7: _createNode
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Default for createNodeDispatcher with document root as a parent node.
*
* @param parentNode
* the {@link DocumentRootNode}
* @param modelElement
* the {@link EObject} model element
*/
// CHECKSTYLE:CHECK-OFF Name (dispatcher enforces names starting with underscore)
protected void _createNode(final DocumentRootNode parentNode, final EObject modelElement) {
// CHECKSTYLE:CHECK-ON
Object text = textDispatcher.invoke(modelElement);
if (text == null) {
text = modelElement.eResource().getURI().trimFileExtension().lastSegment();
}
factory.createEObjectNode(parentNode, modelElement, imageDispatcher.invoke(modelElement), text, isLeafDispatcher.invoke(modelElement));
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:18,代码来源:AbstractOutlineTreeProvider.java
示例8: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Creates the children for the ImplementationUnit.
*
* @param parentNode
* parentNode
* @param unit
* Create children for unit-object
*/
protected void _createChildren(DocumentRootNode parentNode, ImplementationUnit unit) {
if (unit != null && unit.getScripts() != null && !unit.getScripts().isEmpty()) {
for (LanguageUnit script : unit.getScripts()) {
// List vilScript
if (script != null) {
createScriptNodes(script, parentNode);
}
}
}
}
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:19,代码来源:VilBuildLanguageOutlineTreeProvider.java
示例9: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
protected void _createChildren(DocumentRootNode parentNode,
Program program) {
for (Class c : program.getClasses()) {
createNode(parentNode, c);
}
if (program.getMain() != null)
createNode(parentNode, program.getMain());
}
开发者ID:eclipse,项目名称:xsemantics,代码行数:9,代码来源:FJOutlineTreeProvider.java
示例10: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
public void _createChildren(final DocumentRootNode outlineNode, final SJProgram model) {
EList<SJClass> _classes = model.getClasses();
final Procedure1<SJClass> _function = new Procedure1<SJClass>() {
@Override
public void apply(final SJClass cl) {
SmallJavaOutlineTreeProvider.this.createNode(outlineNode, cl);
}
};
IterableExtensions.<SJClass>forEach(_classes, _function);
}
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:11,代码来源:SmallJavaOutlineTreeProvider.java
示例11: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
public void _createChildren(final DocumentRootNode outlineNode, final Model model) {
EList<Entity> _entities = model.getEntities();
final Procedure1<Entity> _function = new Procedure1<Entity>() {
@Override
public void apply(final Entity entity) {
EntitiesOutlineTreeProvider.this.createNode(outlineNode, entity);
}
};
IterableExtensions.<Entity>forEach(_entities, _function);
}
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:11,代码来源:EntitiesOutlineTreeProvider.java
示例12: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
protected void _createChildren(DocumentRootNode parent, PhdlModel p) {
createPackageNodes(parent, p);
createImportNodes(parent, p);
createDeviceNodes(parent, p);
createDesignNodes(parent, p);
}
开发者ID:timofonic,项目名称:PHDL,代码行数:7,代码来源:PhdlOutlineTreeProvider.java
示例13: createTemplateNodes
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Creates all nodes for the template.
*
* @param unit
* LanguageUnit with Template
* @param parentNode
* the parent node
*/
private void createTemplateNodes(LanguageUnit unit, DocumentRootNode parentNode) {
// create VirtualNode for Template
VirtualOutlineNode tempNode = null;
StyledString displayString = new StyledString();
if (unit.getExt() != null && !unit.getExt().isEmpty()) {
if (unit.getName() != null && !unit.getName().isEmpty()) {
// template Name with extension
String extName = unit.getExt();
displayString.append("" + unit.getName());
displayString.append(" extends " + extName);
// instantiate virtualNode for template
tempNode = new VirtualOutlineNode(parentNode, imageHelper.getImage(Images.NAME_VILTEMPLATE),
displayString, false);
}
} else {
if (unit.getName() != null && !unit.getName().isEmpty()) {
// template Name without extension
displayString.append("" + unit.getName());
// instantiate virtualNode for template
tempNode = new VirtualOutlineNode(parentNode, imageHelper.getImage(Images.NAME_VILTEMPLATE),
displayString, false);
}
}
if (tempNode != null) {
// create nodes for advices
if (!isEmpty(unit.getAdvices())) {
createAdviceNodes(unit.getAdvices(), tempNode);
}
// create nodes for indentation
if (unit.getIndent() != null && !isEmpty(unit.getIndent().getParts())) {
createIndentNodes(unit.getIndent().getParts(), tempNode);
}
// create nodes for parameters
if (unit.getParam() != null && !isEmpty(unit.getParam().getParam())) {
VirtualOutlineNode paramNode = new VirtualOutlineNode(tempNode,
imageHelper.getImage(Images.NAME_PARAMETERLIST), "Parameters", false);
createParameterNodes(unit.getParam().getParam(), paramNode);
}
// create nodes for java extensions
if (!isEmpty(unit.getJavaExts())) {
createJavaExtNodes(unit.getJavaExts(), tempNode);
}
// create nodes for imports
if (!isEmpty(unit.getImports())) {
createImportNodes(unit.getImports(), tempNode);
}
// create versionNode
if (unit.getVersion() != null) {
createVersionNode(unit.getVersion(), tempNode);
}
// TemplateContents
if (hasContents(unit)) {
// create VirtualNode for TemplateContent
StyledString templateContentsString = new StyledString();
templateContentsString.append("Template Contents", StyledString.QUALIFIER_STYLER);
VirtualOutlineNode templateContentNode = new VirtualOutlineNode(tempNode,
imageHelper.getImage(Images.NAME_SCRIPTCONTENT), templateContentsString, false);
createScriptContentNodes(unit.getElements(), templateContentNode);
}
}
}
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:75,代码来源:TemplateLangOutlineTreeProvider.java
示例14: createScriptNodes
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* creates a node for the vilScript.
*
* @param script
* the vilScript
* @param parentNode
* parentnode
*/
protected void createScriptNodes(LanguageUnit script, DocumentRootNode parentNode) {
VirtualOutlineNode vilNode = null;
StyledString displayString = new StyledString();
if (checkScriptParent(script)) {
if (script.getName() != null && !script.getName().isEmpty()) {
String parentName = script.getParent().getName();
// vilScript Name with parent
displayString.append("" + script.getName());
displayString.append(" extends " + parentName);
// create virtualNode for vilScript
vilNode = new VirtualOutlineNode(parentNode, imageHelper.getImage(Images.NAME_VILSCRIPT),
displayString, false);
}
} else {
if (script.getName() != null && !script.getName().isEmpty()) {
// vilScript Name without parent
displayString.append("" + script.getName());
// create virtualNode for vilScript
vilNode = new VirtualOutlineNode(parentNode, imageHelper.getImage(Images.NAME_VILSCRIPT),
displayString, false);
}
}
if (vilNode != null) {
// create Nodes for Advices
if (!isEmpty(script.getAdvices())) {
createAdviceNodes(script.getAdvices(), vilNode);
}
// create VirtualNode for vilParameters
if (script.getParam() != null && !isEmpty(script.getParam().getParam())) {
VirtualOutlineNode virtualParamNode = new VirtualOutlineNode(vilNode,
imageHelper.getImage(Images.NAME_PARAMLIST), "Parameters", false);
createParametersNodes(script.getParam().getParam(), virtualParamNode);
}
// create versionNode
if (script.getVersion() != null) {
createVersionNode(script.getVersion(), vilNode);
}
// create ImportNodes
if (!isEmpty(script.getImports())) {
createImportNodes(script.getImports(), vilNode);
}
// create PropertyNodes
if (!isEmpty(script.getLoadProperties())) {
createPropertyNodes(script.getLoadProperties(), vilNode);
}
// ScriptContents
if (hasContents(script)) {
// create VirtualNode for ScriptContent
StyledString scriptContentsString = new StyledString();
scriptContentsString.append("Script Contents", StyledString.QUALIFIER_STYLER);
VirtualOutlineNode scriptContentNode = new VirtualOutlineNode(vilNode,
imageHelper.getImage(Images.NAME_SCRIPTCONTENT), scriptContentsString, false);
createScriptContentNodes(script, scriptContentNode);
}
}
}
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:65,代码来源:VilBuildLanguageOutlineTreeProvider.java
示例15: internalCreateChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Do not create Model nodes in the outline if the model node itself is not specified as required element.
* In that case, when the valid model is processed it is not added to the outline but its children are.
*
* @param parentNode
* the parent {@link IOutlineNode}
* @param modelElement
* a valid {@link EObject}
*/
@Override
protected void internalCreateChildren(final DocumentRootNode parentNode, final EObject modelElement) {
if (getRelevantElements().contains(modelElement.eClass())) {
createNode(parentNode, modelElement);
} else {
createChildrenDispatcher.invoke(parentNode, modelElement);
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:18,代码来源:AbstractOutlineTreeProvider.java
示例16: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode; //导入依赖的package包/类
/**
* Creates the Children for LanguageUnit. It's the rootnode in this case.
*
* @param parentNode
* the parent node
* @param unit
* the LanguageUnit
*/
protected void _createChildren(DocumentRootNode parentNode, LanguageUnit unit) {
if (unit != null && parentNode != null) {
createTemplateNodes(unit, parentNode);
}
}
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:14,代码来源:TemplateLangOutlineTreeProvider.java
注:本文中的org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论