use of org.obeonetwork.dsl.environment.ObeoDSMObject in project InformationSystem by ObeoNetwork.
the class LabelProvider method getNameFeatureValue.
public static String getNameFeatureValue(ObeoDSMObject dsmObject) {
EStructuralFeature nameFeature = dsmObject.eClass().getEStructuralFeature("name");
Object nameValue = dsmObject.eGet(nameFeature);
if (nameValue != null && nameValue instanceof String) {
return (String) nameValue;
}
return null;
}
use of org.obeonetwork.dsl.environment.ObeoDSMObject in project InformationSystem by ObeoNetwork.
the class DocumentationLinkType method loadLinks.
/**
* {@inheritDoc}
* @see org.obeonetwork.tools.linker.LinkType#loadLinks(org.eclipse.emf.ecore.EObject)
*/
public List<EObjectLink> loadLinks(EObject source) {
if (source instanceof ObeoDSMObject) {
ObeoDSMObject element = (ObeoDSMObject) source;
MetaDataContainer metadatas = element.getMetadatas();
if (metadatas != null) {
List<EObjectLink> result = new ArrayList<EObjectLink>();
for (MetaData metadata : metadatas.getMetadatas()) {
if (metadata instanceof Annotation) {
Annotation annotation = (Annotation) metadata;
if (annotation.getTitle() != null && annotation.getTitle().startsWith(DocumentationLink.DOCUMENTATION_ANNOTATION_TITLE)) {
DocumentationLink link = new DocumentationLinkImpl(annotation);
result.add(link);
}
}
}
return result;
}
}
return Collections.emptyList();
}
use of org.obeonetwork.dsl.environment.ObeoDSMObject in project InformationSystem by ObeoNetwork.
the class VersionPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ObeoDSMObject obeoDSMObject = (ObeoDSMObject) elt;
final VersionPropertiesEditionPart versionPart = (VersionPropertiesEditionPart) editingPart;
if (isAccessible(GraalextensionsViewsRepository.Version.Properties.version_)) {
versionPart.setVersion(obeoDSMObject.getVersion());
}
if (isAccessible(GraalextensionsViewsRepository.Version.Properties.createdOn))
versionPart.setCreatedOn(EEFConverterUtil.convertToString(EcorePackage.Literals.EDATE, obeoDSMObject.getCreatedOn()));
if (isAccessible(GraalextensionsViewsRepository.Version.Properties.modifiedOn))
versionPart.setModifiedOn(EEFConverterUtil.convertToString(EcorePackage.Literals.EDATE, obeoDSMObject.getModifiedOn()));
// init filters
// Start of user code for version filter update
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (obeoDSMObject.getModifiedOn() != null && isAccessible(GraalextensionsViewsRepository.Version.Properties.modifiedOn))
versionPart.setModifiedOn(simpleDateFormat.format(obeoDSMObject.getModifiedOn()));
if (obeoDSMObject.getCreatedOn() != null && isAccessible(GraalextensionsViewsRepository.Version.Properties.createdOn))
versionPart.setCreatedOn(simpleDateFormat.format(obeoDSMObject.getCreatedOn()));
// End of user code
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.environment.ObeoDSMObject in project InformationSystem by ObeoNetwork.
the class TypesServices method getAllStructuredTypes.
public Collection<StructuredType> getAllStructuredTypes(EObject context, String typeName) {
Collection<StructuredType> types = new ArrayList<StructuredType>();
Collection<Resource> resources = ModelServices.getAllResources(context);
for (Resource resource : resources) {
for (EObject object : resource.getContents()) {
if (object instanceof ObeoDSMObject) {
types.addAll(internalGetAllChildrenStructuredTypes((ObeoDSMObject) object, typeName));
}
}
}
return types;
}
use of org.obeonetwork.dsl.environment.ObeoDSMObject in project InformationSystem by ObeoNetwork.
the class InteractionModelWizard method createInitialModel.
/**
* Create a new model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
protected EObject createInitialModel() {
EClass eClass = (EClass) interactionPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
EObject rootObject = interactionFactory.create(eClass);
if (rootObject instanceof ObeoDSMObject) {
((ObeoDSMObject) rootObject).setCreatedOn(new Date());
}
return rootObject;
}
Aggregations