mirror of https://github.com/Minres/RDL-Editor.git
98 lines
3.6 KiB
Java
98 lines
3.6 KiB
Java
|
/**
|
||
|
* generated by Xtext 2.12.0
|
||
|
*/
|
||
|
package com.minres.rdl.ui.outline;
|
||
|
|
||
|
import com.minres.rdl.rdl.ComponentDefinition;
|
||
|
import com.minres.rdl.rdl.EnumDefinition;
|
||
|
import com.minres.rdl.rdl.EnumEntry;
|
||
|
import com.minres.rdl.rdl.ExplicitPropertyAssignment;
|
||
|
import com.minres.rdl.rdl.NamedInstantiation;
|
||
|
import com.minres.rdl.rdl.PostPropertyAssignment;
|
||
|
import com.minres.rdl.rdl.PropertyAssignment;
|
||
|
import com.minres.rdl.rdl.PropertyAssignmentRhs;
|
||
|
import com.minres.rdl.rdl.PropertyDefinition;
|
||
|
import com.minres.rdl.rdl.Root;
|
||
|
import java.util.function.Consumer;
|
||
|
import org.eclipse.xtext.ui.editor.outline.IOutlineNode;
|
||
|
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
|
||
|
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode;
|
||
|
|
||
|
/**
|
||
|
* Customization of the default outline structure.
|
||
|
*
|
||
|
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline
|
||
|
*/
|
||
|
@SuppressWarnings("all")
|
||
|
public class RDLOutlineTreeProvider extends DefaultOutlineTreeProvider {
|
||
|
protected void _createChildren(final DocumentRootNode parentNode, final Root domainModel) {
|
||
|
final Consumer<EnumDefinition> _function = (EnumDefinition it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
domainModel.getEnumDefinitions().forEach(_function);
|
||
|
final Consumer<PropertyDefinition> _function_1 = (PropertyDefinition it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
domainModel.getPropertyDefinitions().forEach(_function_1);
|
||
|
final Consumer<ComponentDefinition> _function_2 = (ComponentDefinition it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
domainModel.getComponentDefinitions().forEach(_function_2);
|
||
|
final Consumer<PropertyAssignment> _function_3 = (PropertyAssignment it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
domainModel.getPropertyAssignments().forEach(_function_3);
|
||
|
final Consumer<NamedInstantiation> _function_4 = (NamedInstantiation it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
domainModel.getNamedInstantiations().forEach(_function_4);
|
||
|
}
|
||
|
|
||
|
protected void _createChildren(final IOutlineNode parentNode, final ComponentDefinition compDef) {
|
||
|
final Consumer<EnumDefinition> _function = (EnumDefinition it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
compDef.getEnumDefinitions().forEach(_function);
|
||
|
final Consumer<ComponentDefinition> _function_1 = (ComponentDefinition it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
compDef.getComponentDefinitions().forEach(_function_1);
|
||
|
final Consumer<PropertyAssignment> _function_2 = (PropertyAssignment it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
compDef.getPropertyAssignments().forEach(_function_2);
|
||
|
final Consumer<NamedInstantiation> _function_3 = (NamedInstantiation it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
compDef.getNamedInstantiations().forEach(_function_3);
|
||
|
}
|
||
|
|
||
|
protected void _createChildren(final IOutlineNode parentNode, final EnumDefinition e) {
|
||
|
final Consumer<EnumEntry> _function = (EnumEntry it) -> {
|
||
|
this.createNode(parentNode, it);
|
||
|
};
|
||
|
e.getBody().getEntries().forEach(_function);
|
||
|
}
|
||
|
|
||
|
protected void _createChildren(final IOutlineNode parentNode, final PostPropertyAssignment p) {
|
||
|
this.createNode(parentNode, p.getRhs());
|
||
|
}
|
||
|
|
||
|
protected boolean _isLeaf(final ExplicitPropertyAssignment feature) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
protected boolean _isLeaf(final NamedInstantiation feature) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
protected boolean _isLeaf(final PropertyAssignmentRhs feature) {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
protected boolean _isLeaf(final EnumEntry feature) {
|
||
|
int _size = feature.getProperties().size();
|
||
|
return (_size == 0);
|
||
|
}
|
||
|
}
|