|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.Component
org.odftoolkit.simple.draw.Control
public class Control
This class represents control object, a shape that is linked to a control inside an form. It provides methods to get/set control properties, content, and styles.
Constructor Summary | |
---|---|
Control(DrawControlElement element)
|
Method Summary | |
---|---|
OdfElement |
getContainerElement()
Get the container element which contains this control. |
static Control |
getInstanceof(DrawControlElement element)
Get an instance of control according to a DrawControlElement. |
DrawControlElement |
getOdfElement()
Get the instance of DrawControlElement which represents this control. |
FrameRectangle |
getRectangle()
Return the rectangle used by this control |
ControlStyleHandler |
getStyleHandler()
Return the style handler for this control |
static Control |
newDrawControl(ControlContainer container)
Create an instance of control and and append it at the end of a container element. |
boolean |
remove()
Remove the shape control from the container. |
void |
setAchorType(StyleTypeDefinitions.AnchorType achorType)
Set how a form control is bound to a text document. |
void |
setControl(String formControlId)
Set a control within a form that is linked to this control shape by its ID. |
void |
setFormatString(String formatStr,
String type)
Set the format string of the input control. |
void |
setRectangle(FrameRectangle rectangle)
Set the rectangle used by this control |
Methods inherited from class org.odftoolkit.simple.Component |
---|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Control(DrawControlElement element)
Method Detail |
---|
public OdfElement getContainerElement()
public DrawControlElement getOdfElement()
getOdfElement
in class Component
public static Control newDrawControl(ControlContainer container)
container
- - the container element
public static Control getInstanceof(DrawControlElement element)
element
- - an instance of DrawControlElement
public boolean remove()
The resource is removed if it's only used by this object.
public ControlStyleHandler getStyleHandler()
public void setControl(String formControlId)
formControlId
- - id of a form controlpublic void setAchorType(StyleTypeDefinitions.AnchorType achorType)
If the document is not text document, nothing will happen.
achorType
- - the point at which a form control is bound to a text
documentpublic void setRectangle(FrameRectangle rectangle)
rectangle
- - the rectangle used by this controlpublic FrameRectangle getRectangle()
public void setFormatString(String formatStr, String type)
This function only works for date, time and percentage, otherwise an
IllegalArgumentException
will be thrown.
For value type percentage, the formatStr
must follow the
encoding rule of
. For value type date and time, the
java.text.DecimalFormat
formatStr
must follow the encoding rule of
.
java.text.SimpleDateFormat
formatStr
- -the input need be formatted as this specified format string.type
- - the type that need to be set
IllegalArgumentException
- if formatStr
is null or the value type is
supported.SimpleDateFormat
,
DecimalFormat
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |