= Where _(enum)_
: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.

Represents the location in the user interface where a class member is to be rendered.

Used to control visibility (eg using the _Property#hidden()_ annotation) and enablement (eg using the _Property#editing()_ annotation) in different regions of the user interface.

The application programmer may use any of the values of this enum. Some represent concrete locations (eg _#OBJECT_FORMS_ , _#PARENTED_TABLES_ ), whereas some represent a combination of locations (eg _#ALL_TABLES_ , _#ANYWHERE_ ).

== API

[source,java]
.Where.java
----
enum Where {
  EVERYWHERE     // <.>
  ANYWHERE     // <.>
  OBJECT_FORMS     // <.>
  REFERENCES_PARENT     // <.>
  PARENTED_TABLES     // <.>
  STANDALONE_TABLES     // <.>
  ALL_TABLES     // <.>
  ALL_EXCEPT_STANDALONE_TABLES     // <.>
  NOWHERE     // <.>
  NOT_SPECIFIED     // <.>
  String getFriendlyName()
  boolean isAlways()
  boolean inParentedTable()
  boolean inStandaloneTable()
  boolean includes(Where context)     // <.>
}
----

<.> xref:#EVERYWHERE[EVERYWHERE]
+
--
The member should be disabled/hidden everywhere.
--
<.> xref:#ANYWHERE[ANYWHERE]
+
--
The member should be disabled/hidden everywhere.
--
<.> xref:#OBJECT_FORMS[OBJECT_FORMS]
+
--
The member should be disabled/hidden when displayed within an object form.
--
<.> xref:#REFERENCES_PARENT[REFERENCES_PARENT]
+
--
The (property) member should be hidden when displayed as a column of a table within parent object's collection, and when it references that parent.
--
<.> xref:#PARENTED_TABLES[PARENTED_TABLES]
+
--
The member should be hidden when displayed as a column of a table within a parent object's collection.
--
<.> xref:#STANDALONE_TABLES[STANDALONE_TABLES]
+
--
The member should be hidden when displayed as a column of a table showing a standalone list of objects, for example as returned by a repository query.
--
<.> xref:#ALL_TABLES[ALL_TABLES]
+
--
The member should be disabled/hidden when displayed as a column of a table, either an object's collection or a standalone list.
--
<.> xref:#ALL_EXCEPT_STANDALONE_TABLES[ALL_EXCEPT_STANDALONE_TABLES]
+
--
The member should be disabled/hidden except when displayed as a column of a standalone table.
--
<.> xref:#NOWHERE[NOWHERE]
+
--
To act as an override if a member would normally be hidden as a result of some other convention.
--
<.> xref:#NOT_SPECIFIED[NOT_SPECIFIED]
+
--
Acts as the default no-op value for _PropertyLayout#hidden()_ , _CollectionLayout#hidden()_ and _ActionLayout#hidden()_ .
--
<.> xref:#includes_Where[includes(Where)]
+
--
Whether this `Where` is a superset of the context `Where` provided.
--

== Members

[#EVERYWHERE]
=== EVERYWHERE

The member should be disabled/hidden everywhere.

Synonym for _#ANYWHERE_ .

[#ANYWHERE]
=== ANYWHERE

The member should be disabled/hidden everywhere.

Synonym for _#EVERYWHERE_ .

[#OBJECT_FORMS]
=== OBJECT_FORMS

The member should be disabled/hidden when displayed within an object form.

For most viewers, this applies to property and collection members, not actions.

[#REFERENCES_PARENT]
=== REFERENCES_PARENT

The (property) member should be hidden when displayed as a column of a table within parent object's collection, and when it references that parent.

[#PARENTED_TABLES]
=== PARENTED_TABLES

The member should be hidden when displayed as a column of a table within a parent object's collection.

An alternative to using annotations is using to use file based layout, which can be reloaded dynamically. One implementation that supports this is `TableColumnOrderServiceUsingTxtFile` service, that reads from files named _ParentClass#collectionId.columnOrder.txt_ .

[#STANDALONE_TABLES]
=== STANDALONE_TABLES

The member should be hidden when displayed as a column of a table showing a standalone list of objects, for example as returned by a repository query.

An alternative to using annotations is using to use file based layout, which can be reloaded dynamically. One implementation that supports this is `TableColumnOrderServiceUsingTxtFile` service, that reads from files named _ClassName.columnOrder.txt_ .

[#ALL_TABLES]
=== ALL_TABLES

The member should be disabled/hidden when displayed as a column of a table, either an object's collection or a standalone list.

This combines _#PARENTED_TABLES_ and _#STANDALONE_TABLES_ .

An alternative to using annotations is using to use file based layout, which can be reloaded dynamically. One implementation that supports this is `TableColumnOrderServiceUsingTxtFile` service, that reads from files named _ParentClass#collectionId.columnOrder.txt_ (parented collections) and _ClassName.columnOrder.txt_ (standalone collections).

[#ALL_EXCEPT_STANDALONE_TABLES]
=== ALL_EXCEPT_STANDALONE_TABLES

The member should be disabled/hidden except when displayed as a column of a standalone table.

This is the inverse of _#STANDALONE_TABLES_ .

[#NOWHERE]
=== NOWHERE

To act as an override if a member would normally be hidden as a result of some other convention.

For example, if a property is annotated with `@Title` , then normally this should be hidden from all tables. Additionally annotating with `@Hidden(where=Where.NOWHERE)` overrides this.

[#NOT_SPECIFIED]
=== NOT_SPECIFIED

Acts as the default no-op value for _PropertyLayout#hidden()_ , _CollectionLayout#hidden()_ and _ActionLayout#hidden()_ .

[#includes_Where]
=== includes(Where)

Whether this `Where` is a superset of the context `Where` provided.

For example, _#ALL_TABLES_ includes _#STANDALONE_TABLES_ ; _#ANYWHERE_ includes all others.
