Skip to content
Snippets Groups Projects
Commit ca5a8567 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Navigator service can now reveal arbitrary elements on refresh (currently non-public API).

refs 2567
parent 37bf269f
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,13 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
}
}
/** Refreshes the viewer and reveals the given element. */
public void refreshAndReveal(Object element) {
if(navigatorViewPart != null) {
navigatorViewPart.refreshAndReveal(element);
}
}
/** {@inheritDoc} */
@Override
public Saveable[] getSaveables() {
......@@ -305,8 +312,7 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL
/** {@inheritDoc} */
@Override
public void tutorialStarted(ITutorialProvider provider) {
refresh();
navigatorViewPart.revealModelElement(provider.getDefinition().getSteps().get(0));
refreshAndReveal(ITutorialService.INSTANCE.getActiveTutorial().getDefinition());
}
/** {@inheritDoc} */
......
......@@ -111,6 +111,8 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe
/** Element used to ensure that the selection of the {@link NavigatorViewPart} is not empty. */
private EObject backupElementToBeSelected;
/** Element to be revealed during the UI update. */
private Object elementToBeRevealed = null;
/** Stores the UI update job. */
private final UIJob updateUI = new UIJob("Update Model Navigator") {
......@@ -144,6 +146,11 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe
backupElementToBeSelected = null;
}
if(elementToBeRevealed != null) {
revealModelElement(elementToBeRevealed);
elementToBeRevealed = null;
}
firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY);
return Status.OK_STATUS;
}
......@@ -416,4 +423,10 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe
toggleLibraryViewAction.setChecked(true);
}
}
/** Refreshes the viewer and reveals the given element. */
public void refreshAndReveal(Object element) {
elementToBeRevealed = element;
refresh();
}
}
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