本文整理汇总了Java中org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode类的典型用法代码示例。如果您正苦于以下问题:Java EStructuralFeatureNode类的具体用法?Java EStructuralFeatureNode怎么用?Java EStructuralFeatureNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EStructuralFeatureNode类属于org.eclipse.xtext.ui.editor.outline.impl包,在下文中一共展示了EStructuralFeatureNode类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addToOutlineMap
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
/**
* Add the given outline node to the outline map.
*
* @param node
* IOutlineNode to add.
*/
private void addToOutlineMap(final IOutlineNode node) {
EStructuralFeature eFeature = null;
if (node instanceof EObjectNode) {
eFeature = ((EObjectNode) node).getEObject(getTestSource().getXtextResource()).eContainingFeature();
// TODO : remove the following part once all tests have been refactored
Class<?> nodeClazz = ((EObjectNode) node).getEClass().getInstanceClass();
if (!getOutlineMap().containsKey(nodeClazz)) {
getOutlineMap().put(nodeClazz, new ArrayList<IOutlineNode>());
}
getOutlineMap().get(nodeClazz).add(node);
} else if (node instanceof EStructuralFeatureNode) {
eFeature = ((EStructuralFeatureNode) node).getEStructuralFeature();
}
if (eFeature == null) {
return;
}
if (!getOutlineMap().containsKey(eFeature)) {
getOutlineMap().put(eFeature, new ArrayList<IOutlineNode>());
}
getOutlineMap().get(eFeature).add(node);
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:28,代码来源:AbstractOutlineTest.java
示例2: internalCreateChildren
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的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
示例3: getCategory
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
@Override
public int getCategory(final IOutlineNode node) {
if (node instanceof EStructuralFeatureNode) {
EStructuralFeature eStructuralFeature = ((EStructuralFeatureNode) node).getEStructuralFeature();
if (eStructuralFeature == ValidPackage.Literals.VALID_MODEL__IMPORTS) {
return IMPORTS_ORDER;
}
}
return 0;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:11,代码来源:ValidOutlineNodeComparator.java
示例4: getCategory
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
@Override
public int getCategory(final IOutlineNode node) {
if (node instanceof EStructuralFeatureNode) {
EStructuralFeature eStructuralFeature = ((EStructuralFeatureNode) node).getEStructuralFeature();
if (eStructuralFeature == ExportPackage.Literals.EXPORT_MODEL__IMPORTS) {
return IMPORTS_ORDER;
}
}
return 0;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:11,代码来源:ExportOutlineNodeComparator.java
示例5: getCategory
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
@Override
public int getCategory(final IOutlineNode node) {
if (node instanceof EStructuralFeatureNode) {
EStructuralFeature eStructuralFeature = ((EStructuralFeatureNode) node).getEStructuralFeature();
if (eStructuralFeature == ScopePackage.Literals.SCOPE_MODEL__IMPORTS) {
return IMPORTS_ORDER;
}
}
return 0;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:11,代码来源:ScopeOutlineNodeComparator.java
示例6: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的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: extractChildrenFromStructuralFeatureNodes
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
private static List<IOutlineNode> extractChildrenFromStructuralFeatureNodes(Iterable<IOutlineNode> nodes) {
List<IOutlineNode> nodesToFilter = new ArrayList<>();
for (IOutlineNode node : nodes) {
if (node instanceof EStructuralFeatureNode) {
EStructuralFeatureNode parent = (EStructuralFeatureNode) node;
nodesToFilter.addAll(parent.getChildren());
}
}
return nodesToFilter;
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:11,代码来源:OutlineFlattenFilterAndSorter.java
示例8: _createChildren
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
protected void _createChildren(EStructuralFeatureNode parentNode, EObject node) {
if (node instanceof Plan || node instanceof Agent || node instanceof Belief)
super._createChildren(parentNode, node);
}
开发者ID:jason-lang,项目名称:jason-eclipse-plugin,代码行数:5,代码来源:AslOutlineTreeProvider.java
示例9: createEStructuralFeatureNode
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
/**
* Creates a new structural feature node with a given image description and label.
*
* @param parentNode
* the parent {@link IOutlineNode}
* @param owner
* a valid model element as {@link EObject}
* @param feature
* a structural feature {@link EStructuralFeature}
* @param image
* an image descriptor {@link ImageDescriptor}
* @param text
* the label text
* @param isLeaf
* true if feature is a leaf
* @return newly created structural feature node
*/
protected EStructuralFeatureNode createEStructuralFeatureNode(final IOutlineNode parentNode, final EObject owner, final EStructuralFeature feature, final ImageDescriptor image, final Object text, final boolean isLeaf) {
boolean isFeatureSet = owner.eIsSet(feature);
EStructuralFeatureNode eStructuralFeatureNode = new EStructuralFeatureNode(owner, feature, parentNode, image, text, isLeaf || !isFeatureSet);
if (isFeatureSet) {
ITextRegion region = getLocationInFileProvider().getFullTextRegion(owner, feature, 0);
if (feature.isMany()) {
int numValues = ((Collection<?>) owner.eGet(feature)).size();
ITextRegion fullTextRegion = getLocationInFileProvider().getFullTextRegion(owner, feature, numValues - 1);
if (fullTextRegion != null) {
region = region.merge(fullTextRegion);
}
}
eStructuralFeatureNode.setTextRegion(region);
}
return eStructuralFeatureNode;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:34,代码来源:AbstractOutlineTreeProvider.java
示例10: apply
import org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode; //导入依赖的package包/类
@Override
protected boolean apply(IOutlineNode node) {
return !(node instanceof EStructuralFeatureNode);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:5,代码来源:FlatOutlineViewContribution.java
注:本文中的org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论