use of org.obeonetwork.dsl.typeslibrary.TypesLibraryUser in project InformationSystem by ObeoNetwork.
the class TestIsLogical method test.
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (receiver instanceof StructuredSelection) {
StructuredSelection selection = (StructuredSelection) receiver;
if (selection.size() == 1) {
Object element = selection.getFirstElement();
Resource resource = (element instanceof Resource) ? ((Resource) element) : getResourceFromSession(getModelURI(element));
if (resource != null) {
if (resource.getContents() != null && resource.getContents().isEmpty() == false) {
EObject root = resource.getContents().get(0);
if (root instanceof TypesLibraryUser) {
return ScaffoldingUtils.isValidInputForMld(root);
}
}
}
}
}
return false;
}
use of org.obeonetwork.dsl.typeslibrary.TypesLibraryUser in project InformationSystem by ObeoNetwork.
the class TypesServices method getPhysicalTypesLibrary.
public TypesLibrary getPhysicalTypesLibrary(DatabaseElement element) {
TypesLibraryUser tlu = getTypesLibraryUser(element);
TypesLibrary physicalTypesLibrary = getTargetPhysicalTypesLibrary(tlu);
return physicalTypesLibrary;
}
use of org.obeonetwork.dsl.typeslibrary.TypesLibraryUser in project InformationSystem by ObeoNetwork.
the class TypeInstanceItemProvider method getUsedNativeTypesLibraries.
protected Collection<NativeTypesLibrary> getUsedNativeTypesLibraries(Object object) {
final Collection<NativeTypesLibrary> nativeTypesLibraries = new ArrayList<NativeTypesLibrary>();
if (object instanceof EObject) {
EObject eObject = (EObject) object;
final TypesLibraryUser user = getTypesLibraryUserFromParents(eObject);
if (user != null && user.getUsedLibraries().isEmpty() == false) {
for (TypesLibrary library : user.getUsedLibraries()) {
if (library instanceof NativeTypesLibrary) {
nativeTypesLibraries.add((NativeTypesLibrary) library);
}
}
}
}
return nativeTypesLibraries;
}
Aggregations