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 2012/12/04 23:31:01 UTC
[42/47] ISIS-188: normalizing file endings throughout
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.html
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.html b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.html
index b895b5e..df8cae4 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.html
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.html
@@ -1,32 +1,32 @@
-<?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>
- <body>
- <wicket:panel>
- <span wicket:id="entityLinkWrapper" class="entityIconAndTitlePanel entityIconAndTitleComponentType">
- <a href="#" wicket:id="entityLink">
- <img wicket:id="entityImage" class="entityImage"/>
- <span wicket:id="entityTitle" class="entityTitle">[title]</span>
- </a>
- </span>
- </wicket:panel>
- </body>
-</html>
-
+<?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>
+ <body>
+ <wicket:panel>
+ <span wicket:id="entityLinkWrapper" class="entityIconAndTitlePanel entityIconAndTitleComponentType">
+ <a href="#" wicket:id="entityLink">
+ <img wicket:id="entityImage" class="entityImage"/>
+ <span wicket:id="entityTitle" class="entityTitle">[title]</span>
+ </a>
+ </span>
+ </wicket:panel>
+ </body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
index 271a7ba..cd6bed2 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
@@ -1,147 +1,147 @@
-/*
- * 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.icontitle;
-
-import java.io.InputStream;
-
-import images.Images;
-
-import com.google.inject.Inject;
-
-import org.apache.wicket.Page;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.IResource;
-import org.apache.wicket.request.resource.PackageResourceReference;
-import org.apache.wicket.request.resource.ResourceReference;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
-import org.apache.isis.viewer.wicket.model.models.PageType;
-import org.apache.isis.viewer.wicket.ui.components.entity.EntityActionLinkFactory;
-import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
-import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-import org.apache.isis.viewer.wicket.ui.util.Links;
-
-/**
- * {@link PanelAbstract Panel} representing the icon and title of an entity,
- * as per the provided {@link EntityModel}.
- */
-public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_ENTITY_LINK_WRAPPER = "entityLinkWrapper";
- private static final String ID_ENTITY_LINK = "entityLink";
- private static final String ID_ENTITY_TITLE = "entityTitle";
- private static final String ID_ENTITY_ICON = "entityImage";
-
- private Label label;
- private Image image;
-
- public EntityIconAndTitlePanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
- }
-
- /**
- * For the {@link EntityActionLinkFactory}.
- */
- public EntityModel getEntityModel() {
- return getModel();
- }
-
- @Override
- protected void onBeforeRender() {
- buildGui();
- super.onBeforeRender();
- }
-
- private void buildGui() {
- addOrReplaceLinkWrapper();
- }
-
- private void addOrReplaceLinkWrapper() {
- final WebMarkupContainer entityLinkWrapper = addOrReplaceLinkWrapper(getModel());
- addOrReplace(entityLinkWrapper);
- }
-
- private WebMarkupContainer addOrReplaceLinkWrapper(final EntityModel entityModel) {
- final ObjectAdapter adapter = entityModel.getObject();
-
- final PageParameters pageParameters = EntityModel.createPageParameters(adapter);
- final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ENTITY);
- final AbstractLink link = newLink(ID_ENTITY_LINK, pageClass, pageParameters);
-
- label = new Label(ID_ENTITY_TITLE, determineTitle());
- 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);
-
- final WebMarkupContainer entityLinkWrapper = new WebMarkupContainer(ID_ENTITY_LINK_WRAPPER);
- entityLinkWrapper.addOrReplace(link);
- return entityLinkWrapper;
- }
-
- private String determineTitle() {
- final ObjectAdapter adapter = getModel().getObject();
- // TODO: i18n
- return adapter != null ? adapter.titleString() : "(no object)";
- }
-
- private AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
- return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
- }
-
-
- // ///////////////////////////////////////////////////////////////////
- // Convenience
- // ///////////////////////////////////////////////////////////////////
-
- protected PageClassRegistry getPageClassRegistry() {
- final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor) getApplication();
- return pcra.getPageClassRegistry();
- }
-
-
- // ///////////////////////////////////////////////
- // Dependency Injection
- // ///////////////////////////////////////////////
-
- @Inject
- private ImageResourceCache imageCache;
-
- protected ImageResourceCache getImageCache() {
- return imageCache;
- }
-
-}
+/*
+ * 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.icontitle;
+
+import java.io.InputStream;
+
+import images.Images;
+
+import com.google.inject.Inject;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.PackageResourceReference;
+import org.apache.wicket.request.resource.ResourceReference;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.model.models.ImageResourceCache;
+import org.apache.isis.viewer.wicket.model.models.PageType;
+import org.apache.isis.viewer.wicket.ui.components.entity.EntityActionLinkFactory;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistry;
+import org.apache.isis.viewer.wicket.ui.pages.PageClassRegistryAccessor;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+import org.apache.isis.viewer.wicket.ui.util.Links;
+
+/**
+ * {@link PanelAbstract Panel} representing the icon and title of an entity,
+ * as per the provided {@link EntityModel}.
+ */
+public class EntityIconAndTitlePanel extends PanelAbstract<EntityModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_ENTITY_LINK_WRAPPER = "entityLinkWrapper";
+ private static final String ID_ENTITY_LINK = "entityLink";
+ private static final String ID_ENTITY_TITLE = "entityTitle";
+ private static final String ID_ENTITY_ICON = "entityImage";
+
+ private Label label;
+ private Image image;
+
+ public EntityIconAndTitlePanel(final String id, final EntityModel entityModel) {
+ super(id, entityModel);
+ }
+
+ /**
+ * For the {@link EntityActionLinkFactory}.
+ */
+ public EntityModel getEntityModel() {
+ return getModel();
+ }
+
+ @Override
+ protected void onBeforeRender() {
+ buildGui();
+ super.onBeforeRender();
+ }
+
+ private void buildGui() {
+ addOrReplaceLinkWrapper();
+ }
+
+ private void addOrReplaceLinkWrapper() {
+ final WebMarkupContainer entityLinkWrapper = addOrReplaceLinkWrapper(getModel());
+ addOrReplace(entityLinkWrapper);
+ }
+
+ private WebMarkupContainer addOrReplaceLinkWrapper(final EntityModel entityModel) {
+ final ObjectAdapter adapter = entityModel.getObject();
+
+ final PageParameters pageParameters = EntityModel.createPageParameters(adapter);
+ final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ENTITY);
+ final AbstractLink link = newLink(ID_ENTITY_LINK, pageClass, pageParameters);
+
+ label = new Label(ID_ENTITY_TITLE, determineTitle());
+ 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);
+
+ final WebMarkupContainer entityLinkWrapper = new WebMarkupContainer(ID_ENTITY_LINK_WRAPPER);
+ entityLinkWrapper.addOrReplace(link);
+ return entityLinkWrapper;
+ }
+
+ private String determineTitle() {
+ final ObjectAdapter adapter = getModel().getObject();
+ // TODO: i18n
+ return adapter != null ? adapter.titleString() : "(no object)";
+ }
+
+ private AbstractLink newLink(final String linkId, final Class<? extends Page> pageClass, final PageParameters pageParameters) {
+ return Links.newBookmarkablePageLink(linkId, pageParameters, pageClass);
+ }
+
+
+ // ///////////////////////////////////////////////////////////////////
+ // Convenience
+ // ///////////////////////////////////////////////////////////////////
+
+ protected PageClassRegistry getPageClassRegistry() {
+ final PageClassRegistryAccessor pcra = (PageClassRegistryAccessor) getApplication();
+ return pcra.getPageClassRegistry();
+ }
+
+
+ // ///////////////////////////////////////////////
+ // Dependency Injection
+ // ///////////////////////////////////////////////
+
+ @Inject
+ private ImageResourceCache imageCache;
+
+ protected ImageResourceCache getImageCache() {
+ return imageCache;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanelFactory.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanelFactory.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanelFactory.java
index 66c8f0f..b8cd9d5 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanelFactory.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanelFactory.java
@@ -1,46 +1,46 @@
-/*
- * 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.icontitle;
-
-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;
-
-/**
- * {@link ComponentFactory} for {@link EntityIconAndTitlePanel}.
- */
-public class EntityIconAndTitlePanelFactory extends EntityComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public EntityIconAndTitlePanelFactory() {
- super(ComponentType.ENTITY_ICON_AND_TITLE);
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityModel entityModel = (EntityModel) model;
- return new EntityIconAndTitlePanel(id, entityModel);
- }
-}
+/*
+ * 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.icontitle;
+
+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;
+
+/**
+ * {@link ComponentFactory} for {@link EntityIconAndTitlePanel}.
+ */
+public class EntityIconAndTitlePanelFactory extends EntityComponentFactoryAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ public EntityIconAndTitlePanelFactory() {
+ super(ComponentType.ENTITY_ICON_AND_TITLE);
+ }
+
+ @Override
+ public Component createComponent(final String id, final IModel<?> model) {
+ final EntityModel entityModel = (EntityModel) model;
+ return new EntityIconAndTitlePanel(id, entityModel);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
index 1bde6a4..b62e09c 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesForm.java
@@ -16,342 +16,342 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.viewer.wicket.ui.components.entity.properties;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.Session;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.feedback.FeedbackMessage;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Button;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
-import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
-import org.apache.wicket.markup.html.panel.FeedbackPanel;
-import org.apache.wicket.markup.repeater.RepeatingView;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.util.visit.IVisit;
-import org.apache.wicket.util.visit.IVisitor;
-
-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.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociationFilters;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacet;
-import org.apache.isis.runtimes.dflt.runtime.memento.Memento;
-import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.model.util.ObjectAssociations;
-import org.apache.isis.viewer.wicket.model.util.ObjectSpecifications;
-import org.apache.isis.viewer.wicket.ui.ComponentType;
-import org.apache.isis.viewer.wicket.ui.components.widgets.formcomponent.CancelHintRequired;
-import org.apache.isis.viewer.wicket.ui.panels.AjaxButtonWithPreSubmitHook;
-import org.apache.isis.viewer.wicket.ui.panels.ButtonWithPreSubmitHook;
-import org.apache.isis.viewer.wicket.ui.panels.FormAbstract;
-import org.apache.isis.viewer.wicket.ui.util.EvenOrOddCssClassAppenderFactory;
-
-class EntityPropertiesForm extends FormAbstract<ObjectAdapter> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_MEMBER_GROUP = "memberGroup";
- private static final String ID_MEMBER_GROUP_NAME = "memberGroupName";
-
- private static final String ID_PROPERTIES = "properties";
- private static final String ID_PROPERTY = "property";
- private static final String ID_EDIT_BUTTON = "edit";
- private static final String ID_OK_BUTTON = "ok";
- private static final String ID_CANCEL_BUTTON = "cancel";
- private static final String ID_FEEDBACK = "feedback";
-
- private final Component owningPanel;
- private Button editButton;
- private Button okButton;
- private Button cancelButton;
- private FeedbackPanel feedback;
-
- public EntityPropertiesForm(final String id, final EntityModel entityModel, final Component owningPanel) {
- super(id, entityModel);
- this.owningPanel = owningPanel; // for repainting
-
- buildGui();
-
- // add any concurrency exception that might have been propogated into the entity model
- // as a result of a previous action invocation
- final String concurrencyExceptionIfAny = entityModel.getAndClearConcurrencyExceptionIfAny();
- if(concurrencyExceptionIfAny != null) {
- error(concurrencyExceptionIfAny);
- }
- }
-
- private void buildGui() {
- addPropertiesAndOrCollections();
- addButtons();
- addFeedbackGui();
-
- addValidator();
- }
-
- private void addPropertiesAndOrCollections() {
- final EntityModel entityModel = (EntityModel) getModel();
- final ObjectAdapter adapter = entityModel.getObject();
- final ObjectSpecification objSpec = adapter.getSpecification();
-
- final List<ObjectAssociation> associations = visibleAssociations(adapter, objSpec, Where.OBJECT_FORMS);
-
- final RepeatingView memberGroupRv = new RepeatingView(ID_MEMBER_GROUP);
- add(memberGroupRv);
-
- Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociations.groupByMemberOrderName(associations);
- final List<String> groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet());
-
- for(String groupName: groupNames) {
- final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
-
- final WebMarkupContainer memberGroupRvContainer = new WebMarkupContainer(memberGroupRv.newChildId());
- memberGroupRv.add(memberGroupRvContainer);
- memberGroupRvContainer.add(new Label(ID_MEMBER_GROUP_NAME, groupName));
-
-
- final RepeatingView propertyRv = new RepeatingView(ID_PROPERTIES);
- final EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
- memberGroupRvContainer.add(propertyRv);
-
- @SuppressWarnings("unused")
- Component component;
- for (final ObjectAssociation association : associationsInGroup) {
- final WebMarkupContainer propertyRvContainer = new WebMarkupContainer(propertyRv.newChildId());
- propertyRv.add(propertyRvContainer);
- propertyRvContainer.add(eo.nextClass());
- addPropertyToForm(entityModel, association, propertyRvContainer);
- }
- }
- }
-
- private void addPropertyToForm(final EntityModel entityModel,
- final ObjectAssociation association,
- final WebMarkupContainer container) {
- final OneToOneAssociation otoa = (OneToOneAssociation) association;
- final PropertyMemento pm = new PropertyMemento(otoa);
-
- final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
- getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
- }
-
- private List<ObjectAssociation> visibleAssociations(final ObjectAdapter adapter, final ObjectSpecification objSpec, Where where) {
- return objSpec.getAssociations(visibleAssociationFilter(adapter, where));
- }
-
- @SuppressWarnings("unchecked")
- private Filter<ObjectAssociation> visibleAssociationFilter(final ObjectAdapter adapter, Where where) {
- return Filters.and(ObjectAssociationFilters.PROPERTIES, ObjectAssociationFilters.dynamicallyVisible(getAuthenticationSession(), adapter, where));
- }
-
- private void addButtons() {
- editButton = new AjaxButtonWithPreSubmitHook(ID_EDIT_BUTTON, Model.of("Edit")) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void preSubmit() {
- getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.NO_CHECK);
- }
-
- @Override
- public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- getEntityModel().resetPropertyModels();
- toEditMode(target);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- toEditMode(target);
- }
- };
- add(editButton);
-
- okButton = new ButtonWithPreSubmitHook(ID_OK_BUTTON, Model.of("OK")) {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void preSubmit() {
- try {
- getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.CHECK);
- } catch(ConcurrencyException ex){
- Session.get().getFeedbackMessages().add(new FeedbackMessage(EntityPropertiesForm.this, ex.getMessage(), FeedbackMessage.ERROR));
- }
- }
-
- @Override
- public void onSubmit() {
- if (!getForm().hasError()) {
- final ObjectAdapter object = getEntityModel().getObject();
- final Memento snapshotToRollbackToIfInvalid = new Memento(object);
- // to perform object-level validation, we must apply the
- // changes first
- // contrast this with ActionPanel (for validating action
- // arguments) where
- // we do the validation prior to the execution of the
- // action
- getEntityModel().apply();
- final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
- if (invalidReasonIfAny != null) {
- getForm().error(invalidReasonIfAny);
- snapshotToRollbackToIfInvalid.recreateObject();
- return;
- } else {
- getEntityModel().resetPropertyModels();
- toViewMode(null);
- }
- } else {
- // stay in edit mode
- }
- }
-
- };
- add(okButton);
-
- cancelButton = new AjaxButtonWithPreSubmitHook(ID_CANCEL_BUTTON, Model.of("Cancel")) {
- private static final long serialVersionUID = 1L;
-
- {
- setDefaultFormProcessing(false);
- }
-
- @Override
- public void preSubmit() {
- getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.NO_CHECK);
- }
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- Session.get().getFeedbackMessages().clear();
- getForm().clearInput();
- getForm().visitFormComponentsPostOrder(new IVisitor<FormComponent<?>, Void>() {
-
- @Override
- public void component(FormComponent<?> formComponent, IVisit<Void> visit) {
- if (formComponent instanceof CancelHintRequired) {
- final CancelHintRequired cancelHintRequired = (CancelHintRequired) formComponent;
- cancelHintRequired.onCancel();
- }
- }
- });
- getEntityModel().resetPropertyModels();
- toViewMode(target);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- toViewMode(target);
- }
- };
- add(cancelButton);
-
- editButton.setOutputMarkupPlaceholderTag(true);
- cancelButton.setOutputMarkupPlaceholderTag(true);
- }
-
- private void requestRepaintPanel(final AjaxRequestTarget target) {
- if (target != null) {
- target.add(owningPanel);
- // TODO: is it necessary to add these too?
- target.add(editButton, okButton, cancelButton, feedback);
- }
- }
-
- private void addValidator() {
- add(new AbstractFormValidator() {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public FormComponent<?>[] getDependentFormComponents() {
- return new FormComponent<?>[0];
- }
-
- @Override
- public void validate(final Form<?> form) {
- final EntityModel entityModel = (EntityModel) getModel();
- String invalidReasonIfAny;
- try {
- final ObjectAdapter adapter = entityModel.getObject();
- final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
- if (facet == null) {
- return;
- }
- invalidReasonIfAny = facet.invalidReason(adapter);
- } catch(ConcurrencyException ex) {
- invalidReasonIfAny = ex.getMessage();
- }
- if (invalidReasonIfAny != null) {
- Session.get().getFeedbackMessages().add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
- }
- }
- });
- }
-
- private EntityModel getEntityModel() {
- return (EntityModel) getModel();
- }
-
- void toViewMode(final AjaxRequestTarget target) {
- getEntityModel().toViewMode();
- editButton.setVisible(isAnythingEditable());
- okButton.setVisible(false);
- cancelButton.setVisible(false);
- requestRepaintPanel(target);
- }
-
- private boolean isAnythingEditable() {
- final EntityModel entityModel = (EntityModel) getModel();
- final ObjectAdapter adapter = entityModel.getObject();
-
- return !enabledAssociations(adapter, adapter.getSpecification()).isEmpty();
- }
-
- private List<ObjectAssociation> enabledAssociations(final ObjectAdapter adapter, final ObjectSpecification objSpec) {
- return objSpec.getAssociations(enabledAssociationFilter(adapter));
- }
-
- @SuppressWarnings("unchecked")
- private Filter<ObjectAssociation> enabledAssociationFilter(final ObjectAdapter adapter) {
- return Filters.and(ObjectAssociationFilters.PROPERTIES, ObjectAssociationFilters.enabled(getAuthenticationSession(), adapter, Where.OBJECT_FORMS));
- }
-
- private void toEditMode(final AjaxRequestTarget target) {
- getEntityModel().toEditMode();
- editButton.setVisible(false);
- okButton.setVisible(true);
- cancelButton.setVisible(true);
- requestRepaintPanel(target);
- }
-
-
- private void addFeedbackGui() {
- final FeedbackPanel feedback = addOrReplaceFeedback();
-
- final ObjectAdapter adapter = getEntityModel().getObject();
- if (adapter == null) {
- feedback.error("cannot locate object:" + getEntityModel().getObjectAdapterMemento().toString());
- }
- }
-
- private FeedbackPanel addOrReplaceFeedback() {
- feedback = new ComponentFeedbackPanel(ID_FEEDBACK, this);
- feedback.setOutputMarkupPlaceholderTag(true);
- addOrReplace(feedback);
- return feedback;
- }
+package org.apache.isis.viewer.wicket.ui.components.entity.properties;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.Session;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.feedback.FeedbackMessage;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.validation.AbstractFormValidator;
+import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.repeater.RepeatingView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.util.visit.IVisit;
+import org.apache.wicket.util.visit.IVisitor;
+
+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.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAssociationFilters;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.core.progmodel.facets.object.validate.ValidateObjectFacet;
+import org.apache.isis.runtimes.dflt.runtime.memento.Memento;
+import org.apache.isis.viewer.wicket.model.mementos.PropertyMemento;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+import org.apache.isis.viewer.wicket.model.util.ObjectAssociations;
+import org.apache.isis.viewer.wicket.model.util.ObjectSpecifications;
+import org.apache.isis.viewer.wicket.ui.ComponentType;
+import org.apache.isis.viewer.wicket.ui.components.widgets.formcomponent.CancelHintRequired;
+import org.apache.isis.viewer.wicket.ui.panels.AjaxButtonWithPreSubmitHook;
+import org.apache.isis.viewer.wicket.ui.panels.ButtonWithPreSubmitHook;
+import org.apache.isis.viewer.wicket.ui.panels.FormAbstract;
+import org.apache.isis.viewer.wicket.ui.util.EvenOrOddCssClassAppenderFactory;
+
+class EntityPropertiesForm extends FormAbstract<ObjectAdapter> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_MEMBER_GROUP = "memberGroup";
+ private static final String ID_MEMBER_GROUP_NAME = "memberGroupName";
+
+ private static final String ID_PROPERTIES = "properties";
+ private static final String ID_PROPERTY = "property";
+ private static final String ID_EDIT_BUTTON = "edit";
+ private static final String ID_OK_BUTTON = "ok";
+ private static final String ID_CANCEL_BUTTON = "cancel";
+ private static final String ID_FEEDBACK = "feedback";
+
+ private final Component owningPanel;
+ private Button editButton;
+ private Button okButton;
+ private Button cancelButton;
+ private FeedbackPanel feedback;
+
+ public EntityPropertiesForm(final String id, final EntityModel entityModel, final Component owningPanel) {
+ super(id, entityModel);
+ this.owningPanel = owningPanel; // for repainting
+
+ buildGui();
+
+ // add any concurrency exception that might have been propogated into the entity model
+ // as a result of a previous action invocation
+ final String concurrencyExceptionIfAny = entityModel.getAndClearConcurrencyExceptionIfAny();
+ if(concurrencyExceptionIfAny != null) {
+ error(concurrencyExceptionIfAny);
+ }
+ }
+
+ private void buildGui() {
+ addPropertiesAndOrCollections();
+ addButtons();
+ addFeedbackGui();
+
+ addValidator();
+ }
+
+ private void addPropertiesAndOrCollections() {
+ final EntityModel entityModel = (EntityModel) getModel();
+ final ObjectAdapter adapter = entityModel.getObject();
+ final ObjectSpecification objSpec = adapter.getSpecification();
+
+ final List<ObjectAssociation> associations = visibleAssociations(adapter, objSpec, Where.OBJECT_FORMS);
+
+ final RepeatingView memberGroupRv = new RepeatingView(ID_MEMBER_GROUP);
+ add(memberGroupRv);
+
+ Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociations.groupByMemberOrderName(associations);
+ final List<String> groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet());
+
+ for(String groupName: groupNames) {
+ final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
+
+ final WebMarkupContainer memberGroupRvContainer = new WebMarkupContainer(memberGroupRv.newChildId());
+ memberGroupRv.add(memberGroupRvContainer);
+ memberGroupRvContainer.add(new Label(ID_MEMBER_GROUP_NAME, groupName));
+
+
+ final RepeatingView propertyRv = new RepeatingView(ID_PROPERTIES);
+ final EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
+ memberGroupRvContainer.add(propertyRv);
+
+ @SuppressWarnings("unused")
+ Component component;
+ for (final ObjectAssociation association : associationsInGroup) {
+ final WebMarkupContainer propertyRvContainer = new WebMarkupContainer(propertyRv.newChildId());
+ propertyRv.add(propertyRvContainer);
+ propertyRvContainer.add(eo.nextClass());
+ addPropertyToForm(entityModel, association, propertyRvContainer);
+ }
+ }
+ }
+
+ private void addPropertyToForm(final EntityModel entityModel,
+ final ObjectAssociation association,
+ final WebMarkupContainer container) {
+ final OneToOneAssociation otoa = (OneToOneAssociation) association;
+ final PropertyMemento pm = new PropertyMemento(otoa);
+
+ final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
+ getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
+ }
+
+ private List<ObjectAssociation> visibleAssociations(final ObjectAdapter adapter, final ObjectSpecification objSpec, Where where) {
+ return objSpec.getAssociations(visibleAssociationFilter(adapter, where));
+ }
+
+ @SuppressWarnings("unchecked")
+ private Filter<ObjectAssociation> visibleAssociationFilter(final ObjectAdapter adapter, Where where) {
+ return Filters.and(ObjectAssociationFilters.PROPERTIES, ObjectAssociationFilters.dynamicallyVisible(getAuthenticationSession(), adapter, where));
+ }
+
+ private void addButtons() {
+ editButton = new AjaxButtonWithPreSubmitHook(ID_EDIT_BUTTON, Model.of("Edit")) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void preSubmit() {
+ getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.NO_CHECK);
+ }
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ getEntityModel().resetPropertyModels();
+ toEditMode(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ toEditMode(target);
+ }
+ };
+ add(editButton);
+
+ okButton = new ButtonWithPreSubmitHook(ID_OK_BUTTON, Model.of("OK")) {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void preSubmit() {
+ try {
+ getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.CHECK);
+ } catch(ConcurrencyException ex){
+ Session.get().getFeedbackMessages().add(new FeedbackMessage(EntityPropertiesForm.this, ex.getMessage(), FeedbackMessage.ERROR));
+ }
+ }
+
+ @Override
+ public void onSubmit() {
+ if (!getForm().hasError()) {
+ final ObjectAdapter object = getEntityModel().getObject();
+ final Memento snapshotToRollbackToIfInvalid = new Memento(object);
+ // to perform object-level validation, we must apply the
+ // changes first
+ // contrast this with ActionPanel (for validating action
+ // arguments) where
+ // we do the validation prior to the execution of the
+ // action
+ getEntityModel().apply();
+ final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
+ if (invalidReasonIfAny != null) {
+ getForm().error(invalidReasonIfAny);
+ snapshotToRollbackToIfInvalid.recreateObject();
+ return;
+ } else {
+ getEntityModel().resetPropertyModels();
+ toViewMode(null);
+ }
+ } else {
+ // stay in edit mode
+ }
+ }
+
+ };
+ add(okButton);
+
+ cancelButton = new AjaxButtonWithPreSubmitHook(ID_CANCEL_BUTTON, Model.of("Cancel")) {
+ private static final long serialVersionUID = 1L;
+
+ {
+ setDefaultFormProcessing(false);
+ }
+
+ @Override
+ public void preSubmit() {
+ getEntityModel().getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.NO_CHECK);
+ }
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ Session.get().getFeedbackMessages().clear();
+ getForm().clearInput();
+ getForm().visitFormComponentsPostOrder(new IVisitor<FormComponent<?>, Void>() {
+
+ @Override
+ public void component(FormComponent<?> formComponent, IVisit<Void> visit) {
+ if (formComponent instanceof CancelHintRequired) {
+ final CancelHintRequired cancelHintRequired = (CancelHintRequired) formComponent;
+ cancelHintRequired.onCancel();
+ }
+ }
+ });
+ getEntityModel().resetPropertyModels();
+ toViewMode(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ toViewMode(target);
+ }
+ };
+ add(cancelButton);
+
+ editButton.setOutputMarkupPlaceholderTag(true);
+ cancelButton.setOutputMarkupPlaceholderTag(true);
+ }
+
+ private void requestRepaintPanel(final AjaxRequestTarget target) {
+ if (target != null) {
+ target.add(owningPanel);
+ // TODO: is it necessary to add these too?
+ target.add(editButton, okButton, cancelButton, feedback);
+ }
+ }
+
+ private void addValidator() {
+ add(new AbstractFormValidator() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FormComponent<?>[] getDependentFormComponents() {
+ return new FormComponent<?>[0];
+ }
+
+ @Override
+ public void validate(final Form<?> form) {
+ final EntityModel entityModel = (EntityModel) getModel();
+ String invalidReasonIfAny;
+ try {
+ final ObjectAdapter adapter = entityModel.getObject();
+ final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
+ if (facet == null) {
+ return;
+ }
+ invalidReasonIfAny = facet.invalidReason(adapter);
+ } catch(ConcurrencyException ex) {
+ invalidReasonIfAny = ex.getMessage();
+ }
+ if (invalidReasonIfAny != null) {
+ Session.get().getFeedbackMessages().add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
+ }
+ }
+ });
+ }
+
+ private EntityModel getEntityModel() {
+ return (EntityModel) getModel();
+ }
+
+ void toViewMode(final AjaxRequestTarget target) {
+ getEntityModel().toViewMode();
+ editButton.setVisible(isAnythingEditable());
+ okButton.setVisible(false);
+ cancelButton.setVisible(false);
+ requestRepaintPanel(target);
+ }
+
+ private boolean isAnythingEditable() {
+ final EntityModel entityModel = (EntityModel) getModel();
+ final ObjectAdapter adapter = entityModel.getObject();
+
+ return !enabledAssociations(adapter, adapter.getSpecification()).isEmpty();
+ }
+
+ private List<ObjectAssociation> enabledAssociations(final ObjectAdapter adapter, final ObjectSpecification objSpec) {
+ return objSpec.getAssociations(enabledAssociationFilter(adapter));
+ }
+
+ @SuppressWarnings("unchecked")
+ private Filter<ObjectAssociation> enabledAssociationFilter(final ObjectAdapter adapter) {
+ return Filters.and(ObjectAssociationFilters.PROPERTIES, ObjectAssociationFilters.enabled(getAuthenticationSession(), adapter, Where.OBJECT_FORMS));
+ }
+
+ private void toEditMode(final AjaxRequestTarget target) {
+ getEntityModel().toEditMode();
+ editButton.setVisible(false);
+ okButton.setVisible(true);
+ cancelButton.setVisible(true);
+ requestRepaintPanel(target);
+ }
+
+
+ private void addFeedbackGui() {
+ final FeedbackPanel feedback = addOrReplaceFeedback();
+
+ final ObjectAdapter adapter = getEntityModel().getObject();
+ if (adapter == null) {
+ feedback.error("cannot locate object:" + getEntityModel().getObjectAdapterMemento().toString());
+ }
+ }
+
+ private FeedbackPanel addOrReplaceFeedback() {
+ feedback = new ComponentFeedbackPanel(ID_FEEDBACK, this);
+ feedback.setOutputMarkupPlaceholderTag(true);
+ addOrReplace(feedback);
+ return feedback;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
index 83d1efb..322a526 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.html
@@ -1,45 +1,45 @@
-<?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>
- <body>
- <wicket:panel>
- <div class="entityPropertiesPanel entityPropertiesComponentType myBlockContainer">
- <form wicket:id="entityProperties" class="inputForm">
- <div class="inputFormTable properties">
- <fieldset wicket:id="memberGroup" class="memberGroup">
- <legend wicket:id="memberGroupName">[group name]</legend>
- <div wicket:id="properties">
- <div wicket:id="property" class="property">[property]</div>
- </div>
- </fieldset>
- </div>
- <div class="feedbackPanel">
- <span wicket:id="feedback"/>
- </div>
- <div class="buttons">
- <input type="submit" class="edit" wicket:id="edit"/>
- <input type="submit" class="ok" wicket:id="ok"/>
- <input type="submit" class="cancel" wicket:id="cancel"/>
- </div>
- </form>
- </div>
- </wicket:panel>
- </body>
-</html>
+<?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>
+ <body>
+ <wicket:panel>
+ <div class="entityPropertiesPanel entityPropertiesComponentType myBlockContainer">
+ <form wicket:id="entityProperties" class="inputForm">
+ <div class="inputFormTable properties">
+ <fieldset wicket:id="memberGroup" class="memberGroup">
+ <legend wicket:id="memberGroupName">[group name]</legend>
+ <div wicket:id="properties">
+ <div wicket:id="property" class="property">[property]</div>
+ </div>
+ </fieldset>
+ </div>
+ <div class="feedbackPanel">
+ <span wicket:id="feedback"/>
+ </div>
+ <div class="buttons">
+ <input type="submit" class="edit" wicket:id="edit"/>
+ <input type="submit" class="ok" wicket:id="ok"/>
+ <input type="submit" class="cancel" wicket:id="cancel"/>
+ </div>
+ </form>
+ </div>
+ </wicket:panel>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.java
index 7bd9772..ed2e440 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanel.java
@@ -1,63 +1,63 @@
-/*
- * 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.properties;
-
-
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.wicket.model.models.EntityModel;
-import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
-
-/**
- * {@link PanelAbstract Panel} representing the properties of an entity, as per
- * the provided {@link EntityModel}.
- */
-public class EntityPropertiesPanel extends PanelAbstract<EntityModel> {
-
- private static final long serialVersionUID = 1L;
-
- private static final String ID_ENTITY_PROPERTIES = "entityProperties";
-
-
- private EntityPropertiesForm form;
-
- public EntityPropertiesPanel(final String id, final EntityModel entityModel) {
- super(id, entityModel);
- buildGui();
- form.toViewMode(null);
- }
-
- private void buildGui() {
- buildEntityPropertiesAndOrCollectionsGui();
- setOutputMarkupId(true); // so can repaint via ajax
- }
-
- private void buildEntityPropertiesAndOrCollectionsGui() {
- final EntityModel model = getModel();
- final ObjectAdapter adapter = model.getObject();
- if (adapter != null) {
- form = new EntityPropertiesForm(ID_ENTITY_PROPERTIES, model, this);
- addOrReplace(form);
- } else {
- permanentlyHide(ID_ENTITY_PROPERTIES);
- }
- }
-
-}
+/*
+ * 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.properties;
+
+
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.wicket.model.models.EntityModel;
+import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
+
+/**
+ * {@link PanelAbstract Panel} representing the properties of an entity, as per
+ * the provided {@link EntityModel}.
+ */
+public class EntityPropertiesPanel extends PanelAbstract<EntityModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String ID_ENTITY_PROPERTIES = "entityProperties";
+
+
+ private EntityPropertiesForm form;
+
+ public EntityPropertiesPanel(final String id, final EntityModel entityModel) {
+ super(id, entityModel);
+ buildGui();
+ form.toViewMode(null);
+ }
+
+ private void buildGui() {
+ buildEntityPropertiesAndOrCollectionsGui();
+ setOutputMarkupId(true); // so can repaint via ajax
+ }
+
+ private void buildEntityPropertiesAndOrCollectionsGui() {
+ final EntityModel model = getModel();
+ final ObjectAdapter adapter = model.getObject();
+ if (adapter != null) {
+ form = new EntityPropertiesForm(ID_ENTITY_PROPERTIES, model, this);
+ addOrReplace(form);
+ } else {
+ permanentlyHide(ID_ENTITY_PROPERTIES);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanelFactory.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanelFactory.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanelFactory.java
index 0aec2f9..9976ed2 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanelFactory.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/properties/EntityPropertiesPanelFactory.java
@@ -1,46 +1,46 @@
-/*
- * 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.properties;
-
-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;
-
-/**
- * {@link ComponentFactory} for {@link EntityPropertiesPanel}.
- */
-public class EntityPropertiesPanelFactory extends EntityComponentFactoryAbstract {
-
- private static final long serialVersionUID = 1L;
-
- public EntityPropertiesPanelFactory() {
- super(ComponentType.ENTITY_PROPERTIES);
- }
-
- @Override
- public Component createComponent(final String id, final IModel<?> model) {
- final EntityModel entityModel = (EntityModel) model;
- return new EntityPropertiesPanel(id, entityModel);
- }
-}
+/*
+ * 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.properties;
+
+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;
+
+/**
+ * {@link ComponentFactory} for {@link EntityPropertiesPanel}.
+ */
+public class EntityPropertiesPanelFactory extends EntityComponentFactoryAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ public EntityPropertiesPanelFactory() {
+ super(ComponentType.ENTITY_PROPERTIES);
+ }
+
+ @Override
+ public Component createComponent(final String id, final IModel<?> model) {
+ final EntityModel entityModel = (EntityModel) model;
+ return new EntityPropertiesPanel(id, entityModel);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldNumeric.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldNumeric.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldNumeric.java
index 14798e6..c50062a 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldNumeric.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelTextFieldNumeric.java
@@ -1,76 +1,76 @@
-/*
- * 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.scalars;
-
-import java.io.Serializable;
-
-import org.apache.wicket.Component;
-import org.apache.wicket.markup.html.form.AbstractTextComponent;
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.IModel;
-
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-
-/**
- * Panel for rendering numeric scalars.
- */
-public abstract class ScalarPanelTextFieldNumeric<T extends Serializable> extends ScalarPanelTextFieldAbstract<T> {
-
- private static final long serialVersionUID = 1L;
- private static final String ID_SCALAR_VALUE = "scalarValue";
-
- public ScalarPanelTextFieldNumeric(final String id, final ScalarModel scalarModel, final Class<T> cls) {
- super(id, scalarModel, cls);
- }
-
- @Override
- protected void addSemantics() {
- super.addSemantics();
-
- }
-
- @Override
- protected AbstractTextComponent<T> createTextField() {
- return createTextField(ID_SCALAR_VALUE);
- }
-
- /**
- * Helper method for subtypes.
- */
- protected TextField<T> createTextField(final String id) {
- return new TextField<T>(id, new TextFieldValueModel<T>(this), cls);
- }
-
- //@SuppressWarnings("unchecked")
- protected Component addComponentForCompact() {
- final AbstractTextComponent<T> textField = createTextField(ID_SCALAR_IF_COMPACT);
- final IModel<T> model = textField.getModel();
- final T object = (T) model.getObject();
- //model.setObject((T) (object != null? object.getObject(): null));
- model.setObject(object);
-
- textField.setEnabled(false);
- setTextFieldSizeIfSpecified(textField);
-
- addOrReplace(textField);
- return textField;
- }
-
-}
+/*
+ * 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.scalars;
+
+import java.io.Serializable;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.markup.html.form.AbstractTextComponent;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.IModel;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+/**
+ * Panel for rendering numeric scalars.
+ */
+public abstract class ScalarPanelTextFieldNumeric<T extends Serializable> extends ScalarPanelTextFieldAbstract<T> {
+
+ private static final long serialVersionUID = 1L;
+ private static final String ID_SCALAR_VALUE = "scalarValue";
+
+ public ScalarPanelTextFieldNumeric(final String id, final ScalarModel scalarModel, final Class<T> cls) {
+ super(id, scalarModel, cls);
+ }
+
+ @Override
+ protected void addSemantics() {
+ super.addSemantics();
+
+ }
+
+ @Override
+ protected AbstractTextComponent<T> createTextField() {
+ return createTextField(ID_SCALAR_VALUE);
+ }
+
+ /**
+ * Helper method for subtypes.
+ */
+ protected TextField<T> createTextField(final String id) {
+ return new TextField<T>(id, new TextFieldValueModel<T>(this), cls);
+ }
+
+ //@SuppressWarnings("unchecked")
+ protected Component addComponentForCompact() {
+ final AbstractTextComponent<T> textField = createTextField(ID_SCALAR_IF_COMPACT);
+ final IModel<T> model = textField.getModel();
+ final T object = (T) model.getObject();
+ //model.setObject((T) (object != null? object.getObject(): null));
+ model.setObject(object);
+
+ textField.setEnabled(false);
+ setTextFieldSizeIfSpecified(textField);
+
+ addOrReplace(textField);
+ return textField;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/TextFieldValueModel.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/TextFieldValueModel.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/TextFieldValueModel.java
index f02f8c1..fd1c044 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/TextFieldValueModel.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/TextFieldValueModel.java
@@ -16,55 +16,55 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.viewer.wicket.ui.components.scalars;
-
-import java.io.Serializable;
-
-import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.model.Model;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-
-/**
- * For custom {@link ScalarPanelTextFieldAbstract}s to use as the {@link Model}
- * of their {@link TextField} (as constructed in {@link ScalarPanelTextFieldAbstract#createTextField()}).
- */
-public class TextFieldValueModel<T extends Serializable> extends Model<T> {
-
- private static final long serialVersionUID = 1L;
-
- public interface ScalarModelProvider {
- ScalarModel getModel();
- AdapterManager getAdapterManager();
- }
-
- private final ScalarModelProvider scalarModelProvider;
-
- public TextFieldValueModel(ScalarModelProvider scalarModelProvider) {
- this.scalarModelProvider = scalarModelProvider;
- }
-
- @Override
- public T getObject() {
- final ScalarModel model = scalarModelProvider.getModel();
- final ObjectAdapter objectAdapter = model.getObject();
- return asT(objectAdapter);
- }
-
- @SuppressWarnings("unchecked")
- private T asT(final ObjectAdapter objectAdapter) {
- return (T) (objectAdapter != null? objectAdapter.getObject(): null);
- }
-
- @Override
- public void setObject(final T object) {
- if (object == null) {
- scalarModelProvider.getModel().setObject(null);
- } else {
- final ObjectAdapter objectAdapter = scalarModelProvider.getAdapterManager().adapterFor(object);
- scalarModelProvider.getModel().setObject(objectAdapter);
- }
- }
+package org.apache.isis.viewer.wicket.ui.components.scalars;
+
+import java.io.Serializable;
+
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.Model;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+
+/**
+ * For custom {@link ScalarPanelTextFieldAbstract}s to use as the {@link Model}
+ * of their {@link TextField} (as constructed in {@link ScalarPanelTextFieldAbstract#createTextField()}).
+ */
+public class TextFieldValueModel<T extends Serializable> extends Model<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ public interface ScalarModelProvider {
+ ScalarModel getModel();
+ AdapterManager getAdapterManager();
+ }
+
+ private final ScalarModelProvider scalarModelProvider;
+
+ public TextFieldValueModel(ScalarModelProvider scalarModelProvider) {
+ this.scalarModelProvider = scalarModelProvider;
+ }
+
+ @Override
+ public T getObject() {
+ final ScalarModel model = scalarModelProvider.getModel();
+ final ObjectAdapter objectAdapter = model.getObject();
+ return asT(objectAdapter);
+ }
+
+ @SuppressWarnings("unchecked")
+ private T asT(final ObjectAdapter objectAdapter) {
+ return (T) (objectAdapter != null? objectAdapter.getObject(): null);
+ }
+
+ @Override
+ public void setObject(final T object) {
+ if (object == null) {
+ scalarModelProvider.getModel().setObject(null);
+ } else {
+ final ObjectAdapter objectAdapter = scalarModelProvider.getAdapterManager().adapterFor(object);
+ scalarModelProvider.getModel().setObject(objectAdapter);
+ }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.css
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.css b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.css
index 78c4bde..eaeea17 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.css
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.css
@@ -1,18 +1,18 @@
-/*
- * 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.
- */
+/*
+ * 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.
+ */
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.html
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.html b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.html
index 55e3630..12b5bfd 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.html
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.html
@@ -1,40 +1,40 @@
-<?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="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:panel>
- <div class="javaLocalDatePanel scalarNameAndValueComponentType">
- <label for="scalarValue" wicket:id="scalarIfRegular">
- <span wicket:id="scalarName" class="scalarName">[Label text]</span>
- <span class="scalarValue">
- <input type="text" name="scalarValue" wicket:id="scalarValue" />
- <span wicket:id="feedback"></span>
- </span>
- </label>
- <label wicket:id="scalarIfCompact"></label>
- </div>
- </wicket:panel>
- </body>
-</html>
+<?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="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:panel>
+ <div class="javaLocalDatePanel scalarNameAndValueComponentType">
+ <label for="scalarValue" wicket:id="scalarIfRegular">
+ <span wicket:id="scalarName" class="scalarName">[Label text]</span>
+ <span class="scalarValue">
+ <input type="text" name="scalarValue" wicket:id="scalarValue" />
+ <span wicket:id="feedback"></span>
+ </span>
+ </label>
+ <label wicket:id="scalarIfCompact"></label>
+ </div>
+ </wicket:panel>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/211aee9b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
----------------------------------------------------------------------
diff --git a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
index f5e4567..ccf6583 100644
--- a/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
+++ b/framework/viewer/wicket/wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/jodatime/JodaLocalDatePanel.java
@@ -1,52 +1,52 @@
-/*
- * 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.scalars.jodatime;
-
-import java.util.Date;
-
-import org.joda.time.LocalDate;
-
-import org.apache.isis.viewer.wicket.model.models.ScalarModel;
-import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldDatePickerAbstract;
-
-/**
- * Panel for rendering scalars of type {@link LocalDate}.
- */
-public class JodaLocalDatePanel extends ScalarPanelTextFieldDatePickerAbstract<LocalDate> {
-
- private static final long serialVersionUID = 1L;
- private static final String ID_SCALAR_VALUE = "scalarValue";
-
- public JodaLocalDatePanel(final String id, final ScalarModel scalarModel) {
- super(id, ID_SCALAR_VALUE, scalarModel);
- }
-
- @Override
- protected Date asDate(LocalDate pojo) {
- return pojo.toDateTimeAtStartOfDay().toDate();
- }
-
- @Override
- protected LocalDate asPojo(Date date) {
- return new LocalDate(date.getTime());
- }
-
-
-}
+/*
+ * 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.scalars.jodatime;
+
+import java.util.Date;
+
+import org.joda.time.LocalDate;
+
+import org.apache.isis.viewer.wicket.model.models.ScalarModel;
+import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldDatePickerAbstract;
+
+/**
+ * Panel for rendering scalars of type {@link LocalDate}.
+ */
+public class JodaLocalDatePanel extends ScalarPanelTextFieldDatePickerAbstract<LocalDate> {
+
+ private static final long serialVersionUID = 1L;
+ private static final String ID_SCALAR_VALUE = "scalarValue";
+
+ public JodaLocalDatePanel(final String id, final ScalarModel scalarModel) {
+ super(id, ID_SCALAR_VALUE, scalarModel);
+ }
+
+ @Override
+ protected Date asDate(LocalDate pojo) {
+ return pojo.toDateTimeAtStartOfDay().toDate();
+ }
+
+ @Override
+ protected LocalDate asPojo(Date date) {
+ return new LocalDate(date.getTime());
+ }
+
+
+}