use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class BaseFieldEditPart method performRequest.
public void performRequest(Request request) {
if (((IADTObject) getModel()).isReadOnly() || isFileReadOnly()) {
return;
}
if (request.getType() == RequestConstants.REQ_DIRECT_EDIT || request.getType() == RequestConstants.REQ_OPEN) {
IFieldFigure fieldFigure = getFieldFigure();
Object model = getModel();
if (request instanceof LocationRequest) {
LocationRequest locationRequest = (LocationRequest) request;
Point p = locationRequest.getLocation();
if (hitTest(fieldFigure.getTypeLabel(), p)) {
TypeReferenceDirectEditManager manager = new TypeReferenceDirectEditManager((IField) model, this, fieldFigure.getTypeLabel());
TypeUpdateCommand typeUpdateCommand = new TypeUpdateCommand();
typeUpdateCommand.setDelegate(manager);
adtDirectEditPolicy.setUpdateCommand(typeUpdateCommand);
manager.show();
} else if (hitTest(fieldFigure.getNameLabel(), p)) {
directEditNameField();
}
} else {
directEditNameField();
}
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class BaseEditPart method activate.
public void activate() {
super.activate();
Object model = getModel();
if (model instanceof IADTObject) {
IADTObject object = (IADTObject) model;
object.registerListener(this);
}
if (getZoomManager() != null)
getZoomManager().addZoomListener(zoomListener);
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject 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