use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class ComplexTypeEditPart method createConnectionFigure.
public TypeReferenceConnection createConnectionFigure() {
connectionFigure = null;
IComplexType complexType = (IComplexType) getModel();
IType type = complexType.getSuperType();
if (type != null) {
AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getTargetEditPart(type);
if (referenceTypePart != null) {
connectionFigure = new TypeReferenceConnection(true);
// draw a line out from the top
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.TOP, 1));
// TODO (cs) need to draw the target anchor to look like a UML inheritance relationship
// adding a label to the connection would help to
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.BOTTOM, 0, 0));
connectionFigure.setConnectionRouter(new ManhattanConnectionRouter());
((CenteredConnectionAnchor) connectionFigure.getSourceAnchor()).setOther((CenteredConnectionAnchor) connectionFigure.getTargetAnchor());
connectionFigure.setHighlight(false);
}
}
return connectionFigure;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class FocusTypeColumn method getChildren.
public List getChildren() {
List result = new ArrayList();
if (model instanceof IType) {
IType type = (IType) model;
if (type.getSuperType() != null) {
result.add(type.getSuperType());
}
result.add(type);
} else if (model instanceof IField || model instanceof IStructure) {
result.add(model);
}
return result;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class RootContentEditPart method getModelChildren.
protected List getModelChildren() {
collections = new ArrayList();
if (getModel() != null) {
Object obj = getModel();
IADTObject focusObject = null;
if (obj instanceof IStructure) {
if (obj instanceof IGraphElement) {
if (((IGraphElement) obj).isFocusAllowed())
focusObject = (IStructure) obj;
}
} else if (obj instanceof IField) {
focusObject = (IField) obj;
} else if (obj instanceof IModel) {
focusObject = (IModel) obj;
collections.add(focusObject);
return collections;
} else if (obj instanceof IType) {
if (obj instanceof IGraphElement) {
if (((IGraphElement) obj).isFocusAllowed()) {
focusObject = (IType) obj;
}
}
} else if (obj instanceof IGraphElement) {
if (((IGraphElement) obj).isFocusAllowed()) {
focusObject = (IADTObject) obj;
collections.add(focusObject);
return collections;
}
}
if (focusObject != null) {
RootHolder holder = new RootHolder(focusObject);
collections.add(holder);
return collections;
}
}
return collections;
}
Aggregations