You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/08/23 13:22:30 UTC
[2/2] git commit: ISIS-500: making EntityIconAndTitlePanel easier to
subclass
ISIS-500: making EntityIconAndTitlePanel easier to subclass
in addition:
* removed some unused ComponentFactory's
* added in example css in a ToDo app's application.css to demonstrate how to hide the icon
* make some demo code in QuickStartApplication easier to enable
* renamed PageRegistrySpi -> PageClassRegistrySpi
* added example override of PageClassList
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/58aff6aa
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/58aff6aa
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/58aff6aa
Branch: refs/heads/master
Commit: 58aff6aa393e69c46aa9b7524d27776869d4f374
Parents: 1f62a90
Author: Dan Haywood <da...@apache.org>
Authored: Fri Aug 23 11:57:59 2013 +0100
Committer: Dan Haywood <da...@apache.org>
Committed: Fri Aug 23 11:57:59 2013 +0100
----------------------------------------------------------------------
.../viewer/wicket/viewer/IsisWicketModule.java | 3 +-
.../ComponentFactoryRegistrarDefault.java | 9 --
.../registries/pages/PageClassListDefault.java | 4 +-
.../pages/PageClassRegistryDefault.java | 4 +-
.../PageClassListDefault_Instantiation.java | 4 +-
.../CollectionContentsDropDownSelectorPanel.css | 21 ----
...CollectionContentsDropDownSelectorPanel.html | 31 -----
...CollectionContentsDropDownSelectorPanel.java | 48 --------
...ionContentsDropDownSelectorPanelFactory.java | 56 ---------
...ectionContentsLinksSelectorPanelFactory.java | 1 -
.../icontitle/EntityIconAndTitlePanel.java | 47 ++++---
.../dropdown/EntityDropDownSelectorPanel.css | 21 ----
.../dropdown/EntityDropDownSelectorPanel.html | 31 -----
.../dropdown/EntityDropDownSelectorPanel.java | 47 -------
.../EntityDropDownSelectorPanelFactory.java | 51 --------
.../links/EntityLinksSelectorPanelFactory.java | 1 -
.../viewer/wicket/ui/pages/PageClassList.java | 2 +-
.../wicket/ui/pages/PageClassRegistrySpi.java | 33 +++++
.../viewer/wicket/ui/pages/PageRegistrySpi.java | 33 -----
.../DropDownChoiceComponentFactory.java | 95 --------------
.../dropdown/DropDownSelectorPanelAbstract.css | 21 ----
.../dropdown/DropDownSelectorPanelAbstract.html | 34 -----
.../dropdown/DropDownSelectorPanelAbstract.java | 123 -------------------
.../java/app/PageClassListForQuickstart.java | 61 +++++++++
.../main/java/app/QuickStartApplication.java | 68 ++++++----
.../webapp/src/main/webapp/css/application.css | 19 +++
26 files changed, 192 insertions(+), 676 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
index 971a7d0..8f00317 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketModule.java
@@ -46,7 +46,8 @@ import org.apache.isis.viewer.wicket.viewer.settings.WicketViewerSettingsDefault
* @Override
* protected void configure() {
* bind(ComponentFactoryRegistrar.class).to(ComponentFactoryRegistrarForMyApp.class);
- *
+ * bind(PageClassList.class).to(PageClassListForMyApp.class);
+ * ...
* bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("My App");
* bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("application.css");
* bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("application.js");
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
index 168ff0b..f6bec25 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/components/ComponentFactoryRegistrarDefault.java
@@ -34,8 +34,6 @@ import org.apache.isis.viewer.wicket.ui.components.appactions.cssmenu.AppActions
import org.apache.isis.viewer.wicket.ui.components.bookmarkedpages.BookmarkedPagesPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.collection.CollectionPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsAsAjaxTablePanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.icons.CollectionContentsAsIconsPanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.dropdown.CollectionContentsDropDownSelectorPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.links.CollectionContentsLinksSelectorPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.summary.CollectionContentsAsSummaryFactory;
import org.apache.isis.viewer.wicket.ui.components.collectioncontents.unresolved.CollectionContentsAsUnresolvedPanelFactory;
@@ -45,7 +43,6 @@ import org.apache.isis.viewer.wicket.ui.components.entity.combined.EntityCombine
import org.apache.isis.viewer.wicket.ui.components.entity.header.EntityHeaderPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconAndTitlePanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.properties.EntityPropertiesPanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.entity.selector.dropdown.EntityDropDownSelectorPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.entity.selector.links.EntityLinksSelectorPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.scalars.isisapplib.IsisBlobPanelFactory;
import org.apache.isis.viewer.wicket.ui.components.scalars.isisapplib.IsisClobPanelFactory;
@@ -117,12 +114,6 @@ public class ComponentFactoryRegistrarDefault implements ComponentFactoryRegistr
componentFactories.add(new CollectionContentsLinksSelectorPanelFactory());
}
- @SuppressWarnings("unused")
- private void addDropDownSelectorFactories(final ComponentFactoryList componentFactories) {
- componentFactories.add(new EntityDropDownSelectorPanelFactory());
- componentFactories.add(new CollectionContentsDropDownSelectorPanelFactory());
- }
-
protected void addComponentFactoriesUsingServiceLoader(final ComponentFactoryList componentFactories) {
final ServiceLoader<ComponentFactory> serviceLoader = ServiceLoader.load(ComponentFactory.class);
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
index 1254004..b057b3f 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassListDefault.java
@@ -25,7 +25,7 @@ import org.apache.wicket.Page;
import org.apache.isis.viewer.wicket.model.models.PageType;
import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
-import org.apache.isis.viewer.wicket.ui.pages.PageRegistrySpi;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistrySpi;
import org.apache.isis.viewer.wicket.ui.pages.about.AboutPage;
import org.apache.isis.viewer.wicket.ui.pages.action.ActionPage;
import org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage;
@@ -40,7 +40,7 @@ import org.apache.isis.viewer.wicket.ui.pages.login.WicketSignInPage;
public class PageClassListDefault implements PageClassList {
@Override
- public void registerPages(final PageRegistrySpi pageRegistry) {
+ public void registerPages(final PageClassRegistrySpi pageRegistry) {
pageRegistry.registerPage(PageType.SIGN_IN, getSignInPageClass());
pageRegistry.registerPage(PageType.ABOUT, getAboutPageClass());
pageRegistry.registerPage(PageType.ENTITY, getEntityPageClass());
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java
index d3640cb..8437e56 100644
--- a/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java
+++ b/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/registries/pages/PageClassRegistryDefault.java
@@ -30,14 +30,14 @@ import org.apache.wicket.Page;
import org.apache.isis.viewer.wicket.model.models.PageType;
import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
-import org.apache.isis.viewer.wicket.ui.pages.PageRegistrySpi;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistrySpi;
/**
* Default implementation of {@link PageClassRegistry}; just delegates to an
* underlying {@link PageClassList}.
*/
@Singleton
-public class PageClassRegistryDefault implements PageClassRegistry, PageRegistrySpi {
+public class PageClassRegistryDefault implements PageClassRegistry, PageClassRegistrySpi {
private final Map<PageType, Class<? extends Page>> pagesByType = Maps.newHashMap();
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/impl/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java b/component/viewer/wicket/impl/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
index 87d304f..4861d62 100644
--- a/component/viewer/wicket/impl/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
+++ b/component/viewer/wicket/impl/src/test/java/org/apache/isis/viewer/wicket/viewer/pages/PageClassListDefault_Instantiation.java
@@ -29,7 +29,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
-import org.apache.isis.viewer.wicket.ui.pages.PageRegistrySpi;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistrySpi;
import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassRegistryDefault;
@@ -60,7 +60,7 @@ public class PageClassListDefault_Instantiation {
final PageClassList mockPageClassList = context.mock(PageClassList.class);
context.checking(new Expectations() {
{
- mockPageClassList.registerPages(with(any(PageRegistrySpi.class)));
+ mockPageClassList.registerPages(with(any(PageClassRegistrySpi.class)));
}
});
new PageClassRegistryDefault(mockPageClassList);
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.css
deleted file mode 100644
index 2a48bfd..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.collectionContentsDropDownSelectorPanel select {
- margin-bottom: 1em;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.html
deleted file mode 100644
index ad7b4f0..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
- xml:lang="en"
- lang="en">
- <head></head>
- <body>
- <wicket:extend>
- <div wicket:id="collectionContents" class="collectionContentsDropDownSelectorPanel collectionContentsComponentType"></div>
- </wicket:extend>
- </body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.java
deleted file mode 100644
index df1b3ae..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanel.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.dropdown;
-
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.selector.dropdown.DropDownSelectorPanelAbstract;
-
-/**
- * Provides a drop-down for selecting other views that support
- * {@link ComponentType#COLLECTION_CONTENTS} with a backing
- * {@link EntityCollectionModel}.
- *
- * <p>
- * Most of the heavy lifting is factored out into the superclass,
- * {@link DropDownSelectorPanelAbstract}.
- *
- * <p>
- * Note that this class is {@link ComponentFactoryListDefault registered} prior
- * to any other views.
- */
-public class CollectionContentsDropDownSelectorPanel extends DropDownSelectorPanelAbstract<EntityCollectionModel> {
-
- private static final long serialVersionUID = 1L;
-
- public CollectionContentsDropDownSelectorPanel(final String id, final EntityCollectionModel model, final ComponentFactory factory) {
- super(id, ComponentType.COLLECTION_CONTENTS.toString(), model, factory);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanelFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanelFactory.java
deleted file mode 100644
index 3e8239f..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/dropdown/CollectionContentsDropDownSelectorPanelFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.dropdown;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.links.CollectionContentsLinksSelectorPanelFactory;
-
-/**
- * {@link ComponentFactory} for {@link CollectionContentsDropDownSelectorPanel}.
- *
- * <p>
- * Either this class or {@link CollectionContentsLinksSelectorPanelFactory} should be
- * registered, but not both.
- */
-public class CollectionContentsDropDownSelectorPanelFactory extends ComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public CollectionContentsDropDownSelectorPanelFactory() {
- super(ComponentType.COLLECTION_CONTENTS);
- }
-
- @Override
- public ApplicationAdvice appliesTo(final IModel<?> model) {
- return appliesIf(model instanceof EntityCollectionModel);
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityCollectionModel collectionModel = (EntityCollectionModel) model;
- return new CollectionContentsDropDownSelectorPanel(id, collectionModel, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/links/CollectionContentsLinksSelectorPanelFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/links/CollectionContentsLinksSelectorPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/links/CollectionContentsLinksSelectorPanelFactory.java
index 59aa909..1a940d9 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/links/CollectionContentsLinksSelectorPanelFactory.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/selector/links/CollectionContentsLinksSelectorPanelFactory.java
@@ -26,7 +26,6 @@ import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
import org.apache.isis.viewer.wicket.ui.ComponentFactory;
import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract;
import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.selector.dropdown.CollectionContentsDropDownSelectorPanelFactory;
/**
* {@link ComponentFactory} for {@link CollectionContentsLinksSelectorPanel}.
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
index ecfc674..f6e30f1 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
@@ -91,28 +91,27 @@ public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
final PageParameters pageParameters = EntityModel.createPageParameters(adapter);
final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ENTITY);
+
final AbstractLink link = newLink(ID_ENTITY_LINK, pageClass, pageParameters);
- String title = determineTitle();
- label = new Label(ID_ENTITY_TITLE, title);
- link.add(label);
-
- final ResourceReference imageResource = imageCache.resourceReferenceFor(adapter);
- image = new Image(ID_ENTITY_ICON, imageResource) {
- private static final long serialVersionUID = 1L;
- @Override
- protected boolean shouldAddAntiCacheParameter() {
- return false;
- }
- };
- link.addOrReplace(image);
+ link.addOrReplace(this.label = newLabel(ID_ENTITY_TITLE));
+ link.addOrReplace(this.image = newImage(ID_ENTITY_ICON, adapter));
final WebMarkupContainer entityLinkWrapper = new WebMarkupContainer(ID_ENTITY_LINK_WRAPPER);
entityLinkWrapper.addOrReplace(link);
return entityLinkWrapper;
}
- private String determineTitle() {
+ protected AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
+ return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
+ }
+
+ protected Label newLabel(final String id) {
+ final String title = determineTitle();
+ return new Label(id, title);
+ }
+
+ protected String determineTitle() {
EntityModel model = getModel();
final ObjectAdapter adapter = model.getObject();
if (adapter != null) {
@@ -129,6 +128,20 @@ public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
}
}
+ protected Image newImage(final String id, final ObjectAdapter adapter) {
+ Image image;
+ final ResourceReference imageResource = imageCache.resourceReferenceFor(adapter);
+
+ image = new Image(id, imageResource) {
+ private static final long serialVersionUID = 1L;
+ @Override
+ protected boolean shouldAddAntiCacheParameter() {
+ return false;
+ }
+ };
+ return image;
+ }
+
public ObjectAdapter getContextAdapterIfAny() {
EntityModel model = getModel();
ObjectAdapterMemento contextAdapterMementoIfAny = model.getContextAdapterIfAny();
@@ -143,11 +156,6 @@ public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
return maxLength <= 3 ? "" : str.substring(0, maxLength - 3) + "...";
}
-
- private AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
- return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
- }
-
// ///////////////////////////////////////////////////////////////////
// Convenience
@@ -165,7 +173,6 @@ public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
@Inject
private ImageResourceCache imageCache;
-
protected ImageResourceCache getImageCache() {
return imageCache;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.css
deleted file mode 100644
index 65cc7a0..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.entityDropDownSelectorPanel select {
- margin-bottom: 1em;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.html
deleted file mode 100644
index 3a0eb16..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
- xml:lang="en"
- lang="en">
- <head></head>
- <body>
- <wicket:extend>
- <div wicket:id="entity" class="entityDropDownSelectorPanel entityComponentType"></div>
- </wicket:extend>
- </body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.java
deleted file mode 100644
index f6d73db..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.components.entity.selector.dropdown;
-
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.selector.dropdown.DropDownSelectorPanelAbstract;
-
-/**
- * Provides a drop-down for selecting other views that support
- * {@link ComponentType#ENTITY} with a backing {@link EntityModel}.
- *
- * <p>
- * Most of the heavy lifting is factored out into the superclass,
- * {@link DropDownSelectorPanelAbstract}.
- *
- * <p>
- * Note that this class should be registered (in
- * <tt>ComponentFactoryListDefault</tt>) prior to any other views.
- */
-public class EntityDropDownSelectorPanel extends DropDownSelectorPanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- public EntityDropDownSelectorPanel(final String id, final EntityModel model, final ComponentFactory factory) {
- super(id, ComponentType.ENTITY.toString(), model, factory);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanelFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanelFactory.java
deleted file mode 100644
index 6a4470a..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/dropdown/EntityDropDownSelectorPanelFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.components.entity.selector.dropdown;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
-import org.apache.isis.viewer.wicket.ui.components.entity.selector.links.EntityLinksSelectorPanelFactory;
-
-/**
- * {@link ComponentFactory} for {@link EntityDropDownSelectorPanel}.
- *
- * <p>
- * Either this selector, or {@link EntityLinksSelectorPanelFactory} should be registered;
- * but not both.
- */
-public class EntityDropDownSelectorPanelFactory extends EntityComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public EntityDropDownSelectorPanelFactory() {
- super(ComponentType.ENTITY);
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityModel entityModel = (EntityModel) model;
- return new EntityDropDownSelectorPanel(id, entityModel, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/links/EntityLinksSelectorPanelFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/links/EntityLinksSelectorPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/links/EntityLinksSelectorPanelFactory.java
index 15a07e8..0f20bb5 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/links/EntityLinksSelectorPanelFactory.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/selector/links/EntityLinksSelectorPanelFactory.java
@@ -26,7 +26,6 @@ import org.apache.isis.viewer.wicket.model.models.EntityModel;
import org.apache.isis.viewer.wicket.ui.ComponentFactory;
import org.apache.isis.viewer.wicket.ui.ComponentType;
import org.apache.isis.viewer.wicket.ui.components.entity.EntityComponentFactoryAbstract;
-import org.apache.isis.viewer.wicket.ui.components.entity.selector.dropdown.EntityDropDownSelectorPanelFactory;
/**
* {@link ComponentFactory} for {@link EntityLinksSelectorPanel}.
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java
index 136c163..dd489ba 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassList.java
@@ -33,6 +33,6 @@ import org.apache.isis.viewer.wicket.model.models.PageType;
*/
public interface PageClassList {
- void registerPages(PageRegistrySpi pageRegistry);
+ void registerPages(PageClassRegistrySpi pageRegistry);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java
new file mode 100644
index 0000000..6113222
--- /dev/null
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageClassRegistrySpi.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.viewer.wicket.ui.pages;
+
+import org.apache.wicket.Page;
+
+import org.apache.isis.viewer.wicket.model.models.PageType;
+
+/**
+ * Used by {@link PageClassList} implementations to add pages into the registry.
+ */
+public interface PageClassRegistrySpi {
+
+ public void registerPage(PageType pageType, Class<? extends Page> pageClass);
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
deleted file mode 100644
index ea9c9d1..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/PageRegistrySpi.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.pages;
-
-import org.apache.wicket.Page;
-
-import org.apache.isis.viewer.wicket.model.models.PageType;
-
-/**
- * Used by {@link PageClassList} implementations to add pages into the registry.
- */
-public interface PageRegistrySpi {
-
- public void registerPage(PageType pageType, Class<? extends Page> pageClass);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownChoiceComponentFactory.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownChoiceComponentFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownChoiceComponentFactory.java
deleted file mode 100644
index 6a4d753..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownChoiceComponentFactory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.viewer.wicket.ui.selector.dropdown;
-
-import java.util.List;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
-import org.apache.wicket.markup.html.form.DropDownChoice;
-import org.apache.wicket.markup.html.form.IChoiceRenderer;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-
-/**
- * {@link ComponentFactory} for rendering a selection of
- * {@link ComponentFactory}s.
- *
- * <p>
- * Used by {@link DropDownSelectorPanelAbstract}.
- */
-public class DropDownChoiceComponentFactory extends DropDownChoice<ComponentFactory> {
-
- private static final long serialVersionUID = 1L;
-
- private final IModel<?> underlyingModel;
- private final String underlyingId;
- private final MarkupContainer container;
-
- private static final class ComponentFactoryChoiceRenderer implements IChoiceRenderer<ComponentFactory> {
- private static final long serialVersionUID = 1L;
-
- @Override
- public Object getDisplayValue(final ComponentFactory object) {
- return object.getName();
- }
-
- @Override
- public String getIdValue(final ComponentFactory object, final int index) {
- return Integer.toString(index);
- }
- }
-
- /**
- * @param id
- * - id to use for the drop down
- * @param selectedComponentFactoryModel
- * - currently selected in the drop-down
- * @param componentFactories
- * - list of {@link ComponentFactory}s to show in drop-down
- * @param container
- * - the container that should contain the {@link Component}
- * created by the selected {@link ComponentFactory}
- * @param underlyingId
- * - the id of the {@link Component} created
- * @param underlyingModel
- * - the model for the {@link Component}
- */
- public DropDownChoiceComponentFactory(final String id, final Model<ComponentFactory> selectedComponentFactoryModel, final List<? extends ComponentFactory> componentFactories, final MarkupContainer container, final String underlyingId, final IModel<?> underlyingModel) {
- super(id, selectedComponentFactoryModel, componentFactories, new ComponentFactoryChoiceRenderer());
- this.underlyingId = underlyingId;
- this.underlyingModel = underlyingModel;
- this.container = container;
- }
-
- @Override
- protected boolean wantOnSelectionChangedNotifications() {
- return true;
- }
-
- @Override
- protected void onSelectionChanged(final ComponentFactory newSelection) {
- final ComponentFactory componentFactory = getModel().getObject();
- if (componentFactory != null) {
- container.addOrReplace(componentFactory.createComponent(underlyingId, underlyingModel));
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.css
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.css b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.css
deleted file mode 100644
index 840f3d8..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-.dropDownSelectorPanel > p {
- margin-bottom: 0.8em;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.html
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.html
deleted file mode 100644
index 13a688b..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
- <body>
- <wicket:panel>
- <div class="dropDownSelectorPanel">
- <p wicket:id="views">
- <select wicket:id="viewsDropDown"/>
- </p>
- <div class="views">
- <wicket:child/>
- </div>
- </div>
- </wicket:panel>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.java
deleted file mode 100644
index 2e7a001..0000000
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/selector/dropdown/DropDownSelectorPanelAbstract.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.wicket.ui.selector.dropdown;
-
-import java.util.List;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-
-import org.apache.isis.applib.annotation.Render.Type;
-import org.apache.isis.core.metamodel.facets.members.resolve.RenderFacet;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.unresolved.CollectionContentsAsUnresolvedPanelFactory;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-public abstract class DropDownSelectorPanelAbstract<T extends IModel<?>> extends PanelAbstract<T> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_VIEWS = "views";
- private static final String ID_VIEWS_DROP_DOWN = "viewsDropDown";
-
- private final ComponentType componentType;
-
- public DropDownSelectorPanelAbstract(final String id, final String underlyingId, final T model, final ComponentFactory factory) {
- super(id, model);
-
- componentType = factory.getComponentType();
-
- addUnderlyingViews(underlyingId, model, factory);
- }
-
- private void addUnderlyingViews(final String underlyingId, final T model, final ComponentFactory factory) {
- final List<ComponentFactory> componentFactories = findOtherComponentFactories(model, factory);
-
- final ComponentFactory selectedComponentFactory = Iterables.find(componentFactories, determineInitialFactory(model));
- if (componentFactories.size() > 1) {
- final Model<ComponentFactory> componentFactoryModel = new Model<ComponentFactory>();
-
- componentFactoryModel.setObject(selectedComponentFactory);
-
- final WebMarkupContainer views = new WebMarkupContainer(ID_VIEWS);
-
- final DropDownChoiceComponentFactory viewsDropDown = new DropDownChoiceComponentFactory(ID_VIEWS_DROP_DOWN, componentFactoryModel, componentFactories, this, underlyingId, model);
- views.addOrReplace(viewsDropDown);
-
- addOrReplace(views);
- } else {
- permanentlyHide(ID_VIEWS);
- }
- addOrReplace(selectedComponentFactory.createComponent(underlyingId, model));
- }
-
- private static Predicate<ComponentFactory> determineInitialFactory(IModel<?> model) {
- return hasResolveEagerlyFacet(model)
- ? new Predicate<ComponentFactory>() {
- @Override
- public boolean apply(ComponentFactory input) {
- return !(input instanceof CollectionContentsAsUnresolvedPanelFactory);
- }
- }
- : Predicates.<ComponentFactory>alwaysTrue();
- }
-
- private static boolean hasResolveEagerlyFacet(IModel<?> model) {
- if(!(model instanceof EntityCollectionModel)) {
- return false;
- }
- final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
- if(!entityCollectionModel.isParented()) {
- return false;
- }
-
- final OneToManyAssociation collection =
- entityCollectionModel.getCollectionMemento().getCollection();
- RenderFacet resolveFacet = collection.getFacet(RenderFacet.class);
- return resolveFacet != null && resolveFacet.value() == Type.EAGERLY;
- }
-
- private List<ComponentFactory> findOtherComponentFactories(final T model, final ComponentFactory ignoreFactory) {
- final List<ComponentFactory> componentFactories = getComponentFactoryRegistry().findComponentFactories(componentType, model);
- return Lists.newArrayList(Collections2.filter(componentFactories, new Predicate<ComponentFactory>() {
- @Override
- public boolean apply(final ComponentFactory input) {
- return input != ignoreFactory;
- }
- }));
- }
-
- @Override
- public void renderHead(final IHeaderResponse response) {
- super.renderHead(response);
- renderHead(response, DropDownSelectorPanelAbstract.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/PageClassListForQuickstart.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/PageClassListForQuickstart.java b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/PageClassListForQuickstart.java
new file mode 100644
index 0000000..b84dc46
--- /dev/null
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/PageClassListForQuickstart.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package app;
+
+import org.apache.wicket.Page;
+
+import org.apache.isis.viewer.wicket.ui.ComponentFactory;
+import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
+
+public class PageClassListForQuickstart extends PageClassListDefault {
+
+ @Override
+ protected Class<? extends Page> getSignInPageClass() {
+ // no override
+ return super.getSignInPageClass();
+ }
+
+ @Override
+ protected Class<? extends Page> getHomePageClass() {
+ // no override
+ return super.getHomePageClass();
+ }
+
+ @Override
+ protected Class<? extends Page> getAboutPageClass() {
+ // no override
+ return super.getAboutPageClass();
+ }
+
+ /**
+ * More typically, override using custom {@link ComponentFactory}s.
+ */
+ @Override
+ protected Class<? extends Page> getEntityPageClass() {
+ // no override
+ return super.getEntityPageClass();
+ }
+
+ /**
+ * More typically, override using custom {@link ComponentFactory}s.
+ */
+ @Override
+ protected Class<? extends Page> getActionPageClass() {
+ // no override
+ return super.getActionPageClass();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/QuickStartApplication.java
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/QuickStartApplication.java b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/QuickStartApplication.java
index c81bd82..56aa2d1 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/QuickStartApplication.java
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/java/app/QuickStartApplication.java
@@ -39,8 +39,10 @@ import org.apache.wicket.request.Response;
import org.apache.wicket.request.http.WebRequest;
import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistrar;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassList;
import org.apache.isis.viewer.wicket.viewer.IsisWicketApplication;
import org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis;
+import org.apache.isis.viewer.wicket.viewer.registries.pages.PageClassListDefault;
/**
@@ -64,32 +66,47 @@ public class QuickStartApplication extends IsisWicketApplication {
private static final long serialVersionUID = 1L;
-//
-// uncomment for a (slightly hacky) way of allowing logins using ?user=sven&pass=pass
-//
-// for demos only, obvious
+ /**
+ * uncomment for a (slightly hacky) way of allowing logins using query args, eg:
+ *
+ * <tt>?user=sven&pass=pass</tt>
+ *
+ * <p>
+ * for demos only, obvious.
+ */
+ private final static boolean DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS = false;
-// @Override
-// public Session newSession(final Request request, final Response response) {
-// AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
-// final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
-// final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
-// s.signIn(user.toString(), password.toString());
-// return s;
-// }
-//
-// @Override
-// public WebRequest newWebRequest(HttpServletRequest servletRequest, String filterPath) {
-// try {
-// String uname = servletRequest.getParameter("user");
-// if (uname != null) {
-// servletRequest.getSession().invalidate();
-// }
-// } catch (Exception e) {
-// }
-// WebRequest request = super.newWebRequest(servletRequest, filterPath);
-// return request;
-// }
+ @Override
+ public Session newSession(final Request request, final Response response) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newSession(request, response);
+ }
+
+ // else demo mode
+ final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
+ final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
+ final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
+ s.signIn(user.toString(), password.toString());
+ return s;
+ }
+
+ @Override
+ public WebRequest newWebRequest(HttpServletRequest servletRequest, String filterPath) {
+ if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
+ return super.newWebRequest(servletRequest, filterPath);
+ }
+
+ // else demo mode
+ try {
+ String uname = servletRequest.getParameter("user");
+ if (uname != null) {
+ servletRequest.getSession().invalidate();
+ }
+ } catch (Exception e) {
+ }
+ WebRequest request = super.newWebRequest(servletRequest, filterPath);
+ return request;
+ }
@Override
protected Module newIsisWicketModule() {
@@ -99,6 +116,7 @@ public class QuickStartApplication extends IsisWicketApplication {
@Override
protected void configure() {
bind(ComponentFactoryRegistrar.class).to(ComponentFactoryRegistrarForQuickStart.class);
+ bind(PageClassList.class).to(PageClassListForQuickstart.class);
bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("Quick Start App");
bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
http://git-wip-us.apache.org/repos/asf/isis/blob/58aff6aa/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
index 1e2caf9..7124976 100644
--- a/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
+++ b/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/css/application.css
@@ -30,3 +30,22 @@ uncomment to add a logo (in an ../images directory relative to this file)
display: none;
}
*/
+
+/*
+example: uncomment to hide the icon
+
+.entityIconAndTitlePanel a img {
+ display: none;
+}
+*/
+
+/*
+example: uncomment to hide the sliding bookmark panel
+
+#bookmarkedPagesSlidingDiv {
+ display: none;
+}
+.showPanelTab {
+ display: none;
+}
+*/