com.plumtree.remote.sci
Class SciCheckboxElement

java.lang.Object
  extended bycom.plumtree.remote.sci.SciCheckboxElement
All Implemented Interfaces:
ISciElement

public class SciCheckboxElement
extends java.lang.Object
implements ISciElement

Represents a checkbox control.


Constructor Summary
SciCheckboxElement(java.lang.String fieldName, java.lang.String labelText)
          Valued constructor
 
Method Summary
 org.w3c.dom.Node getRootNode()
          Gets the root Node to add to the page.
 void setCheckedValue(int value)
          Sets the checked value for the checkbox.
 void setImage(java.lang.String image)
          Sets the image for the checkbox.
 void setLabelStyle(TypeStyle labelStyle)
          Sets the label style for the checkbox (important or normal).
 void setMandatoryValidation(java.lang.String message)
          Sets mandatory validation for the checkbox.
 void setRegExpValidation(java.lang.String message, java.lang.String re, TypeMatch matchType)
          Sets regular expression validation for the checkbox.
 void setUnCheckedValue(int value)
          Sets the unchecked value for the checkbox.
 void setValue(int value)
          Sets the field value for the checkbox.
 java.lang.String toString()
          Writes the control to a string for debugging.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SciCheckboxElement

public SciCheckboxElement(java.lang.String fieldName,
                          java.lang.String labelText)
Valued constructor

Parameters:
fieldName - the name of the field; should be uppercase as the portal will uppercase all names in the NamedValue[] returned by IAdminEditor.finalize()
labelText - text to display to the left of the control
Method Detail

setCheckedValue

public void setCheckedValue(int value)
Sets the checked value for the checkbox.

Parameters:
value - the checked value

setUnCheckedValue

public void setUnCheckedValue(int value)
Sets the unchecked value for the checkbox.

Parameters:
value - the unchecked value

setImage

public void setImage(java.lang.String image)
Sets the image for the checkbox.

Parameters:
image - the path to the image

setMandatoryValidation

public void setMandatoryValidation(java.lang.String message)
Sets mandatory validation for the checkbox.

Parameters:
message - the message to display in the JavaScript alert if the field is empty

setRegExpValidation

public void setRegExpValidation(java.lang.String message,
                                java.lang.String re,
                                TypeMatch matchType)
Sets regular expression validation for the checkbox.

Parameters:
message - the message to display if validation fails
re - the regular expression to match
matchType - a TypeMatch enum of match or not-match

setValue

public void setValue(int value)
Sets the field value for the checkbox.


setLabelStyle

public void setLabelStyle(TypeStyle labelStyle)
Sets the label style for the checkbox (important or normal).

Parameters:
labelStyle - a valid TypeStyle enum

getRootNode

public org.w3c.dom.Node getRootNode()
Gets the root Node to add to the page.

Specified by:
getRootNode in interface ISciElement
Returns:
the root Node
 //Simple Example Code to make a link to Google:
 //nested class implementing ISciElement
 class LinkElement implements ISciElement
 {
  private org.w3c.dom.Document m_doc;
  public Node getRootNode()
  {
   return m_doc.getDocumentElement();
  }
  public LinkElement()
  {
     m_doc = new CoreDocumentImpl();
   //make an anchor element
   Element link = m_doc.createElement("a");
   //set the correct namespace so the portal will treat it as raw html
   link.setAttribute("xmlns","http://www.w3.org/1999/xhtml");
   //set the href
   link.setAttribute("href", "http://www.google.com");
   //create a text node for the link text
   Node textNode = m_doc.createTextNode("google");
   link.appendChild(textNode);
   m_doc.appendChild(link);
  }
 }
 // use this in getPageContent:
 public String getContent(int pageNumber, NamedValueMap pageInfo) throws ServiceException
 {
  SciPage page = new SciPage();
  ISciElement linkElement = new LinkElement();
  page.add(linkElement);
  return page.toString();
 }
 
See Also:
ISciElement.getRootNode()

toString

public java.lang.String toString()
Writes the control to a string for debugging.

See Also:
Object.toString()


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.