Skip to content

Commit

Permalink
Restore active part in each part stack (eclipse-che#4805)
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Zatsarynnyi <azatsarynnyy@codenvy.com>
  • Loading branch information
azatsarynnyy authored Apr 14, 2017
1 parent 3a3fa5f commit 0a926e6
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ public void loadState(@NotNull JsonObject state) {
}
}

// restore perspective's active part
if (state.hasKey("ACTIVE_PART")) {
String activePart = state.getString("ACTIVE_PART");
Provider<PartPresenter> provider = dynaProvider.getProvider(activePart);
Expand Down Expand Up @@ -387,6 +388,15 @@ private void restorePartController(PartStack partStack, WorkBenchPartController
}
}

// restore part stack's active part
if (partStackJSON.hasKey("ACTIVE_PART")) {
String activePart = partStackJSON.getString("ACTIVE_PART");
Provider<PartPresenter> provider = dynaProvider.getProvider(activePart);
if (provider != null) {
partStack.setActivePart(provider.get());
}
}

//hide part stack if it has no parts
if (partStack.getParts().isEmpty()) {
controller.setHidden(true);
Expand Down

0 comments on commit 0a926e6

Please sign in to comment.