Commit 6724c773 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Navigator: Show Projects after startup.

* Since migrating to Photon, the listeners of the IPersistencyService
  must be seemingly installed in the init phase. By that, the
  corresponding listeners are also aware of model loading.
* Also, remove an unneeded cast to avoid a warning.

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

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent 1272f13f
......@@ -7,6 +7,6 @@ EditPartFactoryService.java e9180c0020f1769d9e24ef3c08f9ca5599dbc5c3 GREEN
MarkerService.java b01b7706034691683df7bbc2e7828c42574b3147 GREEN
ModelEditorBindingService.java 4c2b52008025db79b1ced4b695d60b561d17c51e GREEN
ModelElementHandlerService.java 07a30545ad687ff0fe13bf7a9348c41fb03e0b2c GREEN
NavigatorService.java 8ba9cec9ee7b3a73a47303575df917f47f2f7754 GREEN
NavigatorService.java 2b1361eac805996e22e5409dafff9707fbac3376 YELLOW
ToolingKernelUIInternal.java 38903445a9084b7908716a00f41621dfb3126fca GREEN
TutorialUIService.java b1d632eca91b4feb583f3930cd6ee4722dd9bfed GREEN
......@@ -94,7 +94,7 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
/** Initializes the service. */
public void initializeService() {
// nothing to do here
IPersistencyService.getInstance().addTopLevelElementListener(this);
}
/** Starts the service. */
......@@ -103,7 +103,6 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
ICommandStackService.getInstance().addCommandStackListener(element, this);
saveables.put(element, new TopLevelElementSaveable(element));
}
IPersistencyService.getInstance().addTopLevelElementListener(this);
ITutorialService.getInstance().addTutorialServiceListener(this);
}
......@@ -154,12 +153,17 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
/** {@inheritDoc} */
@Override
public void topLevelElementLoaded(ITopLevelElement element) {
// ignore
addTopLevelElementScheduled(element);
}
/** {@inheritDoc} */
@Override
public void topLevelElementAdded(final ITopLevelElement element) {
addTopLevelElementScheduled(element);
}
/** Adds the given {@link ITopLevelElement} to the Navigator and updates the view. */
private void addTopLevelElementScheduled(final ITopLevelElement element) {
new UIJob("NavigatorServiceSafeableRefresh") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
......@@ -328,8 +332,8 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
private void saveablesChanged(int event, ITopLevelElement element, boolean force) {
Saveable saveable = saveables.get(element);
if(saveable != null && navigatorViewPart != null) {
ISaveablesLifecycleListener listener = (ISaveablesLifecycleListener)PlatformUI
.getWorkbench().getService(ISaveablesLifecycleListener.class);
ISaveablesLifecycleListener listener =
PlatformUI.getWorkbench().getService(ISaveablesLifecycleListener.class);
SaveablesLifecycleEvent eventObj = new SaveablesLifecycleEvent(navigatorViewPart, event,
new Saveable[] {saveable}, force);
listener.handleLifecycleEvent(eventObj);
......
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