
com.adobe.granite.ui.components.Options Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.granite.ui.components;
public class Options {
private Tag tag;
private boolean rootField = true;
/**
* Returns the tag.
* @return the tag
*/
public Tag tag() {
return tag;
}
/**
* Sets the tag.
* @param tag the tag
* @return the options
*/
public Options tag(Tag tag) {
this.tag = tag;
return this;
}
/**
* Returns true
if the renderer (the field) should render
* itself as root field. See {@link #rootField(boolean)} for details.
* @return {@code true} if the renderer (the field) should render
* itself as root field.
*/
public boolean rootField() {
return rootField;
}
/**
* Sets true
to make the renderer (the field) should render
* itself as root field; false
otherwise.
*
* A root field is a field that acts in its own context, instead of as
* part of a composite field. For example, sizing field consists of
* weight and height fields. So sizing field is a composite field and
* wants to leverage the existing number field for width and height. In
* this case when sizing field is including (
* {@link ComponentHelper#include(org.apache.sling.api.resource.Resource, ComponentHelper.Options)}) the number field,
* it should set this option as false
.
*
* The field implementation is free to interpret the exact behaviour of
* root/non-root field. Most likely scenario, the root field will handle
* it own sizing state (e.g. inline-block/block state), while non root
* field will not, where the parent composite field is managing it.
*
* @param flag the flag
* @return this instance
*/
public Options rootField(boolean flag) {
rootField = flag;
return this;
}
}