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 2014/11/07 04:46:37 UTC
[13/29] isis git commit: ISIS-537 Replace tabs with spaces. Remove
unused methods.
ISIS-537 Replace tabs with spaces. Remove unused methods.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/8cbe98e0
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/8cbe98e0
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/8cbe98e0
Branch: refs/heads/ISIS-939
Commit: 8cbe98e03d58a047a141795e24f44391c2b27a0a
Parents: e858ac5
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Nov 6 10:53:55 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Nov 6 10:53:55 2014 +0200
----------------------------------------------------------------------
.../collections/EntityCollectionsPanel.java | 37 ++++++--------------
1 file changed, 10 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/8cbe98e0/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
index 6a162f9..f18ba4a 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/collections/EntityCollectionsPanel.java
@@ -21,8 +21,6 @@ package org.apache.isis.viewer.wicket.ui.components.entity.collections;
import java.util.List;
-import org.apache.wicket.Component;
-import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.RepeatingView;
@@ -98,8 +96,8 @@ public class EntityCollectionsPanel extends PanelAbstract<EntityModel> {
}
private void addCollectionToForm(final EntityModel entityModel,
- final ObjectAssociation association,
- final WebMarkupContainer collectionRvContainer) {
+ final ObjectAssociation association,
+ final WebMarkupContainer collectionRvContainer) {
final CssClassFacet facet = association.getFacet(CssClassFacet.class);
if(facet != null) {
@@ -108,39 +106,24 @@ public class EntityCollectionsPanel extends PanelAbstract<EntityModel> {
final WebMarkupContainer fieldset = new WebMarkupContainer(ID_COLLECTION_GROUP);
collectionRvContainer.add(fieldset);
- final OneToManyAssociation otma = (OneToManyAssociation) association;
+ final OneToManyAssociation otma = (OneToManyAssociation) association;
+
+ final CollectionPanel collectionPanel = new CollectionPanel(ID_COLLECTION, entityModel, otma);
+
+ labelComponent = collectionPanel.createLabel(ID_COLLECTION_NAME, association.getName());
- final CollectionPanel collectionPanel = new CollectionPanel(ID_COLLECTION, entityModel, otma);
-
- labelComponent = collectionPanel.createLabel(ID_COLLECTION_NAME, association.getName());
-
fieldset.add(labelComponent);
- fieldset.addOrReplace(collectionPanel);
- }
+ fieldset.addOrReplace(collectionPanel);
+ }
private List<ObjectAssociation> visibleCollections(final ObjectAdapter adapter, final ObjectSpecification noSpec) {
return noSpec.getAssociations(Contributed.INCLUDED, visibleCollectionsFilter(adapter));
}
@SuppressWarnings("unchecked")
- private Filter<ObjectAssociation> visibleCollectionsFilter(final ObjectAdapter adapter) {
+ private Filter<ObjectAssociation> visibleCollectionsFilter(final ObjectAdapter adapter) {
return Filters.and(ObjectAssociation.Filters.COLLECTIONS, ObjectAssociation.Filters.dynamicallyVisible(getAuthenticationSession(), adapter, Where.PARENTED_TABLES));
}
- private void requestRepaintPanel(final AjaxRequestTarget target) {
- if (target != null) {
- target.add(this);
- }
- }
-
- private EntityModel getEntityModel() {
- return getModel();
- }
-
- void toViewMode(final AjaxRequestTarget target) {
- getEntityModel().toViewMode();
- requestRepaintPanel(target);
- }
-
}