diff --git a/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/CopyPerspectiveSnippetProcessor.java b/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/CopyPerspectiveSnippetProcessor.java index 0f77d822e1..9ca5de066e 100644 --- a/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/CopyPerspectiveSnippetProcessor.java +++ b/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/CopyPerspectiveSnippetProcessor.java @@ -89,14 +89,15 @@ public void execute(MApplication app, EModelService modelService, EPartService p // clone each snippet that is a perspective and add the cloned // perspective into the main PerspectiveStack - boolean isFirst = true; for (MPerspective perspective : perspectivesProvider.getInitialPerspectives()) { perspectiveStack.getChildren().add(perspective); - if (isFirst) { + + // set default (welcome) perspective + if (perspective.getElementId().equals(perspectivesProvider.getDefaultPerspectiveId())) { perspectiveStack.setSelectedElement(perspective); - isFirst = false; } + subscribeChangedElement(broker, perspective); subscribeSelectedPerspective(broker, perspective); } diff --git a/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/PerspectivesProvider.java b/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/PerspectivesProvider.java index 9d3b5c293d..f3de953ac0 100644 --- a/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/PerspectivesProvider.java +++ b/base/uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/src/uk/ac/stfc/isis/ibex/e4/ui/perspectiveswitcher/PerspectivesProvider.java @@ -30,7 +30,8 @@ public class PerspectivesProvider { private EModelService modelService; private static final String MAIN_PERSPECTIVE_STACK_ID = "uk.ac.stfc.isis.ibex.client.e4.product.perspectivestack.0"; - + private static final String DEFAULT_PERSPECTIVE_ID = "uk.ac.stfc.isis.ibex.client.e4.product.perspective.weblinks"; + /** * Instantiates the class and initialises the internal perspective list with * all perspectives found in the application model. @@ -126,6 +127,13 @@ public List getInitialPerspectives() { } return perspectives; } + + /** + * @return the default perspective id (usually displayed on launch as landing page) + */ + public String getDefaultPerspectiveId() { + return DEFAULT_PERSPECTIVE_ID; + } /** * Switches to a given perspective by id.