= @DomainObjectLayout
:Notice: 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.

Layout hints for domain objects.

== API

[source,java]
.DomainObjectLayout.java
----
@interface DomainObjectLayout {
  BookmarkPolicy bookmarking() default BookmarkPolicy.NOT_SPECIFIED;     // <.>
  String cssClass() default "";     // <.>
  String cssClassFa() default "";     // <.>
  CssClassFaPosition cssClassFaPosition() default CssClassFaPosition.LEFT;     // <.>
  String describedAs() default "";     // <.>
  String named() default "";     // <.>
  int paged() default -1;     // <.>
  @Deprecated(forRemoval = true)
String plural() default "";     // <.>
  Class<? extends TableDecorator> tableDecorator() default TableDecorator.Default.class;     // <.>
  Class<? extends CssClassUiEvent<?>> cssClassUiEvent() default CssClassUiEvent.Default.class;     // <.>
  Class<? extends IconUiEvent<?>> iconUiEvent() default IconUiEvent.Default.class;     // <.>
  Class<? extends LayoutUiEvent<?>> layoutUiEvent() default LayoutUiEvent.Default.class;     // <.>
  Class<? extends TitleUiEvent<?>> titleUiEvent() default TitleUiEvent.Default.class;     // <.>
}
----

<.> xref:#bookmarking[bookmarking]
+
--
Whether (and how) this domain object can be bookmarked in the UI.
--
<.> xref:#cssClass[cssClass]
+
--
Indicates the css class that a domain class (type) should have, to allow more targeted styling in `application.css` .
--
<.> xref:#cssClassFa[cssClassFa]
+
--
Indicates theFont AwesomeCSS class to decorate an domain object.
--
<.> xref:#cssClassFaPosition[cssClassFaPosition]
+
--
Indicates the position of theFont Awesomeicon. The icon could be rendered on the left or the right of the object's title.
--
<.> xref:#describedAs[describedAs]
+
--
Description of this class, eg to be rendered in a tooltip.
--
<.> xref:#named[named]
+
--
Name of this class (overriding the name derived from its name in code).
--
<.> xref:#paged[paged]
+
--
The page size for instances of this class when rendered within a table.
--
<.> xref:#plural[plural]
+
--
[WARNING]
====
[red]#_deprecated:_#

CAUSEWAY-3321: for standalone tables (action result), parented tables (collections) or plural action parameters, the framework should (and will) use the name of the originating action, collection or action parameter instead.
====

The plural name of the class.
--
<.> xref:#tableDecorator[tableDecorator]
+
--
Whether a standalone collection, when represented in a table form, should additionally be "decorated" with client-side (javascript) enhancements, for example to enable paging and filtering.
--
<.> xref:#cssClassUiEvent[cssClassUiEvent]
+
--
Which subclass of xref:refguide:applib:index/events/ui/CssClassUiEvent.adoc[CssClassUiEvent] should be used to obtain a CSS class.
--
<.> xref:#iconUiEvent[iconUiEvent]
+
--
Which subclass of xref:refguide:applib:index/events/ui/IconUiEvent.adoc[IconUiEvent] should be used to obtain an icon.
--
<.> xref:#layoutUiEvent[layoutUiEvent]
+
--
Which subclass of xref:refguide:applib:index/events/ui/LayoutUiEvent.adoc[LayoutUiEvent] should be used to obtain a layout.
--
<.> xref:#titleUiEvent[titleUiEvent]
+
--
Which subclass of xref:refguide:applib:index/events/ui/TitleUiEvent.adoc[TitleUiEvent] should be used to obtain a title.
--

== Members

[#bookmarking]
=== bookmarking

Whether (and how) this domain object can be bookmarked in the UI.

[#cssClass]
=== cssClass

Indicates the css class that a domain class (type) should have, to allow more targeted styling in `application.css` .

[#cssClassFa]
=== cssClassFa

Indicates theFont AwesomeCSS class to decorate an domain object.

[#cssClassFaPosition]
=== cssClassFaPosition

Indicates the position of theFont Awesomeicon. The icon could be rendered on the left or the right of the object's title.

This attribute is currently ignored by Causeway viewers.

[#describedAs]
=== describedAs

Description of this class, eg to be rendered in a tooltip.

[#named]
=== named

Name of this class (overriding the name derived from its name in code).

A typical use case is if the desired name is a reserved Java keyword, such as `default` or `package`.

[#paged]
=== paged

The page size for instances of this class when rendered within a table.

If annotated on a collection, then the page size refers to parented collections (eg `Order#lineItems` ).

If annotated on a type, then the page size refers to standalone collections (eg as returned from a repository query).

[#plural]
=== plural

[WARNING]
====
[red]#_deprecated:_#

CAUSEWAY-3321: for standalone tables (action result), parented tables (collections) or plural action parameters, the framework should (and will) use the name of the originating action, collection or action parameter instead.
====

The plural name of the class.

[#tableDecorator]
=== tableDecorator

Whether a standalone collection, when represented in a table form, should additionally be "decorated" with client-side (javascript) enhancements, for example to enable paging and filtering.

[#cssClassUiEvent]
=== cssClassUiEvent

Which subclass of xref:refguide:applib:index/events/ui/CssClassUiEvent.adoc[CssClassUiEvent] should be used to obtain a CSS class.

This subclass must provide a no-arg constructor; the fields are set reflectively.

[#iconUiEvent]
=== iconUiEvent

Which subclass of xref:refguide:applib:index/events/ui/IconUiEvent.adoc[IconUiEvent] should be used to obtain an icon.

This subclass must provide a no-arg constructor; the fields are set reflectively.

[#layoutUiEvent]
=== layoutUiEvent

Which subclass of xref:refguide:applib:index/events/ui/LayoutUiEvent.adoc[LayoutUiEvent] should be used to obtain a layout.

This subclass must provide a no-arg constructor; the fields are set reflectively.

[#titleUiEvent]
=== titleUiEvent

Which subclass of xref:refguide:applib:index/events/ui/TitleUiEvent.adoc[TitleUiEvent] should be used to obtain a title.

This subclass must provide a no-arg constructor; the fields are set reflectively.

include::hooks/DomainObjectLayout_010-examples-and-usage.adoc[]

include::hooks/DomainObjectLayout_021-describedAs.adoc[]

include::hooks/DomainObjectLayout_022-cssClass.adoc[]

include::hooks/DomainObjectLayout_023-cssClassFa.adoc[]

include::hooks/DomainObjectLayout_024-named.adoc[]

include::hooks/DomainObjectLayout_025-bookmarking.adoc[]

include::hooks/DomainObjectLayout_026-paged.adoc[]

include::hooks/DomainObjectLayout_027-ui-events.adoc[]
