Skip to content
Snippets Groups Projects
Commit 6eeb5f2d authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

enriching the library functionality

refs 1565
parent 1a17fda4
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,12 @@ public class ModelElementLibraryService implements ILibraryService {
ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(ref);
}
/** {@inheritDoc} */
@Override
public void ensureChildrenLibraryReferenceAreUpToDate(EObject context) {
ILibraryService.INSTANCE.ensureChildrenLibraryReferenceAreUpToDate(context);
}
/** {@inheritDoc} */
@Override
public void addElementToLibrary(ILibraryPackage pack, EObject obj) {
......
......@@ -17,6 +17,7 @@ $Id: PersistencyService.java 5274 2012-08-02 07:54:11Z mou $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.internal;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
......@@ -216,6 +217,16 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl
}
}
/** {@inheritDoc} */
@Override
public void ensureChildrenLibraryReferenceAreUpToDate(EObject context) {
EList<ILibraryElementReference> libReferences;
libReferences = getChildrenWithType(context, ILibraryElementReference.class);
for(ILibraryElementReference ref : libReferences) {
ensureWrappedElementIsUpToDate(ref);
}
}
/** {@inheritDoc} */
@Override
public void addElementToLibrary(final ILibraryPackage pack, final EObject namedElement) {
......
......@@ -70,6 +70,9 @@ public interface ILibraryService {
/** Ensures that the wrapped model element behind this reference is up to date. */
public void ensureWrappedElementIsUpToDate(final ILibraryElementReference ref);
/** Ensures that all children objects that reference library elements are up to date. */
public void ensureChildrenLibraryReferenceAreUpToDate(final EObject context);
/** Adds an element to the library in a given library package. */
public void addElementToLibrary(final ILibraryPackage pack, final EObject obj);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment