Repository: isis Updated Branches: refs/heads/maint-1.13.1 43a2bd58d -> 5df58cbd3
ISIS-1518: added option to disable breadcrumb selector Project: http://git-wip-us.apache.org/repos/asf/isis/repo Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/4696b85e Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/4696b85e Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/4696b85e Branch: refs/heads/maint-1.13.1 Commit: 4696b85ea0f07eb1ce6990fe345d5be3bc0b64c6 Parents: 43a2bd5 Author: bibryam <red2KIDS> Authored: Mon Oct 17 11:15:43 2016 +0100 Committer: Dan Haywood <d...@haywood-associates.co.uk> Committed: Wed Oct 26 15:38:51 2016 +0100 ---------------------------------------------------------------------- .../widgets/breadcrumbs/BreadcrumbModel.java | 1 - .../widgets/breadcrumbs/BreadcrumbPanel.java | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/isis/blob/4696b85e/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbModel.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbModel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbModel.java index 8311498..637e232 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbModel.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbModel.java @@ -128,7 +128,6 @@ public class BreadcrumbModel implements Serializable { } - void remove(final String rootOid) { final EntityModel existingModel = entityModelByOidStr.get(rootOid); if(existingModel != null) { http://git-wip-us.apache.org/repos/asf/isis/blob/4696b85e/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbPanel.java ---------------------------------------------------------------------- diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbPanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbPanel.java index 07be860..6fa1496 100644 --- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbPanel.java +++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/breadcrumbs/BreadcrumbPanel.java @@ -23,6 +23,7 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import org.apache.isis.core.commons.config.IsisConfiguration; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.model.IModel; @@ -43,6 +44,11 @@ public class BreadcrumbPanel extends PanelAbstract<IModel<Void>> { private static final long serialVersionUID = 1L; private static final String ID_BREADCRUMBS = "breadcrumbs"; + /** + * A configuration setting which value determines whether the breadcrumbs should be available in the footer + */ + private static final String SHOW_BREADCRUMBS_KEY = "isis.viewer.wicket.breadcrumbs.showChooser"; + private static final boolean SHOW_BREADCRUMBS_DEFAULT = true; public BreadcrumbPanel(String id) { super(id); @@ -122,5 +128,15 @@ public class BreadcrumbPanel extends PanelAbstract<IModel<Void>> { addOrReplace(breadcrumbChoice); } - + @Override + protected void onConfigure() { + super.onConfigure(); + + boolean shouldShow = getConfiguration().getBoolean(SHOW_BREADCRUMBS_KEY, SHOW_BREADCRUMBS_DEFAULT); + setVisible(shouldShow); + } + + private IsisConfiguration getConfiguration() { + return getIsisSessionFactory().getConfiguration(); + } }