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 2015/09/03 14:32:02 UTC
[11/87] [abbrv] [partial] isis git commit: ISIS-1194: moving the
wicket submodules to be direct children of core;
removing the isis-viewer-wicket parent pom.
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
deleted file mode 100644
index 941d3ea..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ /dev/null
@@ -1,239 +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.collection.bulk;
-
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import org.apache.wicket.Session;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.core.metamodel.facets.members.cssclassfa.CssClassFaPosition;
-import org.apache.isis.applib.annotation.InvokedOn;
-import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.applib.services.command.Command.Executor;
-import org.apache.isis.applib.services.command.CommandContext;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
-import org.apache.isis.core.commons.authentication.MessageBroker;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
-import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
-import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.wicket.model.links.LinkAndLabel;
-import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
-import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
-import org.apache.isis.viewer.wicket.model.models.ActionModel;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponse;
-import org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn;
-import org.apache.isis.viewer.wicket.ui.components.widgets.linkandlabel.ActionLinkFactory;
-import org.apache.isis.viewer.wicket.ui.errors.JGrowlBehaviour;
-
-public final class BulkActionsLinkFactory implements ActionLinkFactory {
-
- private static final long serialVersionUID = 1L;
- private final EntityCollectionModel model;
-
- private final ObjectAdapterToggleboxColumn toggleboxColumn;
-
- public BulkActionsLinkFactory(
- final EntityCollectionModel model,
- final ObjectAdapterToggleboxColumn toggleboxColumn) {
- this.model = model;
- this.toggleboxColumn = toggleboxColumn;
- }
-
-
- @Override
- public LinkAndLabel newLink(
- final ObjectAdapterMemento objectAdapterMemento,
- final ObjectAction objectAction,
- final String linkId) {
-
- final ActionMemento actionMemento = new ActionMemento(objectAction);
- final AbstractLink link = new Link<Object>(linkId) {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onClick() {
- final ObjectAction objectAction = actionMemento.getAction();
- final ConcurrencyChecking concurrencyChecking =
- ConcurrencyChecking.concurrencyCheckingFor(objectAction.getSemantics());
-
- try {
- final List<ObjectAdapterMemento> toggleMementosList = model.getToggleMementosList();
-
- final Iterable<ObjectAdapter> toggledAdapters =
- Iterables.transform(toggleMementosList, ObjectAdapterMemento.Functions.fromMemento(concurrencyChecking));
-
- final List<Object> domainObjects = Lists.newArrayList(Iterables.transform(toggledAdapters, ObjectAdapter.Functions.getObject()));
-
-
- final ActionInvocationContext actionInvocationContext = getServicesInjector().lookupService(ActionInvocationContext.class);
- if (actionInvocationContext != null) {
- actionInvocationContext.setInvokedOn(InvokedOn.COLLECTION);
- actionInvocationContext.setDomainObjects(domainObjects);
- }
-
- final Bulk.InteractionContext bulkInteractionContext = getServicesInjector().lookupService(Bulk.InteractionContext.class);
- if (bulkInteractionContext != null) {
- bulkInteractionContext.setInvokedAs(Bulk.InteractionContext.InvokedAs.BULK);
- bulkInteractionContext.setDomainObjects(domainObjects);
- }
-
- final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
- final Command command;
- if (commandContext != null) {
- command = commandContext.getCommand();
- command.setExecutor(Executor.USER);
- }
-
-
- ObjectAdapter lastReturnedAdapter = null;
- int i=0;
- for(final ObjectAdapter adapter : toggledAdapters) {
-
- int numParameters = objectAction.getParameterCount();
- if(numParameters != 0) {
- return;
- }
- if (bulkInteractionContext != null) {
- bulkInteractionContext.setIndex(i++);
- }
-
- lastReturnedAdapter = objectAction.executeWithRuleChecking(adapter, new ObjectAdapter[]{}, getAuthenticationSession(), ActionModel.WHERE_FOR_ACTION_INVOCATION);
- }
-
-
-
- model.clearToggleMementosList();
- toggleboxColumn.clearToggles();
- final ActionModel actionModelHint = model.getActionModelHint();
- if(actionModelHint != null && actionModelHint.getActionMemento().getAction().getSemantics().isIdempotentInNature()) {
- ObjectAdapter resultAdapter = actionModelHint.getObject();
- model.setObjectList(resultAdapter);
- } else {
- model.setObject(persistentAdaptersWithin(model.getObject()));
- }
-
- if(lastReturnedAdapter != null) {
- final ActionResultResponse resultResponse =
- ActionResultResponseType.determineAndInterpretResult(actionModelHint, null, lastReturnedAdapter);
- resultResponse.getHandlingStrategy().handleResults(this, resultResponse);
- }
-
- } catch(final ConcurrencyException ex) {
-
- recover();
- // display a warning to the user so that they know that the action wasn't performed
- getMessageBroker().addWarning(ex.getMessage());
- return;
-
- } catch(final RuntimeException ex) {
-
- final RecoverableException appEx = ActionModel.getApplicationExceptionIfAny(ex);
- if (appEx != null) {
-
- recover();
-
- getMessageBroker().setApplicationError(appEx.getMessage());
-
- // there's no need to abort the transaction, it will have already been done
- // (in IsisTransactionManager#executeWithinTransaction(...)).
- return;
- }
- throw ex;
- }
- }
-
- private void recover() {
- // resync with the objectstore
- final List<ObjectAdapterMemento> toggleMementosList = Lists.newArrayList(model.getToggleMementosList());
- for (ObjectAdapterMemento oam : toggleMementosList) {
- // just requesting the adapter will sync the OAM's version with the objectstore
- oam.getObjectAdapter(ConcurrencyChecking.NO_CHECK);
- }
-
- // discard any adapters that might have been deleted
- model.setObject(persistentAdaptersWithin(model.getObject()));
-
- // attempt to preserve the toggled adapters
- final List<ObjectAdapter> adapters = model.getObject();
- model.clearToggleMementosList();
- for (ObjectAdapterMemento oam : toggleMementosList) {
- final ObjectAdapter objectAdapter = oam.getObjectAdapter(ConcurrencyChecking.NO_CHECK);
- if(adapters.contains(objectAdapter)) {
- // in case it has been deleted...
- model.toggleSelectionOn(objectAdapter);
- }
- }
- }
-
- private List<ObjectAdapter> persistentAdaptersWithin(List<ObjectAdapter> adapters) {
- return Lists.newArrayList(Iterables.filter(adapters, new Predicate<ObjectAdapter>() {
- @Override
- public boolean apply(ObjectAdapter input) {
- return !input.isTransient() && !input.isDestroyed();
- }
- }));
- }
-
- };
- link.add(new JGrowlBehaviour());
-
- final boolean explorationOrPrototype = ObjectAction.Utils.isExplorationOrPrototype(objectAction);
- final String actionIdentifier = ObjectAction.Utils.actionIdentifierFor(objectAction);
- final String description = ObjectAction.Utils.descriptionOf(objectAction);
- final String cssClass = ObjectAction.Utils.cssClassFor(objectAction, null);
- final String cssClassFa = ObjectAction.Utils.cssClassFaFor(objectAction);
- final CssClassFaPosition cssClassFaPosition = ObjectAction.Utils.cssClassFaPositionFor(objectAction);
- final ActionLayout.Position position = ObjectAction.Utils.actionLayoutPositionOf(objectAction);
-
- return new LinkAndLabel(link, objectAction.getName(), null, description, false, explorationOrPrototype, actionIdentifier, cssClass, cssClassFa, cssClassFaPosition, position);
- }
-
-
- ///////////////////////////////////////////////////////
- // Dependencies (from context)
- ///////////////////////////////////////////////////////
-
- public AuthenticationSession getAuthenticationSession() {
- final AuthenticationSessionProvider asa = (AuthenticationSessionProvider) Session.get();
- return asa.getAuthenticationSession();
- }
-
- protected MessageBroker getMessageBroker() {
- return getAuthenticationSession().getMessageBroker();
- }
-
- protected ServicesInjector getServicesInjector() {
- return IsisContext.getPersistenceSession().getServicesInjector();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsProvider.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsProvider.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsProvider.java
deleted file mode 100644
index 39f2b96..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsProvider.java
+++ /dev/null
@@ -1,28 +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.collection.bulk;
-
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn;
-
-public interface BulkActionsProvider {
-
- void configureBulkActions(ObjectAdapterToggleboxColumn toggleboxColumn);
-
- ObjectAdapterToggleboxColumn createToggleboxColumn();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/count/CollectionCountProvider.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/count/CollectionCountProvider.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/count/CollectionCountProvider.java
deleted file mode 100644
index 0ff411f..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/count/CollectionCountProvider.java
+++ /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.
- */
-package org.apache.isis.viewer.wicket.ui.components.collection.count;
-
-public interface CollectionCountProvider {
- Integer getCount();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorHelper.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorHelper.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorHelper.java
deleted file mode 100644
index a600923..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorHelper.java
+++ /dev/null
@@ -1,169 +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.collection.selector;
-
-import java.io.Serializable;
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-import org.apache.isis.applib.annotation.Render;
-import org.apache.isis.core.metamodel.facets.members.render.RenderFacet;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.viewer.wicket.model.hints.UiHintContainer;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-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.app.registry.ComponentFactoryRegistry;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsAsAjaxTablePanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.multiple.CollectionContentsMultipleViewsPanelFactory;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.unresolved.CollectionContentsAsUnresolvedPanelFactory;
-
-public class CollectionSelectorHelper implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- static final String UIHINT_EVENT_VIEW_KEY = "view";
-
- private final EntityCollectionModel model;
- private final List<ComponentFactory> componentFactories;
-
- public CollectionSelectorHelper(
- final EntityCollectionModel model,
- final ComponentFactoryRegistry componentFactoryRegistry) {
- this.model = model;
- this.componentFactories = locateComponentFactories(componentFactoryRegistry);
- }
-
- private List<ComponentFactory> locateComponentFactories(ComponentFactoryRegistry componentFactoryRegistry) {
- final List<ComponentFactory> componentFactories = componentFactoryRegistry.findComponentFactories(ComponentType.COLLECTION_CONTENTS, model);
- List<ComponentFactory> otherFactories = Lists.newArrayList(Collections2.filter(componentFactories, new Predicate<ComponentFactory>() {
- @Override
- public boolean apply(final ComponentFactory input) {
- return input.getClass() != CollectionContentsMultipleViewsPanelFactory.class;
- }
- }));
- return ordered(otherFactories);
- }
-
- public List<ComponentFactory> getComponentFactories() {
- return componentFactories;
- }
-
- public int honourViewHintElseDefault(final Component component) {
- // honour hints ...
- final UiHintContainer hintContainer = getUiHintContainer(component);
- if(hintContainer != null) {
- String viewStr = hintContainer.getHint(component, UIHINT_EVENT_VIEW_KEY);
- if(viewStr != null) {
- try {
- int view = Integer.parseInt(viewStr);
- if(view >= 0 && view < componentFactories.size()) {
- return view;
- }
- } catch(NumberFormatException ex) {
- // ignore
- }
- }
- }
-
- // ... else default
- int initialFactory = determineInitialFactory();
- if(hintContainer != null) {
- hintContainer.setHint(component, UIHINT_EVENT_VIEW_KEY, ""+initialFactory);
- // don't broadcast (no AjaxRequestTarget, still configuring initial setup)
- }
- return initialFactory;
- }
-
- //region > helpers
-
- /**
- * return the index of {@link org.apache.isis.viewer.wicket.ui.components.collectioncontents.unresolved.CollectionContentsAsUnresolvedPanelFactory unresolved panel} if present and not eager loading;
- * else the index of {@link org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.CollectionContentsAsAjaxTablePanelFactory ajax table} if present,
- * otherwise first factory.
- */
- private int determineInitialFactory() {
- if(!hasRenderEagerlyFacet(model)) {
- for(int i=0; i<componentFactories.size(); i++) {
- if(componentFactories.get(i) instanceof CollectionContentsAsUnresolvedPanelFactory) {
- return i;
- }
- }
- }
- int ajaxTableIdx = findAjaxTable(componentFactories);
- if(ajaxTableIdx>=0) {
- return ajaxTableIdx;
- }
- return 0;
- }
-
- private static List<ComponentFactory> ordered(List<ComponentFactory> componentFactories) {
- return orderAjaxTableToEnd(componentFactories);
- }
-
- static List<ComponentFactory> orderAjaxTableToEnd(List<ComponentFactory> componentFactories) {
- int ajaxTableIdx = findAjaxTable(componentFactories);
- if(ajaxTableIdx>=0) {
- List<ComponentFactory> orderedFactories = Lists.newArrayList(componentFactories);
- ComponentFactory ajaxTableFactory = orderedFactories.remove(ajaxTableIdx);
- orderedFactories.add(ajaxTableFactory);
- return orderedFactories;
- } else {
- return componentFactories;
- }
- }
-
- private static int findAjaxTable(List<ComponentFactory> componentFactories) {
- for(int i=0; i<componentFactories.size(); i++) {
- if(componentFactories.get(i) instanceof CollectionContentsAsAjaxTablePanelFactory) {
- return i;
- }
- }
- return -1;
- }
-
-
- private static UiHintContainer getUiHintContainer(final Component component) {
- return UiHintContainer.Util.hintContainerOf(component, EntityModel.class);
- }
-
-
- private static boolean hasRenderEagerlyFacet(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 renderFacet = collection.getFacet(RenderFacet.class);
- return renderFacet != null && renderFacet.value() == Render.Type.EAGERLY;
- }
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.html b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.html
deleted file mode 100644
index 8bec51a..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.html
+++ /dev/null
@@ -1,44 +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 xmlns:wicket="http://wicket.apache.org">
-<body>
-<wicket:panel>
- <div class="linksSelectorPanel">
- <div class="btn-group viewLinks" wicket:id="views">
- <button type="button" class="btn btn-sm btn-info">
- <span wicket:id="viewButtonIcon" class="ViewLinkItem"></span>
- <span wicket:id="viewButtonTitle" class="ViewLinkItemTitle"></span>
- </button>
- <button type="button" class="btn btn-sm btn-info dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- </button>
- <ul wicket:id="viewList" class="dropdown-menu dropdown-menu-right" role="menu">
- <li wicket:id="viewItem" class="viewItem">
- <a href="#" wicket:id="viewLink">
- <span wicket:id="viewItemIcon" class="ViewLinkItem"></span> <span wicket:id="viewItemTitle" class="ViewLinkItemTitle">[link title]</span>
- </a>
- </li>
- </ul>
- </div>
- </div>
-</wicket:panel>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.java
deleted file mode 100644
index 02aa720..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorPanel.java
+++ /dev/null
@@ -1,213 +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.collection.selector;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.button.Buttons;
-
-import java.util.List;
-import org.apache.wicket.AttributeModifier;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.markup.ComponentTag;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.isis.core.commons.lang.StringExtensions;
-import org.apache.isis.viewer.wicket.model.hints.IsisUiHintEvent;
-import org.apache.isis.viewer.wicket.model.hints.UiHintContainer;
-import org.apache.isis.viewer.wicket.model.hints.UiHintPathSignificant;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.CollectionContentsAsFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
-
-/**
- * Provides a list of links for selecting other views that support
- * {@link org.apache.isis.viewer.wicket.ui.ComponentType#COLLECTION_CONTENTS} with a backing
- * {@link org.apache.isis.viewer.wicket.model.models.EntityCollectionModel}.
- */
-public class CollectionSelectorPanel
- extends PanelAbstract<EntityCollectionModel> implements UiHintPathSignificant {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_VIEWS = "views";
- private static final String ID_VIEW_LIST = "viewList";
- private static final String ID_VIEW_LINK = "viewLink";
- private static final String ID_VIEW_ITEM = "viewItem";
- private static final String ID_VIEW_ITEM_TITLE = "viewItemTitle";
- private static final String ID_VIEW_ITEM_ICON = "viewItemIcon";
-
- private static final String ID_VIEW_BUTTON_TITLE = "viewButtonTitle";
- private static final String ID_VIEW_BUTTON_ICON = "viewButtonIcon";
-
- private final CollectionSelectorHelper selectorHelper;
-
- private ComponentFactory selectedComponentFactory;
-
- public CollectionSelectorPanel(final String id, final EntityCollectionModel model) {
- super(id, model);
- selectorHelper = new CollectionSelectorHelper(model, getComponentFactoryRegistry());
- }
-
- /**
- * Build UI only after added to parent.
- */
- public void onInitialize() {
- super.onInitialize();
- addDropdown();
- }
-
-
-
- private void addDropdown() {
- final List<ComponentFactory> componentFactories = selectorHelper.getComponentFactories();
- final int selected = selectorHelper.honourViewHintElseDefault(this);
-
- // selector
- if (componentFactories.size() <= 1) {
- permanentlyHide(ID_VIEWS);
- } else {
- final Model<ComponentFactory> componentFactoryModel = new Model<>();
-
- this.selectedComponentFactory = componentFactories.get(selected);
- componentFactoryModel.setObject(this.selectedComponentFactory);
-
- final WebMarkupContainer views = new WebMarkupContainer(ID_VIEWS);
-
- final Label viewButtonTitle = new Label(ID_VIEW_BUTTON_TITLE, "Hidden");
- views.addOrReplace(viewButtonTitle);
-
- final Label viewButtonIcon = new Label(ID_VIEW_BUTTON_ICON, "");
- views.addOrReplace(viewButtonIcon);
-
- final WebMarkupContainer container = new WebMarkupContainer(ID_VIEW_LIST);
-
- views.addOrReplace(container);
- views.setOutputMarkupId(true);
-
- this.setOutputMarkupId(true);
-
- final ListView<ComponentFactory> listView = new ListView<ComponentFactory>(ID_VIEW_ITEM, componentFactories) {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- protected void populateItem(ListItem<ComponentFactory> item) {
-
- final int underlyingViewNum = item.getIndex();
-
- final ComponentFactory componentFactory = item.getModelObject();
- final AbstractLink link = new AjaxLink<Void>(ID_VIEW_LINK) {
- private static final long serialVersionUID = 1L;
- @Override
- public void onClick(AjaxRequestTarget target) {
- CollectionSelectorPanel linksSelectorPanel = CollectionSelectorPanel.this;
- linksSelectorPanel.setViewHintAndBroadcast(underlyingViewNum, target);
-
- linksSelectorPanel.selectedComponentFactory = componentFactory;
- target.add(linksSelectorPanel, views);
- }
-
- @Override
- protected void onComponentTag(ComponentTag tag) {
- super.onComponentTag(tag);
- Buttons.fixDisabledState(this, tag);
- }
- };
-
- IModel<String> title = nameFor(componentFactory);
- Label viewItemTitleLabel = new Label(ID_VIEW_ITEM_TITLE, title);
- link.add(viewItemTitleLabel);
-
- Label viewItemIcon = new Label(ID_VIEW_ITEM_ICON, "");
- link.add(viewItemIcon);
-
- boolean isEnabled = componentFactory != CollectionSelectorPanel.this.selectedComponentFactory;
- if (!isEnabled) {
- viewButtonTitle.setDefaultModel(title);
- IModel<String> cssClass = cssClassFor(componentFactory, viewButtonIcon);
- viewButtonIcon.add(AttributeModifier.replace("class", "ViewLinkItem " + cssClass.getObject()));
- link.setVisible(false);
- } else {
- IModel<String> cssClass = cssClassFor(componentFactory, viewItemIcon);
- viewItemIcon.add(new CssClassAppender(cssClass));
- }
-
- item.add(link);
- }
-
- private IModel<String> cssClassFor(final ComponentFactory componentFactory, Label viewIcon) {
- IModel<String> cssClass = null;
- if (componentFactory instanceof CollectionContentsAsFactory) {
- CollectionContentsAsFactory collectionContentsAsFactory = (CollectionContentsAsFactory) componentFactory;
- cssClass = collectionContentsAsFactory.getCssClass();
- viewIcon.setDefaultModelObject("");
- viewIcon.setEscapeModelStrings(true);
- }
- if (cssClass == null) {
- String name = componentFactory.getName();
- cssClass = Model.of(StringExtensions.asLowerDashed(name));
- // Small hack: if there is no specific CSS class then we assume that background-image is used
- // the span.ViewItemLink should have some content to show it
- // FIX: find a way to do this with CSS (width and height don't seems to help)
- viewIcon.setDefaultModelObject("     ");
- viewIcon.setEscapeModelStrings(false);
- }
- return cssClass;
- }
-
- private IModel<String> nameFor(final ComponentFactory componentFactory) {
- IModel<String> name = null;
- if (componentFactory instanceof CollectionContentsAsFactory) {
- CollectionContentsAsFactory collectionContentsAsFactory = (CollectionContentsAsFactory) componentFactory;
- name = collectionContentsAsFactory.getTitleLabel();
- }
- if (name == null) {
- name = Model.of(componentFactory.getName());
- }
- return name;
- }
- };
- container.add(listView);
- addOrReplace(views);
- }
- }
-
-
- protected void setViewHintAndBroadcast(int viewNum, AjaxRequestTarget target) {
- final UiHintContainer uiHintContainer = getUiHintContainer(getModel().isParented()? EntityModel.class: EntityCollectionModel.class);
- if(uiHintContainer == null) {
- return;
- }
- uiHintContainer.setHint(CollectionSelectorPanel.this, CollectionSelectorHelper.UIHINT_EVENT_VIEW_KEY, ""+viewNum);
- send(getPage(), Broadcast.EXACT, new IsisUiHintEvent(uiHintContainer, target));
- }
-}
-
-
-
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorProvider.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorProvider.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorProvider.java
deleted file mode 100644
index 340cad2..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/CollectionSelectorProvider.java
+++ /dev/null
@@ -1,46 +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.collection.selector;
-
-import org.apache.wicket.Component;
-
-public interface CollectionSelectorProvider {
- CollectionSelectorPanel getSelectorDropdownPanel();
-
- public static class Util {
-
- /**
- * Searches up the component hierarchy looking for a parent that implements
- * {@link org.apache.isis.viewer.wicket.ui.components.collection.selector.CollectionSelectorProvider}.
- *
- * @return the panel, or null (if there are no alternative views)
- */
- public static CollectionSelectorPanel getCollectionSelectorProvider(Component component) {
- while(component != null) {
- if(component instanceof CollectionSelectorProvider) {
- final CollectionSelectorPanel selectorDropdownPanelIfAny = ((CollectionSelectorProvider) component).getSelectorDropdownPanel();
- return selectorDropdownPanelIfAny;
- }
- component = component.getParent();
- }
- throw new IllegalStateException("Could not locate parent that implements CollectionSelectorProvider");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/UNUSED_CollectionSelectorPanel.css
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/UNUSED_CollectionSelectorPanel.css b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/UNUSED_CollectionSelectorPanel.css
deleted file mode 100644
index 8c3902e..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/selector/UNUSED_CollectionSelectorPanel.css
+++ /dev/null
@@ -1,60 +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.
- */
-.linksSelectorPanel .viewLinks {
- float:right;
- display:block;
-}
-
-.linksSelectorPanel ul.dropdown-menu {
- min-width: 0;
-}
-
-.linksSelectorPanel ul.dropdown-menu li.viewItem {
- min-width: 0;
-}
-
-.linksSelectorPanel ul.viewList li.viewItem:first-child span {
- border-radius:4px 0 0 4px;
- -moz-border-radius:4px 0 0 4px;
- -webkit-border-radius:4px 0 0 4px;
-}
-
-.linksSelectorPanel ul.viewList li.viewItem:last-child span {
- border-radius:0 4px 4px 0;
- -moz-border-radius:0 4px 4px 0;
- -webkit-border-radius:0 4px 4px 0;
-}
-
-
-.linksSelectorPanel .link-selector-panel-invisible {
- display:none;
-}
-
-.linksSelectorPanel .list-inline {
- margin-left: 0;
-}
-
-.linksSelectorPanel .list-inline li {
- padding-left: 0;
-}
-
-
-.collectionContentsLinksSelectorPanel select {
- margin-bottom: 1em;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.html b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.html
deleted file mode 100644
index cf45f34..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.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:wicket="http://wicket.apache.org">
- <body>
- <wicket:panel>
- <div class="collectionContentsAsAjaxTablePanel collectionContentsComponentType">
- <div class="clearfix"></div>
- <div class="table-responsive">
- <table class="contents table table-striped table-condensed table-hover table-bordered" cellspacing="0" wicket:id="table">[table]</table>
- </div>
- </div>
- </wicket:panel>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.java
deleted file mode 100644
index a589269..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanel.java
+++ /dev/null
@@ -1,227 +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.ajaxtable;
-
-import java.util.List;
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
-import org.apache.wicket.model.Model;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.applib.filter.Filter;
-import org.apache.isis.applib.filter.Filters;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
-import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
-import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
-import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.viewer.wicket.model.common.OnConcurrencyExceptionHandler;
-import org.apache.isis.viewer.wicket.model.hints.UiHintPathSignificant;
-import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
-import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.components.collection.bulk.BulkActionsProvider;
-import org.apache.isis.viewer.wicket.ui.components.collection.count.CollectionCountProvider;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ColumnAbstract;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterPropertyColumn;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterTitleColumn;
-import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-/**
- * {@link PanelAbstract Panel} that represents a {@link EntityCollectionModel
- * collection of entity}s rendered using {@link AjaxFallbackDefaultDataTable}.
- */
-public class CollectionContentsAsAjaxTablePanel extends PanelAbstract<EntityCollectionModel> implements CollectionCountProvider , UiHintPathSignificant {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_TABLE = "table";
-
- private IsisAjaxFallbackDataTable<ObjectAdapter,String> dataTable;
-
-
- public CollectionContentsAsAjaxTablePanel(final String id, final EntityCollectionModel model) {
- super(id, model);
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
- buildGui();
- }
-
- private void buildGui() {
-
- final List<IColumn<ObjectAdapter,String>> columns = Lists.newArrayList();
-
- // bulkactions
- final BulkActionsProvider bulkActionsProvider = getBulkActionsProvider();
-
- ObjectAdapterToggleboxColumn toggleboxColumn = null;
- if(bulkActionsProvider != null) {
-
- toggleboxColumn = bulkActionsProvider.createToggleboxColumn();
- if(toggleboxColumn != null) {
- columns.add(toggleboxColumn);
- }
- bulkActionsProvider.configureBulkActions(toggleboxColumn);
- }
-
- final EntityCollectionModel model = getModel();
- addTitleColumn(columns, model.getParentObjectAdapterMemento(), getSettings().getMaxTitleLengthInStandaloneTables(), getSettings().getMaxTitleLengthInStandaloneTables());
- addPropertyColumnsIfRequired(columns);
-
- final SortableDataProvider<ObjectAdapter,String> dataProvider = new CollectionContentsSortableDataProvider(model);
- dataTable = new IsisAjaxFallbackDataTable<>(ID_TABLE, columns, dataProvider, model.getPageSize());
- addOrReplace(dataTable);
- dataTable.honourHints();
-
- if(toggleboxColumn != null) {
- final OnConcurrencyExceptionHandler handler2 = new OnConcurrencyExceptionHandler() {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public void onConcurrencyException(
- final Component context,
- final ObjectAdapter selectedAdapter,
- final ConcurrencyException ex,
- final AjaxRequestTarget ajaxRequestTarget) {
-
- // this causes the row to be repainted
- // but it isn't possible (yet) to raise any warning
- // because that only gets flushed on page refresh.
- //
-
- // perhaps something to tackle in a separate ticket....
- ajaxRequestTarget.add(dataTable);
- }
- };
- toggleboxColumn.setOnConcurrencyExceptionHandler(handler2);
- }
- }
-
- private BulkActionsProvider getBulkActionsProvider() {
- Component component = this;
- while(component != null) {
- if(component instanceof BulkActionsProvider) {
- return (BulkActionsProvider) component;
- }
- component = component.getParent();
- }
- return null;
- }
-
-
-
- private void addTitleColumn(final List<IColumn<ObjectAdapter,String>> columns, ObjectAdapterMemento parentAdapterMementoIfAny, int maxTitleParented, int maxTitleStandalone) {
- int maxTitleLength = getModel().isParented()? maxTitleParented: maxTitleStandalone;
- columns.add(new ObjectAdapterTitleColumn(parentAdapterMementoIfAny, maxTitleLength));
- }
-
- private void addPropertyColumnsIfRequired(final List<IColumn<ObjectAdapter,String>> columns) {
- final ObjectSpecification typeOfSpec = getModel().getTypeOfSpecification();
-
- final Where whereContext =
- getModel().isParented()
- ? Where.PARENTED_TABLES
- : Where.STANDALONE_TABLES;
-
- final ObjectSpecification parentSpecIfAny =
- getModel().isParented()
- ? getModel().getParentObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.NO_CHECK).getSpecification()
- : null;
-
- @SuppressWarnings("unchecked")
- final Filter<ObjectAssociation> filter = Filters.and(
- ObjectAssociation.Filters.PROPERTIES,
- ObjectAssociation.Filters.staticallyVisible(whereContext),
- associationDoesNotReferenceParent(parentSpecIfAny));
-
- final List<? extends ObjectAssociation> propertyList = typeOfSpec.getAssociations(Contributed.INCLUDED, filter);
- for (final ObjectAssociation property : propertyList) {
- final ColumnAbstract<ObjectAdapter> nopc = createObjectAdapterPropertyColumn(property);
- columns.add(nopc);
- }
- }
-
- static Filter<ObjectAssociation> associationDoesNotReferenceParent(final ObjectSpecification parentSpec) {
- if(parentSpec == null) {
- return Filters.any();
- }
- return new Filter<ObjectAssociation>() {
- @Override
- public boolean accept(ObjectAssociation association) {
- final HiddenFacet facet = association.getFacet(HiddenFacet.class);
- if(facet == null) {
- return true;
- }
- if (facet.where() != Where.REFERENCES_PARENT) {
- return true;
- }
- final ObjectSpecification assocSpec = association.getSpecification();
- final boolean associationSpecIsOfParentSpec = parentSpec.isOfType(assocSpec);
- final boolean isVisible = !associationSpecIsOfParentSpec;
- return isVisible;
- }
- };
- }
-
- private ObjectAdapterPropertyColumn createObjectAdapterPropertyColumn(final ObjectAssociation property) {
-
- final NamedFacet facet = property.getFacet(NamedFacet.class);
- final boolean escaped = facet == null || facet.escaped();
-
- return new ObjectAdapterPropertyColumn(Model.of(property.getName()), property.getId(), property.getId(), escaped);
- }
-
-
-
- @Override
- protected void onModelChanged() {
- buildGui();
- }
-
- @Override
- public Integer getCount() {
- final EntityCollectionModel model = getModel();
- return model.getCount();
- }
-
-
- //region > dependencies
-
- @Inject
- private WicketViewerSettings settings;
- protected WicketViewerSettings getSettings() {
- return settings;
- }
-
- //endregion
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanelFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanelFactory.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanelFactory.java
deleted file mode 100644
index e922ac9..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsAsAjaxTablePanelFactory.java
+++ /dev/null
@@ -1,66 +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.ajaxtable;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.ui.CollectionContentsAsFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentFactory;
-import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-
-/**
- * {@link ComponentFactory} for {@link CollectionContentsAsAjaxTablePanel}.
- */
-public class CollectionContentsAsAjaxTablePanelFactory extends ComponentFactoryAbstract implements CollectionContentsAsFactory {
-
- private static final long serialVersionUID = 1L;
-
- private static final String NAME = "table";
-
- public CollectionContentsAsAjaxTablePanelFactory() {
- super(ComponentType.COLLECTION_CONTENTS, NAME, CollectionContentsAsAjaxTablePanel.class);
- }
-
- @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 CollectionContentsAsAjaxTablePanel(id, collectionModel);
- }
-
- @Override
- public IModel<String> getTitleLabel() {
- return new ResourceModel("CollectionContentsAsAjaxTablePanelFactory.Table", "Table");
- }
-
- @Override
- public IModel<String> getCssClass() {
- return Model.of("fa fa-fw fa-table");
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
deleted file mode 100644
index 8b9641c..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java
+++ /dev/null
@@ -1,202 +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.ajaxtable;
-
-import java.util.Iterator;
-import java.util.List;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Ordering;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
-import org.apache.wicket.model.IModel;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
-import org.apache.isis.core.metamodel.consent.InteractionResult;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
-import org.apache.isis.core.metamodel.interactions.InteractionUtils;
-import org.apache.isis.core.metamodel.interactions.ObjectVisibilityContext;
-import org.apache.isis.core.metamodel.interactions.VisibilityContext;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.ObjectSpecificationException;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-
-/**
- * Part of the {@link AjaxFallbackDefaultDataTable} API.
- */
-public class CollectionContentsSortableDataProvider extends SortableDataProvider<ObjectAdapter,String> {
-
- private static final long serialVersionUID = 1L;
-
- private final EntityCollectionModel model;
-
- public CollectionContentsSortableDataProvider(final EntityCollectionModel model) {
- this.model = model;
- }
-
- @Override
- public IModel<ObjectAdapter> model(final ObjectAdapter adapter) {
- return new EntityModel(adapter);
- }
-
- @Override
- public long size() {
- return model.getObject().size();
- }
-
- @Override
- public void detach() {
- super.detach();
- model.detach();
- }
-
- @Override
- public Iterator<ObjectAdapter> iterator(final long first, final long count) {
-
- final List<ObjectAdapter> adapters = model.getObject();
-
- final Iterable<ObjectAdapter> visibleAdapters =
- Iterables.filter(adapters, ignoreHidden());
-
- // need to create a list from the iterable, then back to an iterable
- // because guava's Ordering class doesn't support sorting of iterable -> iterable
- final List<ObjectAdapter> sortedVisibleAdapters = sortedCopy(visibleAdapters, getSort());
- final List<ObjectAdapter> pagedAdapters = subList(first, count, sortedVisibleAdapters);
- return pagedAdapters.iterator();
- }
-
- private static List<ObjectAdapter> subList(
- final long first,
- final long count,
- final List<ObjectAdapter> objectAdapters) {
-
- final int fromIndex = (int) first;
- // if adapters where filter out (as invisible), then make sure don't run off the end
- final int toIndex = Math.min((int) (first + count), objectAdapters.size());
-
- return objectAdapters.subList(fromIndex, toIndex);
- }
-
- private List<ObjectAdapter> sortedCopy(
- final Iterable<ObjectAdapter> adapters,
- final SortParam<String> sort) {
-
- final ObjectAssociation sortProperty = lookupAssociationFor(sort);
- if(sortProperty == null) {
- return Lists.newArrayList(adapters);
- }
-
- final Ordering<ObjectAdapter> ordering =
- orderingBy(sortProperty, sort.isAscending());
- return ordering.sortedCopy(adapters);
- }
-
- private ObjectAssociation lookupAssociationFor(final SortParam<String> sort) {
-
- if(sort == null) {
- return null;
- }
-
- final ObjectSpecification elementSpec = model.getTypeOfSpecification();
- final String sortPropertyId = sort.getProperty();
-
- try {
- // might be null, or throw ex
- return elementSpec.getAssociation(sortPropertyId);
- } catch(ObjectSpecificationException ex) {
- // eg invalid propertyId
- return null;
- }
- }
-
- private Predicate<ObjectAdapter> ignoreHidden() {
- return new Predicate<ObjectAdapter>() {
- @Override
- public boolean apply(ObjectAdapter input) {
- final InteractionResult visibleResult = InteractionUtils.isVisibleResult(input.getSpecification(), createVisibleInteractionContext(input));
- return visibleResult.isNotVetoing();
- }
- };
- }
-
- private VisibilityContext<?> createVisibleInteractionContext(final ObjectAdapter objectAdapter) {
- return new ObjectVisibilityContext(
- getDeploymentCategory(),
- getAuthenticationSession(),
- InteractionInvocationMethod.BY_USER,
- objectAdapter,
- objectAdapter.getSpecification().getIdentifier(),
- Where.ALL_TABLES);
- }
-
- private static Ordering<ObjectAdapter> orderingBy(final ObjectAssociation sortProperty, final boolean ascending) {
- final Ordering<ObjectAdapter> ordering = new Ordering<ObjectAdapter>(){
-
- @Override
- public int compare(final ObjectAdapter p, final ObjectAdapter q) {
- final ObjectAdapter pSort = sortProperty.get(p);
- final ObjectAdapter qSort = sortProperty.get(q);
- Ordering<ObjectAdapter> naturalOrdering =
- ascending
- ? ORDERING_BY_NATURAL.nullsFirst()
- : ORDERING_BY_NATURAL.nullsLast();
- return naturalOrdering.compare(pSort, qSort);
- }
- };
- return ascending?ordering:ordering.reverse();
- }
-
- private static Ordering<ObjectAdapter> ORDERING_BY_NATURAL = new Ordering<ObjectAdapter>(){
- @Override
- public int compare(final ObjectAdapter p, final ObjectAdapter q) {
- final Object pPojo = p.getObject();
- final Object qPojo = q.getObject();
- if(!(pPojo instanceof Comparable) || !(qPojo instanceof Comparable)) {
- return 0;
- }
- return naturalOrdering(pPojo, qPojo);
- }
- @SuppressWarnings("rawtypes")
- private int naturalOrdering(final Object pPojo, final Object qPojo) {
- Comparable pComparable = (Comparable) pPojo;
- Comparable qComparable = (Comparable) qPojo;
- return Ordering.natural().compare(pComparable, qComparable);
- }
- };
-
- // //////////////////////////////////////
-
- protected AuthenticationSession getAuthenticationSession() {
- return IsisContext.getAuthenticationSession();
- }
-
- protected DeploymentCategory getDeploymentCategory() {
- return IsisContext.getDeploymentType().getDeploymentCategory();
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackDataTable.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackDataTable.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackDataTable.java
deleted file mode 100644
index 57580bd..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackDataTable.java
+++ /dev/null
@@ -1,213 +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.ajaxtable;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar;
-import org.apache.wicket.markup.ComponentTag;
-import org.apache.wicket.markup.repeater.IItemFactory;
-import org.apache.wicket.markup.repeater.IItemReuseStrategy;
-import org.apache.wicket.markup.repeater.Item;
-import org.apache.wicket.markup.repeater.OddEvenItem;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.util.lang.Generics;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.viewer.wicket.model.hints.IsisUiHintEvent;
-import org.apache.isis.viewer.wicket.model.hints.UiHintContainer;
-import org.apache.isis.viewer.wicket.model.hints.UiHintPathSignificant;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.util.CssClassAppender;
-
-public class IsisAjaxFallbackDataTable<T, S> extends DataTable<T, S> implements UiHintPathSignificant {
-
- private static final long serialVersionUID = 1L;
-
- static final String UIHINT_PAGE_NUMBER = "pageNumber";
-
- private final ISortableDataProvider<T, S> dataProvider;
-
- private IsisAjaxFallbackHeadersToolbar<S> headersToolbar;
-
- public IsisAjaxFallbackDataTable(final String id, final List<? extends IColumn<T, S>> columns,
- final ISortableDataProvider<T, S> dataProvider, final int rowsPerPage)
- {
- super(id, columns, dataProvider, rowsPerPage);
- this.dataProvider = dataProvider;
- setOutputMarkupId(true);
- setVersioned(false);
- setItemReuseStrategy(new PreserveModelReuseStrategy());
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
- buildGui();
- }
-
- private void buildGui() {
- headersToolbar = new IsisAjaxFallbackHeadersToolbar<>(this, this.dataProvider);
- addTopToolbar(headersToolbar);
- addBottomToolbar(new IsisAjaxNavigationToolbar(this));
- addBottomToolbar(new NoRecordsToolbar(this));
- }
-
- @Override
- protected Item<T> newRowItem(final String id, final int index, final IModel<T> model)
- {
- return new OddEvenItem<T>(id, index, model) {
- @Override
- protected void onComponentTag(ComponentTag tag) {
- super.onComponentTag(tag);
-
- if (model instanceof EntityModel) {
- EntityModel entityModel = (EntityModel) model;
- final ObjectAdapter objectAdapter = entityModel.getObject();
- final ObjectSpecification typeOfSpecification = entityModel.getTypeOfSpecification();
- String cssClass = typeOfSpecification.getCssClass(objectAdapter);
- CssClassAppender.appendCssClassTo(tag, cssClass);
- }
- }
- };
- }
-
- static class PreserveModelReuseStrategy implements IItemReuseStrategy {
- private static final long serialVersionUID = 1L;
-
- private static IItemReuseStrategy instance = new PreserveModelReuseStrategy();
-
- /**
- * @return static instance
- */
- public static IItemReuseStrategy getInstance()
- {
- return instance;
- }
-
- /**
- * @see org.apache.wicket.markup.repeater.IItemReuseStrategy#getItems(org.apache.wicket.markup.repeater.IItemFactory,
- * java.util.Iterator, java.util.Iterator)
- */
- @Override
- public <T> Iterator<Item<T>> getItems(final IItemFactory<T> factory,
- final Iterator<IModel<T>> newModels, Iterator<Item<T>> existingItems)
- {
- final Map<IModel<T>, Item<T>> modelToItem = Generics.newHashMap();
- while (existingItems.hasNext())
- {
- final Item<T> item = existingItems.next();
- modelToItem.put(item.getModel(), item);
- }
-
- return new Iterator<Item<T>>()
- {
- private int index = 0;
-
- @Override
- public boolean hasNext()
- {
- return newModels.hasNext();
- }
-
- @Override
- public Item<T> next()
- {
- final IModel<T> model = newModels.next();
- final Item<T> oldItem = modelToItem.get(model);
-
- final IModel<T> model2 = oldItem != null ? oldItem.getModel() : model;
- return factory.newItem(index++, model2);
- }
-
- @Override
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
- };
- }
-
- }
-
- public void honourHints() {
- UiHintContainer uiHintContainer = getUiHintContainer();
- if(uiHintContainer == null) {
- return;
- }
-
- headersToolbar.honourSortOrderHints();
-
- honourPageNumberHint(uiHintContainer);
- }
-
- private void honourPageNumberHint(final UiHintContainer uiHintContainer) {
- final String pageNumberStr = uiHintContainer.getHint(this, UIHINT_PAGE_NUMBER);
- if(pageNumberStr != null) {
- try {
- long pageNumber = Long.parseLong(pageNumberStr);
- if(pageNumber >= 0) {
- // dataTable is clever enough to deal with too-large numbers
- this.setCurrentPage(pageNumber);
- }
- } catch(Exception ex) {
- // ignore.
- }
- }
- uiHintContainer.setHint(this, UIHINT_PAGE_NUMBER, ""+getCurrentPage());
- // don't broadcast (no AjaxRequestTarget, still configuring initial setup)
- }
-
- public void setPageNumberHintAndBroadcast(AjaxRequestTarget target) {
- final UiHintContainer uiHintContainer = getUiHintContainer();
- if(uiHintContainer == null) {
- return;
- }
- uiHintContainer.setHint(this, IsisAjaxFallbackDataTable.UIHINT_PAGE_NUMBER, ""+getCurrentPage());
- send(getPage(), Broadcast.EXACT, new IsisUiHintEvent(uiHintContainer, target));
- }
-
- public void setSortOrderHintAndBroadcast(SortOrder order, String property, AjaxRequestTarget target) {
- final UiHintContainer uiHintContainer = getUiHintContainer();
- if(uiHintContainer == null) {
- return;
- }
-
- // first clear all SortOrder hints...
- for (SortOrder eachSortOrder : SortOrder.values()) {
- uiHintContainer.clearHint(this, eachSortOrder.name());
- }
- // .. then set this one
- uiHintContainer.setHint(this, order.name(), property);
- send(getPage(), Broadcast.EXACT, new IsisUiHintEvent(uiHintContainer, target));
- }
-
- private EntityModel getUiHintContainer() {
- return UiHintContainer.Util.hintContainerOf(this, EntityModel.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackHeadersToolbar.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackHeadersToolbar.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackHeadersToolbar.java
deleted file mode 100644
index 19c914d..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackHeadersToolbar.java
+++ /dev/null
@@ -1,90 +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.ajaxtable;
-
-import org.apache.wicket.ajax.attributes.IAjaxCallListener;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackHeadersToolbar;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.isis.viewer.wicket.model.hints.UiHintContainer;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-
-
-/**
- * Adapted from Wicket's own {@link AjaxFallbackHeadersToolbar}.
- */
-public class IsisAjaxFallbackHeadersToolbar<S> extends IsisAjaxHeadersToolbar<S>
-{
- private static final long serialVersionUID = 1L;
- private final ISortStateLocator<S> stateLocator;
- private IsisAjaxFallbackDataTable<?, S> table;
-
- public IsisAjaxFallbackHeadersToolbar(final IsisAjaxFallbackDataTable<?, S> table, final ISortStateLocator<S> stateLocator)
- {
- super(table, stateLocator);
- this.table = table;
- table.setOutputMarkupId(true);
- this.stateLocator = stateLocator;
- }
-
- @Override
- protected void onInitialize() {
- super.onInitialize();
- }
-
- // //////////////////////////////////////
-
- @Override
- protected WebMarkupContainer newSortableHeader(final String borderId, final S property,
- final ISortStateLocator<S> locator)
- {
- return new IsisAjaxFallbackOrderByBorder<S>(borderId, table, property, locator, getAjaxCallListener());
- }
-
- /**
- * Returns a decorator that will be used to decorate ajax links used in sortable headers
- *
- * @return decorator or null for none
- */
- protected IAjaxCallListener getAjaxCallListener()
- {
- return null;
- }
-
- // //////////////////////////////////////
-
- void honourSortOrderHints() {
- final UiHintContainer uiHintContainer = getUiHintContainer();
- if(uiHintContainer == null) {
- return;
- }
- for (SortOrder sortOrder : SortOrder.values()) {
- String property = uiHintContainer.getHint(table, sortOrder.name());
- if(property != null) {
- // bit hacky... how know this cast is safe?
- S propertyS = (S) property;
- stateLocator.getSortState().setPropertySortOrder(propertyS, sortOrder);
- }
- }
- }
-
- private EntityModel getUiHintContainer() {
- return UiHintContainer.Util.hintContainerOf(this, EntityModel.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackOrderByBorder.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackOrderByBorder.java b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackOrderByBorder.java
deleted file mode 100644
index dedcfdd..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxFallbackOrderByBorder.java
+++ /dev/null
@@ -1,73 +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.ajaxtable;
-
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.attributes.IAjaxCallListener;
-import org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByBorder;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByLink;
-import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
-
-import org.apache.isis.viewer.wicket.model.hints.UiHintContainer;
-
-public class IsisAjaxFallbackOrderByBorder<T> extends AjaxFallbackOrderByBorder<T> {
-
- private static final long serialVersionUID = 1L;
-
- private final T sortProperty;
- private final IsisAjaxFallbackDataTable<?, ?> dataTable;
-
- private final ISortStateLocator<T> stateLocator;
-
- public IsisAjaxFallbackOrderByBorder(String id, IsisAjaxFallbackDataTable<?, ?> dataTable, T sortProperty, ISortStateLocator<T> stateLocator, IAjaxCallListener ajaxCallListener) {
- super(id, sortProperty, stateLocator, new OrderByLink.VoidCssProvider<T>(), ajaxCallListener);
- this.dataTable = dataTable;
- this.stateLocator = stateLocator;
- this.sortProperty = sortProperty;
- }
-
- @Override
- protected void onAjaxClick(final AjaxRequestTarget target)
- {
- target.add(dataTable);
-
- final UiHintContainer uiHintContainer = getUiHintContainer();
- if(uiHintContainer == null) {
- return;
- }
-
- final ISortState<T> state = stateLocator.getSortState();
- final SortOrder order = state.getPropertySortOrder(sortProperty);
-
- dataTable.setSortOrderHintAndBroadcast(order, sortProperty.toString(), target);
- dataTable.setPageNumberHintAndBroadcast(target);
- }
-
- @Override
- protected void onSortChanged()
- {
- super.onSortChanged();
- // UI hint & event broadcast in onAjaxClick
- dataTable.setCurrentPage(0);
- }
-
- public UiHintContainer getUiHintContainer() {
- return UiHintContainer.Util.hintContainerOf(dataTable);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/99094b7e/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxHeadersToolbar.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxHeadersToolbar.html b/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxHeadersToolbar.html
deleted file mode 100644
index 5f8ddf4..0000000
--- a/core/viewer-wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/ajaxtable/IsisAjaxHeadersToolbar.html
+++ /dev/null
@@ -1,28 +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.
--->
-<wicket:panel xmlns:wicket="http://wicket.apache.org">
- <tr class="headers">
- <wicket:container wicket:id="headers">
- <th wicket:id="header">
- <div>
- <strong wicket:id="label">[header-label]</strong> <span wicket:id="sortIcon" style="float: right"></span>
- </div>
- </th>
- </wicket:container>
- </tr>
-</wicket:panel>