Java Reference
In-Depth Information
private
Datatype findInPackage(org.eclipse.oocore.Package pkg,
String typeName) {
for
(PackageableElement element : pkg.getContents()) {
if
(element
instanceof
Datatype &&
typeName.equals(element.getName())) {
return
(Datatype) element;
}
if
(element
instanceof
org.eclipse.oocore.Package) {
return
findInPackage((org.eclipse.oocore.Package)
element, typeName);
}
}
return
null;
}
public
String getPrintString(IAdaptable element,
int
flags) {
String printString = getEditString(element, flags);
return
printString.length() == 0 ? "<<...>>" : printString;
}
public boolean
isAffectingEvent(Object event,
int
flags) {
if
(event
instanceof
Notification) {
Notification emfNotification = (Notification) event;
return
!emfNotification.isTouch()
&& (emfNotification.getFeature() ==
OocorePackage.eINSTANCE.getNamedElement_Name() ||
emfNotification.getFeature() ==
OocorePackage.eINSTANCE.getAttribute_DataType());
}
return
false;
}
public
IParserEditStatus isValidEditString(IAdaptable element,
String editString) {
return
ParserEditStatus.EDITABLE_STATUS;
}
private
Attribute getAttribute(IAdaptable adaptable) {
return
(Attribute) adaptable.getAdapter(EObject.
class
);
}
public boolean
areSemanticElementsAffected(EObject listener,
Object notification) {
if
(notification
instanceof
Notification) {
Notification emfNotification = (Notification) notification;
return
!emfNotification.isTouch()
&& (emfNotification.getFeature() ==
OocorePackage.eINSTANCE.getAttribute() ||
emfNotification.getFeature() ==
OocorePackage.eINSTANCE.getDatatype());
}
return
false;
}
Search WWH ::
Custom Search