All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.aemds.guide.common.GuideTextBox Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2014 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 may be covered by U.S. and Foreign Patents,
 * patents in process, 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.aemds.guide.common;

import com.adobe.aemds.guide.utils.GuideConstants;
import com.day.cq.wcm.foundation.forms.FormsHelper;

import java.io.Serializable;


/**
 * GuideTextBox class encapsulates basic properties of the adaptive forms TextBox component.
 * Some of the properties that it encapsulates are listed below:
 * 
    *
  • rows of the textbox
  • *
  • columns of the textbox
  • *
* * @since AEM 6.0 */ public class GuideTextBox extends GuideField implements Serializable { private final static int rows = 1; private final static int cols = 35; /** * Returns whether the textbox allows multiple lines or not * @return boolean indicating if textbox allows multiple lines or not */ public Boolean getMultiLine() { return resourceProps.get("multiLine", false); } /** * Returns whether the textbox allows rich Text or not * @return boolean indicating if textbox allows rich Text or not */ public Boolean getAllowRichText() { return resourceProps.get("allowRichText", false); } /** * Returns the number of rows in the textbox component * @return Integer representing the number of rows */ public int getRows(){ return resourceProps.get("rows", rows); } /** * Returns the number of columns in the textbox component * @return Integer representing the number of columns */ public int getCols(){ return resourceProps.get("cols", cols); } /** * TODO : do we really need this here ? * @pad.exclude Exclude from Published API. */ public String[] getValues(){ String[] values = FormsHelper.getValues(slingRequest, getResource()); if (values == null) { values = new String[]{""}; } return values; } /** * Returns the field type of the Adaptive Forms Component * @return String representing guide field type */ public String getGuideFieldType(){ return GuideConstants.GUIDE_FIELD_TEXTBOX; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy