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/12/05 16:23:25 UTC
[02/11] isis git commit: ISIS-964: unified UI hints in @ClassLayout,
@PropertyLayout, @CollectionLayout, @ActionLayout,
@ParameterLayout and corresponding support in .layout.json for properties,
collections and actions.
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/objpropparam/typicallen/TypicalLengthFacetAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/objpropparam/typicallen/TypicalLengthFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/objpropparam/typicallen/TypicalLengthFacetAbstract.java
index 4724871..a998b50 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/objpropparam/typicallen/TypicalLengthFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/objpropparam/typicallen/TypicalLengthFacetAbstract.java
@@ -29,8 +29,8 @@ public abstract class TypicalLengthFacetAbstract extends FacetAbstract implement
return TypicalLengthFacet.class;
}
- public TypicalLengthFacetAbstract(final FacetHolder holder, final boolean derived) {
- super(type(), holder, Derivation.NOT_DERIVED);
+ public TypicalLengthFacetAbstract(final FacetHolder holder, final Derivation derivation) {
+ super(type(), holder, derivation);
}
@Override
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/CssClassFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/CssClassFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/CssClassFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..59e4b87
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/CssClassFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,40 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetForParameterLayoutAnnotation extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final String cssClass = parameterLayout.cssClass();
+ return cssClass != null ? new CssClassFacetForParameterLayoutAnnotation(cssClass, holder) : null;
+ }
+
+ private CssClassFacetForParameterLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/DescribedAsFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/DescribedAsFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/DescribedAsFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..e3d52a2
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/DescribedAsFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,40 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetForParameterLayoutAnnotation extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final String describedAs = parameterLayout.describedAs();
+ return describedAs != null ? new DescribedAsFacetForParameterLayoutAnnotation(describedAs, holder) : null;
+ }
+
+ private DescribedAsFacetForParameterLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/LabelAtFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/LabelAtFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/LabelAtFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..41e19bf
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/LabelAtFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,42 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacet;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacetAbstract;
+
+public class LabelAtFacetForParameterLayoutAnnotation extends LabelAtFacetAbstract {
+
+ public static LabelAtFacet create(final ParameterLayout parameterLayout, FacetHolder holder) {
+ if (parameterLayout == null) {
+ return null;
+ }
+ final LabelPosition labelPosition = parameterLayout.labelPosition();
+ return labelPosition != null ? new LabelAtFacetForParameterLayoutAnnotation(labelPosition, holder) : null;
+ }
+
+ private LabelAtFacetForParameterLayoutAnnotation(final LabelPosition value, final FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/MultiLineFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/MultiLineFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/MultiLineFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..838f61f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/MultiLineFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,40 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacet;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacetAbstract;
+
+public class MultiLineFacetForParameterLayoutAnnotation extends MultiLineFacetAbstract {
+
+ public static MultiLineFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final int multiLine = parameterLayout.multiLine();
+ return multiLine != -1 ? new MultiLineFacetForParameterLayoutAnnotation(multiLine, false, holder) : null;
+ }
+
+ private MultiLineFacetForParameterLayoutAnnotation(int numberOfLines, boolean preventWrapping, FacetHolder holder) {
+ super(numberOfLines, preventWrapping, holder);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/NamedFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/NamedFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/NamedFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..8bab382
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/NamedFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetForParameterLayoutAnnotation extends NamedFacetAbstract {
+
+ public static NamedFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final String named = parameterLayout.named();
+ return named != null ? new NamedFacetForParameterLayoutAnnotation(named, holder) : null;
+ }
+
+ private NamedFacetForParameterLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/ParameterLayoutFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/ParameterLayoutFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/ParameterLayoutFactory.java
new file mode 100644
index 0000000..757b68b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/ParameterLayoutFactory.java
@@ -0,0 +1,67 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import java.lang.annotation.Annotation;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.FacetedMethodParameter;
+
+public class ParameterLayoutFactory extends FacetFactoryAbstract {
+
+ public ParameterLayoutFactory() {
+ super(FeatureType.PARAMETERS_ONLY);
+ }
+
+ @Override
+ public void processParams(final ProcessParameterContext processParameterContext) {
+ final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
+ if (processParameterContext.getParamNum() >= parameterTypes.length) {
+ // ignore
+ return;
+ }
+
+ final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
+ for (final Annotation parameterAnnotation : parameterAnnotations) {
+ if (parameterAnnotation instanceof ParameterLayout) {
+ final ParameterLayout parameterLayout = (ParameterLayout) parameterAnnotation;
+ addFacets(processParameterContext, parameterLayout);
+ return;
+ }
+ }
+ }
+
+ protected void addFacets(ProcessParameterContext processParameterContext, ParameterLayout parameterLayout) {
+ final FacetedMethodParameter facetHolder = processParameterContext.getFacetHolder();
+
+ FacetUtil.addFacet(CssClassFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(DescribedAsFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(LabelAtFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(MultiLineFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(NamedFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(RenderedAdjustedFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+ FacetUtil.addFacet(TypicalLengthFacetForParameterLayoutAnnotation.create(parameterLayout, facetHolder));
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/RenderedAdjustedFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/RenderedAdjustedFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/RenderedAdjustedFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..9b5685b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/RenderedAdjustedFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,43 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacet;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacetAbstract;
+
+public class RenderedAdjustedFacetForParameterLayoutAnnotation extends RenderedAdjustedFacetAbstract {
+
+ public static RenderedAdjustedFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final boolean renderedAsDayBefore = parameterLayout.renderedAsDayBefore();
+ return renderedAsDayBefore ? new RenderedAdjustedFacetForParameterLayoutAnnotation(holder) : null;
+ }
+
+ public static final int ADJUST_BY = -1;
+
+ private RenderedAdjustedFacetForParameterLayoutAnnotation(FacetHolder holder) {
+ super(ADJUST_BY, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/TypicalLengthFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/TypicalLengthFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/TypicalLengthFacetForParameterLayoutAnnotation.java
new file mode 100644
index 0000000..1a76d32
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/TypicalLengthFacetForParameterLayoutAnnotation.java
@@ -0,0 +1,48 @@
+/*
+ * 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.core.metamodel.facets.param.layout;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacetAbstract;
+
+public class TypicalLengthFacetForParameterLayoutAnnotation extends TypicalLengthFacetAbstract {
+
+ public static TypicalLengthFacet create(ParameterLayout parameterLayout, FacetHolder holder) {
+ if(parameterLayout == null) {
+ return null;
+ }
+ final int typicalLength = parameterLayout.typicalLength();
+ return typicalLength != -1 ? new TypicalLengthFacetForParameterLayoutAnnotation(typicalLength, holder) : null;
+ }
+
+ private final int typicalLength;
+
+ public TypicalLengthFacetForParameterLayoutAnnotation(int typicalLength, FacetHolder holder) {
+ super(holder, Derivation.NOT_DERIVED);
+ this.typicalLength = typicalLength;
+ }
+
+ @Override
+ public int value() {
+ return typicalLength;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotation.java
deleted file mode 100644
index 558c81d..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.metamodel.facets.param.layout.annotation;
-
-import org.apache.isis.applib.annotation.LabelPosition;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propparam.layout.PropParamLayoutFacetAbstract;
-
-public class PropParamLayoutFacetForParameterLayoutAnnotation extends PropParamLayoutFacetAbstract {
-
- public PropParamLayoutFacetForParameterLayoutAnnotation(final LabelPosition value, final FacetHolder holder) {
- super(value, holder);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotationFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotationFactory.java
deleted file mode 100644
index 92a1256..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/layout/annotation/PropParamLayoutFacetForParameterLayoutAnnotationFactory.java
+++ /dev/null
@@ -1,59 +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.core.metamodel.facets.param.layout.annotation;
-
-import java.lang.annotation.Annotation;
-import org.apache.isis.applib.annotation.ParameterLayout;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.propparam.layout.PropParamLayoutFacet;
-
-public class PropParamLayoutFacetForParameterLayoutAnnotationFactory extends FacetFactoryAbstract {
-
- public PropParamLayoutFacetForParameterLayoutAnnotationFactory() {
- super(FeatureType.PARAMETERS_ONLY);
- }
-
- @Override
- public void processParams(final ProcessParameterContext processParameterContext) {
- final Class<?>[] parameterTypes = processParameterContext.getMethod().getParameterTypes();
- if (processParameterContext.getParamNum() >= parameterTypes.length) {
- // ignore
- return;
- }
-
- final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
- for (final Annotation parameterAnnotation : parameterAnnotations) {
- if (parameterAnnotation instanceof ParameterLayout) {
- final ParameterLayout annotation = (ParameterLayout) parameterAnnotation;
- FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
- return;
- }
- }
- }
-
- private PropParamLayoutFacet create(final ParameterLayout annotation, final FacetHolder holder) {
- return (annotation != null) ? new PropParamLayoutFacetForParameterLayoutAnnotation(annotation.labelPosition(), holder) : null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/multiline/annotation/MultiLineFacetOnParameterAnnotationFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/multiline/annotation/MultiLineFacetOnParameterAnnotationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/multiline/annotation/MultiLineFacetOnParameterAnnotationFactory.java
index 2232223..50d2e7a 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/multiline/annotation/MultiLineFacetOnParameterAnnotationFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/multiline/annotation/MultiLineFacetOnParameterAnnotationFactory.java
@@ -26,7 +26,7 @@ import org.apache.isis.core.metamodel.facetapi.FacetUtil;
import org.apache.isis.core.metamodel.facetapi.FeatureType;
import org.apache.isis.core.metamodel.facets.Annotations;
import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.propparam.layout.PropParamLayoutFacetInferredFromMultiLineFacet;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacetInferredFromMultiLineFacet;
import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacet;
public class MultiLineFacetOnParameterAnnotationFactory extends FacetFactoryAbstract {
@@ -69,7 +69,7 @@ public class MultiLineFacetOnParameterAnnotationFactory extends FacetFactoryAbst
if (facet == null) {
return;
}
- FacetUtil.addFacet(new PropParamLayoutFacetInferredFromMultiLineFacet(facet.getFacetHolder()));
+ FacetUtil.addFacet(new LabelAtFacetInferredFromMultiLineFacet(facet.getFacetHolder()));
}
private MultiLineFacet create(final MultiLine annotation, final FacetHolder holder) {
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/renderedasdaybefore/annotation/RenderedAsDayBeforeFacetOnParameterAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/renderedasdaybefore/annotation/RenderedAsDayBeforeFacetOnParameterAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/renderedasdaybefore/annotation/RenderedAsDayBeforeFacetOnParameterAnnotation.java
index 76f6a92..b1bc22f 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/renderedasdaybefore/annotation/RenderedAsDayBeforeFacetOnParameterAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/renderedasdaybefore/annotation/RenderedAsDayBeforeFacetOnParameterAnnotation.java
@@ -27,12 +27,7 @@ public class RenderedAsDayBeforeFacetOnParameterAnnotation extends RenderedAdjus
private static final int ADJUST_BY = -1;
public RenderedAsDayBeforeFacetOnParameterAnnotation(final FacetHolder holder) {
- super(holder, false);
- }
-
- @Override
- public int value() {
- return ADJUST_BY;
+ super(ADJUST_BY, holder);
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/annotation/TypicalLengthFacetOnParameterAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/annotation/TypicalLengthFacetOnParameterAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/annotation/TypicalLengthFacetOnParameterAnnotation.java
index b21a4b0..1f7d6b6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/annotation/TypicalLengthFacetOnParameterAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/annotation/TypicalLengthFacetOnParameterAnnotation.java
@@ -27,7 +27,7 @@ public class TypicalLengthFacetOnParameterAnnotation extends TypicalLengthFacetA
private final int value;
public TypicalLengthFacetOnParameterAnnotation(final int value, final FacetHolder holder) {
- super(holder, false);
+ super(holder, Derivation.NOT_DERIVED);
this.value = value;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/fromtype/TypicalLengthFacetOnParameterDerivedFromType.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/fromtype/TypicalLengthFacetOnParameterDerivedFromType.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/fromtype/TypicalLengthFacetOnParameterDerivedFromType.java
index 8adf745..9034ba5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/fromtype/TypicalLengthFacetOnParameterDerivedFromType.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/param/typicallen/fromtype/TypicalLengthFacetOnParameterDerivedFromType.java
@@ -29,7 +29,7 @@ public class TypicalLengthFacetOnParameterDerivedFromType extends TypicalLengthF
private final TypicalLengthFacet typicalLengthFacet;
public TypicalLengthFacetOnParameterDerivedFromType(final TypicalLengthFacet typicalLengthFacet, final FacetHolder holder) {
- super(holder, true);
+ super(holder, Derivation.DERIVED);
this.typicalLengthFacet = typicalLengthFacet;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..d9f75ee
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetForPropertyLayoutAnnotation extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String cssClass = propertyLayout.cssClass();
+ return cssClass != null ? new CssClassFacetForPropertyLayoutAnnotation(cssClass, holder) : null;
+ }
+
+ private CssClassFacetForPropertyLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..f183bea
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/CssClassFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,45 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.members.cssclass.CssClassFacetAbstract;
+
+public class CssClassFacetOnPropertyFromLayoutProperties extends CssClassFacetAbstract {
+
+ public static CssClassFacet create(Properties properties, FacetHolder holder) {
+ final String cssClass = cssClass(properties);
+ return cssClass != null? new CssClassFacetOnPropertyFromLayoutProperties(cssClass, holder): null;
+ }
+
+ private CssClassFacetOnPropertyFromLayoutProperties(String cssClass, FacetHolder holder) {
+ super(cssClass, holder);
+ }
+
+ private static String cssClass(Properties properties) {
+ if(properties == null) {
+ return null;
+ }
+ return properties.getProperty("cssClass");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..7bcfe75
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetForPropertyLayoutAnnotation extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String describedAs = propertyLayout.describedAs();
+ return describedAs != null ? new DescribedAsFacetForPropertyLayoutAnnotation(describedAs, holder) : null;
+ }
+
+ private DescribedAsFacetForPropertyLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..8fd323b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/DescribedAsFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,50 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacetAbstract;
+
+public class DescribedAsFacetOnPropertyFromLayoutProperties extends DescribedAsFacetAbstract {
+
+ public static DescribedAsFacet create(Properties properties, FacetHolder holder) {
+ final String describedAs = describedAs(properties);
+ return describedAs != null? new DescribedAsFacetOnPropertyFromLayoutProperties(describedAs, holder): null;
+ }
+
+ private DescribedAsFacetOnPropertyFromLayoutProperties(String describedAs, FacetHolder holder) {
+ super(describedAs, holder);
+ }
+
+ private static String describedAs(Properties properties) {
+ if(properties == null) {
+ return null;
+ }
+ String describedAs = properties.getProperty("describedAs");
+ if(describedAs == null) {
+ // alternate key
+ describedAs = properties.getProperty("description");
+ }
+ return describedAs;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..b956168
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetForPropertyLayoutAnnotation.java
@@ -0,0 +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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.When;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
+
+public class HiddenFacetForPropertyLayoutAnnotation extends HiddenFacetAbstract {
+
+ public static HiddenFacet create(final PropertyLayout propertyLayout, final FacetHolder holder) {
+ if (propertyLayout == null) {
+ return null;
+ }
+ final Where where = propertyLayout.hidden();
+ return where != null ? new HiddenFacetForPropertyLayoutAnnotation(where, holder) : null;
+ }
+
+ private HiddenFacetForPropertyLayoutAnnotation(final Where where, final FacetHolder holder) {
+ super(When.ALWAYS, where, holder);
+ }
+
+ @Override
+ public String hiddenReason(final ObjectAdapter targetAdapter, final Where whereContext) {
+ if(!where().includes(whereContext)) {
+ return null;
+ }
+ return "Hidden on " + where().getFriendlyName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..733af05
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/HiddenFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,59 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.applib.annotation.When;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
+import org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract;
+
+public class HiddenFacetOnPropertyFromLayoutProperties extends HiddenFacetAbstract {
+
+ public static HiddenFacet create(Properties properties, FacetHolder holder) {
+ final Where where = hidden(properties);
+ return where != null? new HiddenFacetOnPropertyFromLayoutProperties(where, holder): null;
+ }
+
+ private static Where hidden(Properties properties) {
+ if(properties == null) {
+ return null;
+ }
+ String hidden = properties.getProperty("hidden");
+ if(hidden == null) {
+ return null;
+ }
+ return Where.valueOf(hidden);
+ }
+
+ private HiddenFacetOnPropertyFromLayoutProperties(Where where, FacetHolder holder) {
+ super(When.ALWAYS, where, holder);
+ }
+
+ @Override
+ public String hiddenReason(final ObjectAdapter targetAdapter, Where whereContext) {
+ if(!where().includes(whereContext)) {
+ return null;
+ }
+ return "Hidden on " + where().getFriendlyName();
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..aaeba42
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,42 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacet;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacetAbstract;
+
+public class LabelAtFacetForPropertyLayoutAnnotation extends LabelAtFacetAbstract {
+
+ public static LabelAtFacet create(final PropertyLayout propertyLayout, FacetHolder holder) {
+ if (propertyLayout == null) {
+ return null;
+ }
+ final LabelPosition labelPosition = propertyLayout.labelPosition();
+ return labelPosition != null ? new LabelAtFacetForPropertyLayoutAnnotation(labelPosition, holder) : null;
+ }
+
+ private LabelAtFacetForPropertyLayoutAnnotation(final LabelPosition value, final FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..e6b9103
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/LabelAtFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,54 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.applib.annotation.LabelPosition;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacet;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacetAbstract;
+
+public class LabelAtFacetOnPropertyFromLayoutProperties extends LabelAtFacetAbstract {
+
+ public static LabelAtFacet create(Properties properties, FacetHolder holder) {
+ final LabelPosition labelPosition = labelPosition(properties);
+ return labelPosition != null? new LabelAtFacetOnPropertyFromLayoutProperties(labelPosition, holder): null;
+ }
+
+ private LabelAtFacetOnPropertyFromLayoutProperties(LabelPosition labelPosition, FacetHolder holder) {
+ super(labelPosition, holder);
+ }
+
+ private static LabelPosition labelPosition(Properties properties) {
+ if(properties == null) {
+ return null;
+ }
+ String labelPosition = properties.getProperty("labelPosition");
+ if(labelPosition == null) {
+ // alternative key (cos I keep forgetting which to use).
+ labelPosition = properties.getProperty("labelAt");
+ }
+ if(labelPosition == null) {
+ return null;
+ }
+ return LabelPosition.valueOf(labelPosition);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..99b401f
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacet;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacetAbstract;
+
+public class MultiLineFacetForPropertyLayoutAnnotation extends MultiLineFacetAbstract {
+
+ public static MultiLineFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final int multiLine = propertyLayout.multiLine();
+ return multiLine != -1 ? new MultiLineFacetForPropertyLayoutAnnotation(multiLine, false, holder) : null;
+ }
+
+ private MultiLineFacetForPropertyLayoutAnnotation(int numberOfLines, boolean preventWrapping, FacetHolder holder) {
+ super(numberOfLines, preventWrapping, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..6a8a14b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/MultiLineFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,45 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacet;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacetAbstract;
+
+public class MultiLineFacetOnPropertyFromLayoutProperties extends MultiLineFacetAbstract {
+
+ public static MultiLineFacet create(Properties properties, FacetHolder holder) {
+ final int multiLine = multiLine(properties);
+ return multiLine != -1? new MultiLineFacetOnPropertyFromLayoutProperties(multiLine, holder): null;
+ }
+
+ private MultiLineFacetOnPropertyFromLayoutProperties(int multiLine, FacetHolder holder) {
+ super(multiLine, false, holder);
+ }
+
+ private static int multiLine(Properties properties) {
+ if(properties == null) {
+ return -1;
+ }
+ String multiLine = properties.getProperty("multiLine");
+ return Integer.parseInt(multiLine);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..68df96d
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetForPropertyLayoutAnnotation extends NamedFacetAbstract {
+
+ public static NamedFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final String named = propertyLayout.named();
+ return named != null ? new NamedFacetForPropertyLayoutAnnotation(named, holder) : null;
+ }
+
+ private NamedFacetForPropertyLayoutAnnotation(String value, FacetHolder holder) {
+ super(value, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..e9518b1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/NamedFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,50 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacet;
+import org.apache.isis.core.metamodel.facets.all.named.NamedFacetAbstract;
+
+public class NamedFacetOnPropertyFromLayoutProperties extends NamedFacetAbstract {
+
+ public static NamedFacet create(Properties properties, FacetHolder holder) {
+ final String named = named(properties);
+ return named != null? new NamedFacetOnPropertyFromLayoutProperties(named, holder): null;
+ }
+
+ private NamedFacetOnPropertyFromLayoutProperties(String named, FacetHolder holder) {
+ super(named, holder);
+ }
+
+ private static String named(Properties properties) {
+ if(properties == null) {
+ return null;
+ }
+ String named = properties.getProperty("named");
+ if(named == null) {
+ // alternate key
+ named = properties.getProperty("name");
+ }
+ return named;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/PropertyLayoutFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/PropertyLayoutFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/PropertyLayoutFactory.java
new file mode 100644
index 0000000..09a0f3e
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/PropertyLayoutFactory.java
@@ -0,0 +1,127 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetUtil;
+import org.apache.isis.core.metamodel.facetapi.FeatureType;
+import org.apache.isis.core.metamodel.facets.Annotations;
+import org.apache.isis.core.metamodel.facets.ContributeeMemberFacetFactory;
+import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
+import org.apache.isis.core.metamodel.facets.all.describedas.DescribedAsFacet;
+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.facets.members.cssclass.CssClassFacet;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.propparam.layout.LabelAtFacet;
+import org.apache.isis.core.metamodel.facets.propparam.multiline.MultiLineFacet;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacet;
+
+public class PropertyLayoutFactory extends FacetFactoryAbstract implements ContributeeMemberFacetFactory {
+
+ public PropertyLayoutFactory() {
+ super(FeatureType.PROPERTIES_ONLY);
+ }
+
+ @Override
+ public void process(final ProcessMethodContext processMethodContext) {
+
+ final FacetHolder holder = processMethodContext.getFacetHolder();
+
+ Properties properties = processMethodContext.metadataProperties("propertyLayout");
+ if(properties == null) {
+ // alternate key
+ properties = processMethodContext.metadataProperties("layout");
+ }
+ final PropertyLayout propertyLayout = Annotations.getAnnotation(processMethodContext.getMethod(), PropertyLayout.class);
+
+
+ // cssClass
+ CssClassFacet cssClassFacet = CssClassFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(cssClassFacet == null) {
+ cssClassFacet = CssClassFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(cssClassFacet);
+
+
+ // describedAs
+ DescribedAsFacet describedAsFacet = DescribedAsFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(describedAsFacet == null) {
+ describedAsFacet = DescribedAsFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(describedAsFacet);
+
+
+ // hidden
+ HiddenFacet hiddenFacet = HiddenFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(hiddenFacet == null) {
+ hiddenFacet = HiddenFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(hiddenFacet);
+
+
+ // labelAt
+ LabelAtFacet labelAtFacet = LabelAtFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(labelAtFacet == null) {
+ labelAtFacet = LabelAtFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(labelAtFacet);
+
+
+ // multiLine
+ MultiLineFacet multiLineFacet = MultiLineFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(multiLineFacet == null) {
+ multiLineFacet = MultiLineFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(multiLineFacet);
+
+
+ // named
+ NamedFacet namedFacet = NamedFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(namedFacet == null) {
+ namedFacet = NamedFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(namedFacet);
+
+
+ // renderedAsDayBefore
+ RenderedAdjustedFacet renderedAdjustedFacet = RenderedAdjustedFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(renderedAdjustedFacet == null) {
+ renderedAdjustedFacet = RenderedAdjustedFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(renderedAdjustedFacet);
+
+
+ // typicalLength
+ TypicalLengthFacet typicalLengthFacet = TypicalLengthFacetOnPropertyFromLayoutProperties.create(properties, holder);
+ if(typicalLengthFacet == null) {
+ typicalLengthFacet = TypicalLengthFacetForPropertyLayoutAnnotation.create(propertyLayout, holder);
+ }
+ FacetUtil.addFacet(typicalLengthFacet);
+
+ }
+
+ @Override
+ public void process(ProcessContributeeMemberContext processMemberContext) {
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..019d9a2
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,43 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacet;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacetAbstract;
+
+public class RenderedAdjustedFacetForPropertyLayoutAnnotation extends RenderedAdjustedFacetAbstract {
+
+ public static RenderedAdjustedFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final boolean renderedAsDayBefore = propertyLayout.renderedAsDayBefore();
+ return renderedAsDayBefore ? new RenderedAdjustedFacetForPropertyLayoutAnnotation(holder) : null;
+ }
+
+ public static final int ADJUST_BY = -1;
+
+ private RenderedAdjustedFacetForPropertyLayoutAnnotation(FacetHolder holder) {
+ super(ADJUST_BY, holder);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..6ae9a84
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/RenderedAdjustedFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,48 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacet;
+import org.apache.isis.core.metamodel.facets.propparam.renderedadjusted.RenderedAdjustedFacetAbstract;
+
+public class RenderedAdjustedFacetOnPropertyFromLayoutProperties extends RenderedAdjustedFacetAbstract {
+
+ public static final int ADJUST_BY = -1;
+
+ public static RenderedAdjustedFacet create(Properties properties, FacetHolder holder) {
+ final boolean renderedAsDayBefore = renderedAsDayBefore(properties);
+ return renderedAsDayBefore ? new RenderedAdjustedFacetOnPropertyFromLayoutProperties(holder): null;
+ }
+
+ private RenderedAdjustedFacetOnPropertyFromLayoutProperties(FacetHolder holder) {
+ super(ADJUST_BY, holder);
+ }
+
+ private static boolean renderedAsDayBefore(Properties properties) {
+ if(properties == null) {
+ return false;
+ }
+ String renderedAsDayBefore = properties.getProperty("renderedAsDayBefore");
+ return renderedAsDayBefore != null && Boolean.parseBoolean(renderedAsDayBefore);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetForPropertyLayoutAnnotation.java
new file mode 100644
index 0000000..b90c4c1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetForPropertyLayoutAnnotation.java
@@ -0,0 +1,49 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacetAbstract;
+
+public class TypicalLengthFacetForPropertyLayoutAnnotation extends TypicalLengthFacetAbstract {
+
+ public static TypicalLengthFacet create(PropertyLayout propertyLayout, FacetHolder holder) {
+ if(propertyLayout == null) {
+ return null;
+ }
+ final int typicalLength = propertyLayout.typicalLength();
+ return typicalLength != -1 ? new TypicalLengthFacetForPropertyLayoutAnnotation(typicalLength, holder) : null;
+ }
+
+ private final int typicalLength;
+
+ private TypicalLengthFacetForPropertyLayoutAnnotation(int typicalLength, FacetHolder holder) {
+ super(holder, Derivation.NOT_DERIVED);
+ this.typicalLength = typicalLength;
+ }
+
+ @Override
+ public int value() {
+ return typicalLength;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetOnPropertyFromLayoutProperties.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetOnPropertyFromLayoutProperties.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetOnPropertyFromLayoutProperties.java
new file mode 100644
index 0000000..a0eb75b
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/TypicalLengthFacetOnPropertyFromLayoutProperties.java
@@ -0,0 +1,53 @@
+/*
+ * 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.core.metamodel.facets.properties.layout;
+
+import java.util.Properties;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacet;
+import org.apache.isis.core.metamodel.facets.objpropparam.typicallen.TypicalLengthFacetAbstract;
+
+public class TypicalLengthFacetOnPropertyFromLayoutProperties extends TypicalLengthFacetAbstract {
+
+ private final int typicalLength;
+
+ public static TypicalLengthFacet create(Properties properties, FacetHolder holder) {
+ final int typicalLength = typicalLength(properties);
+ return typicalLength != -1? new TypicalLengthFacetOnPropertyFromLayoutProperties(typicalLength, holder): null;
+ }
+
+ private TypicalLengthFacetOnPropertyFromLayoutProperties(int typicalLength, FacetHolder holder) {
+ super(holder, Derivation.NOT_DERIVED);
+ this.typicalLength = typicalLength;
+ }
+
+ private static int typicalLength(Properties properties) {
+ if(properties == null) {
+ return -1;
+ }
+ String typicalLength = properties.getProperty("typicalLength");
+ return Integer.parseInt(typicalLength);
+ }
+
+ @Override
+ public int value() {
+ return typicalLength;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/4495b1a6/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/annotation/PropParamLayoutFacetForPropertyLayoutAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/annotation/PropParamLayoutFacetForPropertyLayoutAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/annotation/PropParamLayoutFacetForPropertyLayoutAnnotation.java
deleted file mode 100644
index ef9e350..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/layout/annotation/PropParamLayoutFacetForPropertyLayoutAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.metamodel.facets.properties.layout.annotation;
-
-import org.apache.isis.applib.annotation.LabelPosition;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propparam.layout.PropParamLayoutFacetAbstract;
-
-public class PropParamLayoutFacetForPropertyLayoutAnnotation extends PropParamLayoutFacetAbstract {
-
- public PropParamLayoutFacetForPropertyLayoutAnnotation(final LabelPosition value, final FacetHolder holder) {
- super(value, holder);
- }
-
-}