mirror of https://github.com/Minres/RDL-Editor.git
119 lines
4.6 KiB
Java
119 lines
4.6 KiB
Java
/**
|
|
* generated by Xtext 2.14.0
|
|
*/
|
|
package com.minres.rdl.ui.outline;
|
|
|
|
import com.minres.rdl.rdl.ComponentDefinition;
|
|
import com.minres.rdl.rdl.ComponentInstance;
|
|
import com.minres.rdl.rdl.EnumDefinition;
|
|
import com.minres.rdl.rdl.EnumEntry;
|
|
import com.minres.rdl.rdl.ExplicitPropertyAssignment;
|
|
import com.minres.rdl.rdl.Instantiation;
|
|
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<Instantiation> _function_4 = (Instantiation instantiation) -> {
|
|
ComponentDefinition _component = instantiation.getComponent();
|
|
boolean _tripleNotEquals = (_component != null);
|
|
if (_tripleNotEquals) {
|
|
this.createNode(parentNode, instantiation.getComponent());
|
|
}
|
|
final Consumer<ComponentInstance> _function_5 = (ComponentInstance it) -> {
|
|
this.createNode(parentNode, it);
|
|
};
|
|
instantiation.getComponentInstances().forEach(_function_5);
|
|
};
|
|
domainModel.getInstantiations().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<Instantiation> _function_3 = (Instantiation instantiation) -> {
|
|
ComponentDefinition _component = instantiation.getComponent();
|
|
boolean _tripleNotEquals = (_component != null);
|
|
if (_tripleNotEquals) {
|
|
this.createNode(parentNode, instantiation.getComponent());
|
|
}
|
|
final Consumer<ComponentInstance> _function_4 = (ComponentInstance it) -> {
|
|
this.createNode(parentNode, it);
|
|
};
|
|
instantiation.getComponentInstances().forEach(_function_4);
|
|
};
|
|
compDef.getInstantiations().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 Instantiation feature) {
|
|
return ((feature.getComponent() == null) && (feature.getComponentInstances().size() == 0));
|
|
}
|
|
|
|
protected boolean _isLeaf(final PropertyAssignmentRhs feature) {
|
|
return true;
|
|
}
|
|
|
|
protected boolean _isLeaf(final ComponentInstance feature) {
|
|
return true;
|
|
}
|
|
|
|
protected boolean _isLeaf(final EnumEntry feature) {
|
|
int _size = feature.getProperties().size();
|
|
return (_size == 0);
|
|
}
|
|
}
|