use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class XSDSimpleTypeEditPart method createConnectionFigure.
public TypeReferenceConnection createConnectionFigure() {
TypeReferenceConnection connectionFigure = null;
XSDSimpleTypeDefinitionAdapter adapter = (XSDSimpleTypeDefinitionAdapter) getModel();
IType superType = adapter.getSuperType();
if (superType != null) {
AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getTargetEditPart(superType);
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 TopLevelFieldEditPart method createConnectionFigure.
public TypeReferenceConnection createConnectionFigure() {
TypeReferenceConnection connectionFigure = null;
IField field = (IField) getModel();
IType type = field.getType();
if (type != null) {
AbstractGraphicalEditPart referenceTypePart = (AbstractGraphicalEditPart) getViewer().getEditPartRegistry().get(type);
if (referenceTypePart != null) {
connectionFigure = new TypeReferenceConnection();
connectionFigure.setSourceAnchor(new CenteredConnectionAnchor(getFigure(), CenteredConnectionAnchor.RIGHT, 0));
int targetAnchorYOffset = 12;
connectionFigure.setTargetAnchor(new CenteredConnectionAnchor(referenceTypePart.getFigure(), CenteredConnectionAnchor.HEADER_LEFT, 0, targetAnchorYOffset));
connectionFigure.setHighlight(false);
}
}
return connectionFigure;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class TopLevelFieldEditPart method shouldDrawConnection.
protected boolean shouldDrawConnection() {
IField field = (IField) getModel();
IType type = field.getType();
return (type != null);
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class ReferencedTypeColumn method getChildren.
public List getChildren() {
List result = new ArrayList();
if (model instanceof IStructure) {
IStructure structure = (IStructure) model;
for (Iterator i = structure.getFields().iterator(); i.hasNext(); ) {
IField field = (IField) i.next();
IType type = field.getType();
if (// && type.isComplexType())
type != null) {
if (!result.contains(type)) {
if (type instanceof IGraphElement) {
if (((IGraphElement) type).isFocusAllowed())
result.add(type);
}
}
}
}
} else if (model instanceof IField) {
IField field = (IField) model;
IType type = field.getType();
if (// && type.isComplexType())
type != null) {
if (type instanceof IGraphElement) {
if (((IGraphElement) type).isFocusAllowed())
result.add(type);
}
}
}
return result;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IType in project webtools.sourceediting by eclipse.
the class BaseFieldEditPart method getTargetConnectionEditPart.
private EditPart getTargetConnectionEditPart() {
EditPart result = null;
IField field = (IField) getModel();
IType type = field.getType();
if (type != null) {
// getTargetEditPart(type);
result = getTargetEP(type);
}
return result;
}
Aggregations