Commit 68eaa5f4 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

PersistencyService: Add load listen method.

* The current implementation of the IPersistencyService does not
  allow to listen for "load" or "add" events during the startup of
  AF3 whereas later events for adding and removing IToplevelElements
  are present.
* Extend the PersistencyServiceListener and the IPersistencyService
  for such a capability to enable installing listeners for model
  elements in a plugin-in fashion.

Issue-Ref: 3514
Issue-Url: https://af3-developer.fortiss.org/issues/3514

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 83300555
AbstractNameEditingSupport.java c57336a0e0da18711a1610ca667dfea76728807f GREEN
ActionUtils.java f16dd179005f48c747d2c9cf250b05e7225495cf GREEN
ConstraintsBaseUIUtils.java 50c26b90a6ebe6c7f7861092dac5ebc1f3fc0ce3 GREEN
ConstraintsBaseUIUtils.java 27e9f5ada7b1838aa375d0e136409d9f22bd5ef7 YELLOW
DragAndDropBaseUtils.java 4308b2151a7075adeb4f7e7246859d421150415b GREEN
EllipseLayoutUIUtils.java 271e287f1e5befb03a9d115a98e22453056521e0 GREEN
FontUtils.java a167a05bdaa8da9853705cc5134f30f6d81bc9f2 GREEN
......
......@@ -229,6 +229,12 @@ public class ConstraintsBaseUIUtils {
private class ConstraintBasedDevelopmentProcessListener implements
IPersistencyServiceListener {
/** {@inheritDoc} */
@Override
public void topLevelElementLoaded(ITopLevelElement element) {
// ignore
}
/** {@inheritDoc} */
@Override
public void topLevelElementAdded(ITopLevelElement element) {
......
ActionService.java a25b4055124f9ef9bafda31d022c22b35f08d736 GREEN
ActionService.java e29126b5947c9fd2f1d82bb87001b9d0ead50c3b YELLOW
AllocationEditPartFactoryService.java 795fbae65ae3a61cd080888e613c3c91c1265151 GREEN
ConstraintLabelDecorator.java 6ce0b7a31e1f033e5b0a2fecde0da6f68d8787d0 GREEN
ConstraintUIService.java 3d3e2f49e117f13e235f403c562ef0dc3a188b76 GREEN
ContextMenuService.java 240c860feb7246427ed62096af01fd7d9275cdf1 GREEN
EditPartFactoryService.java e23ecf38cac145540d5dd30d2be820794a45397e GREEN
MarkerService.java 69b8426feb577da5db8477f0179508b14becac2d GREEN
MarkerService.java 0c24285bfde05aea3ac27a31099885a18bf85f14 YELLOW
ModelEditorBindingService.java ce63dd6ed8c244fe13f1ca6e071e14f7f8b09cd7 GREEN
ModelElementHandlerService.java 1eb55dcbe656377f28055713fec83fb6ff0137ab GREEN
NavigatorService.java 546a8417487f1f3dca9a53e5a5c28ed8b8c0a869 GREEN
NavigatorService.java e18ba261ef21a39065371e15ce4f03e980b23f68 YELLOW
ToolingKernelUIInternal.java 38903445a9084b7908716a00f41621dfb3126fca GREEN
TutorialUIService.java c2e5dd68ac985dbbcc337b6cb51b6342f1cca78f GREEN
......@@ -206,6 +206,12 @@ public class ActionService implements IActionService, IPersistencyServiceListene
refresh();
}
/** {@inheritDoc} */
@Override
public void topLevelElementLoaded(ITopLevelElement element) {
// ignore
}
/** {@inheritDoc} */
@Override
public void topLevelElementAdded(ITopLevelElement element) {
......
......@@ -202,6 +202,12 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene
updateUI.schedule();
}
/** {@inheritDoc} */
@Override
public void topLevelElementLoaded(ITopLevelElement element) {
// ignore
}
/** {@inheritDoc} */
@Override
public void topLevelElementAdded(ITopLevelElement element) {
......
......@@ -139,6 +139,12 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
return navigatorViewPart.getSite().getSelectionProvider().getSelection();
}
/** {@inheritDoc} */
@Override
public void topLevelElementLoaded(ITopLevelElement element) {
// ignore
}
/** {@inheritDoc} */
@Override
public void topLevelElementAdded(final ITopLevelElement element) {
......
......@@ -8,7 +8,7 @@ LibraryPrototypeProvider.java 357a04fa68b83e71d1af9809653139b5a9a320ac GREEN
LibraryService.java d22671ba820466062852c15873698adf28960d94 GREEN
LoggingService.java c77e48deb577683ba67f181f026f772b4dcf635e GREEN
MigrationService.java d5ef6b1b3aeaccc94e041fb73f4bbe40234071b4 GREEN
PersistencyService.java 7937f159810fb5088182a9b6ccd76c6da5a7b585 GREEN
PersistencyService.java 5ec2db69db895aebc54705c264fa4506b22b1287 YELLOW
PrototypeService.java a2c5026f4c7693623efd6ffadd9284248e49e243 GREEN
ToolingKernelInternal.java efd435f8c39e072fa9ec422deefff23d95607d25 GREEN
TransformationService.java a6e103e3a65ec885d6b608978123adf80a7379c0 GREEN
......
......@@ -128,6 +128,7 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe
for(ITopLevelElement context : provider.getTopLevelElements()) {
elementCache.add(context);
storageProviderCache.put(context, provider);
notifyListenersAboutLoad(context);
}
}
......@@ -243,6 +244,13 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe
listeners.remove(listener);
}
/** Notifies listener about top-level element loading (startup). */
private synchronized void notifyListenersAboutLoad(ITopLevelElement top) {
for(IPersistencyServiceListener listener : listeners) {
listener.topLevelElementLoaded(top);
}
}
/** Notifies listener about top-level element adding. */
private synchronized void notifyListenersAboutAdd(ITopLevelElement top) {
for(IPersistencyServiceListener listener : listeners) {
......
IPersistencyServiceListener.java 529da8b57ba65f102d590dda044e527ea026c346 GREEN
IPersistencyServiceListener.java 54386c1fabdd0814e0924c2dbec936fde19f62c3 YELLOW
ITutorialServiceListener.java dc67ae890f054c90920515291c5894661f2c4a1c GREEN
......@@ -27,6 +27,12 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
*/
public interface IPersistencyServiceListener {
/**
* Notifies the listener that the given element just was loaded by the
* persistency service (during startup).
*/
void topLevelElementLoaded(ITopLevelElement element);
/**
* Notifies the listener that the given element just appeared in the
* persistency service.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment