You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/06/05 13:56:34 UTC
[26/51] [abbrv] isis git commit: ISIS-1133: working on annotations
http://git-wip-us.apache.org/repos/asf/isis/blob/3ce90ad1/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClass.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClass.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClass.adoc
index 4678b08..ee74bad 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClass.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClass.adoc
@@ -10,7 +10,7 @@ The `cssClass()` attribute can be used to render additional CSS classes in the H
[NOTE]
====
-This attribute can also be applied to xref:_ug_reference-annotations_manpage-DomainObjectLayout_cssClass[domain objects], xref:_ug_reference-annotations_manpage-ActionLayout_cssClass[actions] xref:_ug_reference-annotations_manpage-PropertyLayout_cssClass[properties], xref:_ug_reference-annotations_manpage-CollectionLayout_cssClass[collections] and xref:_ug_reference-annotations_manpage-ParameterLayout_cssClass[action parameters].
+This attribute can also be applied to xref:_ug_reference-annotations_manpage-DomainObjectLayout_cssClass[domain objects], xref:_ug_reference-annotations_manpage-ActionLayout_cssClass[actions] xref:_ug_reference-annotations_manpage-PropertyLayout_cssClass[properties], xref:_ug_reference-annotations_manpage-CollectionLayout_cssClass[collections] and xref:_ug_reference-annotations_manpage-ParameterLayout_cssClass[parameters].
====
For example:
@@ -19,7 +19,7 @@ For example:
----
@ViewModel
@ViewModelLayout(cssClass="x-analysis")
-public class ToDoItemAnalysis { ... }
+public class CategoryPieChart { ... }
----
http://git-wip-us.apache.org/repos/asf/isis/blob/3ce90ad1/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClassFa.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClassFa.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClassFa.adoc
index 8a191ac..7402039 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClassFa.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_cssClassFa.adoc
@@ -6,99 +6,39 @@
-IMPORTANT: WIP ... this section
-
-== `cssClassFa()
-
-
-
-IMPORTANT: WIP ... this section
+The `cssClassFa()` attribute is used to specify the name of a link:http://fortawesome.github.io/Font-Awesome/icons/[Font Awesome icon] name, to be rendered as the domain object's icon.
[NOTE]
====
These attribute can also be applied to xref:_ug_reference-annotations_manpage-DomainObjectLayout_cssClassFa[domain objects] to specify the object's icon, and to xref:_ug_reference-annotations_manpage-ActionLayout_cssClassFa[actions] to specify an icon for the action's representation as a button or menu item.
====
+If necessary the icon specified can be overridden by a particular object instance using the xref:_ug_reference-methods_reserved_manpage-iconName[`iconName()`] method.
-The `CssClassFa` annotation applies to objects and also to object actions,
-and is used by the Wicket viewer as a UI hint.
+The related `cssClassFaPosition()` attribute is currently unused for domain objects; the icon is always rendered to the left.
-For object actions, the viewer will render the specified
-http://fortawesome.github.io/Font-Awesome/icons/[Font Awesome icon]
-on the action's button (or menu item).
-For objects, it will be used as an icon. Note that this is only used if
-the object does not have a `getIconName()` method.
For example:
[source,java]
----
-@CssClassFa("fa-check-circle")
-public class ToDoItem { ... }
-----
-
-or
-
[source,java]
----
-public class ToDoItem {
-
- @CssClass("fa-step-backward")
- public ToDoItem previous() { ... }
-
- @CssClass("fa-step-forward")
- public ToDoItem next() { ... }
-
-}
+@ViewModel
+@ViewModelLayout(
+ cssClassFa="fa-piechart"
+)
+public class CategoryPieChart { ... }
----
-There can be multiple "fa-" classes, eg to mirror or rotate the icon. There
-is no need to include the "fa" class; it will be automatically appended.
-
-=== Alternatives (`.layout.json`)
-
-As an alternative to using the `@CssClass` annotation, the `.layout.json` xref:_ug_wicket-viewer_layout_dynamic-object-layout[dynamic layout file]
-can be specified, eg:
-
-[source,javascript]
-----
-{
- "span": 6,
- "memberGroups": {
- "Priority": {
- "members": {
- ...
- "relativePriority": {
- "actions": {
- "previous": {
- "cssClassFa": { "value": "fa-step-backward" }
- },
- "next": {
- "cssClassFa": { "value": "fa-step-forward" }
- }
- }
- },
- ....
- }
- },
- ...
- }
-}
-----
-
-Note that this (currently) only supports class members, not classes.
+There can be multiple "fa-" classes, eg to mirror or rotate the icon. There is no need to include the mandatory `fa` "marker" CSS class; it will be automatically added to the list. The `fa-` prefix can also be omitted from the class names; it will be prepended to each if required.
[NOTE]
====
The similar xref:_ug_reference-annotations_manpage-ViewModelLayout_cssClass[`@ViewModelLayout#cssClass()`] annotation attribute is also used as a hint to apply CSS, but for wrapping the representation of an object or object member so that it can be styled in an application-specific way.
-
====
-
-== `cssClassFaPosition()
-
-IMPORTANT: WIP ... this section
http://git-wip-us.apache.org/repos/asf/isis/blob/3ce90ad1/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_describedAs.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_describedAs.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_describedAs.adoc
index 3e81284..a334d89 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_describedAs.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_describedAs.adoc
@@ -5,29 +5,24 @@
:_imagesdir: images/
-
-IMPORTANT: WIP ... this section
-
-
-The `@DescribedAs` annotation is used to provide a short description of something that features on the user interface. How this description is used will depend upon the viewing mechanism - but it may be thought of as being like a 'tool tip'.
+The `describedAs()` attribute is used to provide a short description of the view model to the user. In the xref:_ug_wicket-viewer[Wicket viewer] it is displayed as a 'tool tip'.
[NOTE]
====
The `describedAs()` attribute can also be specified for xref:_ug_reference-annotations_manpage-CollectionLayout_describedAs[collections], xref:_ug_reference-annotations_manpage-PropertyLayout_describedAs[properties], xref:_ug_reference-annotations_manpage-ActionLayout_describedAs[actions], xref:_ug_reference-annotations_manpage-ParameterLayout_describedAs[parameters] and xref:_ug_reference-annotations_manpage-DomainObjectLayout_describedAs[domain objects].
====
-Descriptions may be provided for objects, members (properties, collections and actions), and for individual parameters within an action method. `@DescribedAs` therefore works in a very similar manner to `@Named` <!--(see ?)-->.
-
-
For example:
[source,java]
----
-public class Customer {
- @DescribedAs("The name that the customer has indicated that they wish to be " +
- "addressed as (e.g. Johnny rather than Jonathan)")
- public String getFirstName() { ... }
-}
+@ViewModel
+@ViewModelLayout(
+ cssClass="x-analysis",
+ cssClassFa="fa-piechart",
+ describedAs="Analysis of todo items by category"
+)
+public class CategoryPieChart { ... }
----
http://git-wip-us.apache.org/repos/asf/isis/blob/3ce90ad1/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_named.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_named.adoc b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_named.adoc
index ac09455..8a8654e 100644
--- a/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_named.adoc
+++ b/adocs/documentation/src/main/asciidoc/user-guide/_ug_reference-annotations_manpage-ViewModelLayout_named.adoc
@@ -5,37 +5,37 @@
:_imagesdir: images/
+The `named()` attribute explicitly specifies the view model's name, overriding the name that would normally be inferred from the Java source code.
-IMPORTANT: WIP ... this section
-
-The `@Named` annotation is used when you want to specify the way something is named on the user interface i.e. when you do not want to use the name generated automatically by the system. It can be applied to objects, members (properties, collections, and actions) and to parameters within an action method.
-
[TIP]
====
Following the link:http://en.wikipedia.org/wiki/Don%27t_repeat_yourself[don't repeat yourself] principle, we recommend that you only use this attribute when the desired name cannot be used in Java source code. Examples of that include a name that would be a reserved Java keyword (eg "package"), or a name that has punctuation, eg apostrophes.
====
+
[NOTE]
====
-This attribute can also be specified for xref:_ug_reference-annotations_manpage-ActionLayout_named[actions], xref:_ug_reference-annotations_manpage-CollectionLayout_named[collections], xref:_ug_reference-annotations_manpage-PropertyLayout_named[properties], xref:_ug_reference-annotations_manpage-ParameterLayout_named[action parameters], xref:_ug_reference-annotations_manpage-DomainObjectLayout_named[domain objects] and xref:_ug_reference-annotations_manpage-DomainServiceLayout_named[domain services].
+This attribute can also be specified for xref:_ug_reference-annotations_manpage-ActionLayout_named[actions], xref:_ug_reference-annotations_manpage-CollectionLayout_named[collections], xref:_ug_reference-annotations_manpage-PropertyLayout_named[properties], xref:_ug_reference-annotations_manpage-ParameterLayout_named[parameters], xref:_ug_reference-annotations_manpage-DomainObjectLayout_named[domain objects] and xref:_ug_reference-annotations_manpage-DomainServiceLayout_named[domain services].
====
-
-By default the name of an object is derived, reflectively from the class
-name. To specify a different name for an object, use the `@Named`
-annotation in front of the class declaration.
-
For example:
[source,java]
----
-@Named("Customer")
-public class CustomerImpl implements Customer{
+@ViewModel
+@ViewModelLayout(
+ named="PieChartAnalysis"
+)
+public class PieChartAnalysisViewModel {
...
}
----
+[TIP]
+====
+The framework also provides a separate, powerful mechanism for xref:_ug_more-advanced_i18n[internationalization].
+====