use of org.eclipse.che.ide.api.parts.PartPresenter in project che by eclipse.
the class AbstractPerspective method loadState.
@Override
public void loadState(@NotNull JsonObject state) {
if (state.hasKey("PART_STACKS")) {
JsonObject part_stacks = state.getObject("PART_STACKS");
for (String partStackType : part_stacks.keys()) {
JsonObject partStack = part_stacks.getObject(partStackType);
switch(PartStackType.valueOf(partStackType)) {
case INFORMATION:
restorePartController(partStacks.get(INFORMATION), belowPartController, partStack);
break;
case NAVIGATION:
restorePartController(partStacks.get(NAVIGATION), leftPartController, partStack);
break;
case TOOLING:
restorePartController(partStacks.get(TOOLING), rightPartController, partStack);
break;
}
}
}
if (state.hasKey("ACTIVE_PART")) {
String activePart = state.getString("ACTIVE_PART");
Provider<PartPresenter> provider = dynaProvider.getProvider(activePart);
if (provider != null) {
setActivePart(provider.get());
}
}
}
Aggregations