| com.gwtext.client.widgets.Component
All known Subclasses: com.gwtext.client.widgets.ColorPalette, com.gwtext.client.widgets.menu.BaseItem, com.gwtext.client.widgets.Button, com.gwtext.client.widgets.Editor, com.gwtext.client.widgets.DatePicker, com.gwtext.client.widgets.BoxComponent,
Component | abstract public class Component extends Widget implements Observable(Code) | | Base class for all Ext components. All subclasses of Component can automatically participate in the standard
Ext component lifecycle of creation, rendering and destruction. They also have automatic support for basic hide/show
and enable/disable behavior. All visual widgets that require rendering into a layout should subclass Component (or
BoxComponent if managed box model handling is required).
Every component has a specific xtype. This is the list of all valid xtypes:
xtype Class
------------- ------------------
box BoxComponent
button Button
colorpalette ColorPalette
component Component
container Container
cycle CycleButton
dataview DataView
datepicker DatePicker
editor Editor
editorgrid EditorGridPanel
grid GridPanel
paging PagingToolbar
panel Panel
progress ProgressBar
splitbutton SplitButton
tabpanel TabPanel
treepanel TreePanel
viewport ViewPort
window Window
Toolbar components
---------------------------------------
toolbar Toolbar
Form components
---------------------------------------
checkbox Checkbox
combo ComboBox
datefield DateField
field Field
fieldset FieldSet
form FormPanel
hidden Hidden
htmleditor HtmlEditor
numberfield NumberField
radio Radio
textarea TextArea
textfield TextField
timefield TimeField
|
Constructor Summary | |
public | Component() Create a new Component. | public | Component(Element element) Component Constructor. | public | Component(JavaScriptObject jsObj) | public | Component(String id) Creates a Component object reference for an already rendered Component. |
Method Summary | |
public void | addClass(String cls) Adds a CSS class to the component's underlying element. | native public void | addClassCreated(String cls) | native public void | addEvent(String events) | public void | addEvents(String[] events) | protected void | addListener(String event, JavaScriptObject fn) | native public void | addListener(String event, Function funtion) Add a raw event listener. | native protected void | addListener(ComponentListener listener) Add a component listner. | protected void | afterRender() Template method that is called after the Component has been renedered. | protected void | beforeDestroy() This template method is called before the component is destroy. | protected void | check() | public Component | cloneComponent() Clone the current component using the original config values passed into this instance by default. | public Component | cloneComponent(Component overrides) Clone the current component using the original config values passed into this instance by default. | native protected JavaScriptObject | cloneConfig(JavaScriptObject config) | abstract protected JavaScriptObject | create(JavaScriptObject config) | native public void | destroy() Destroys this component by purging any event listeners, removing the component's element from the DOM, removing
the component from its
Container (if applicable) and unregistering it from
ComponentMgr . | public void | disable() Disable this component. | public void | enable() Enable this component. | public boolean | equals(Object obj) | protected void | error(String message) | public void | focus() Try to focus this component. | native public void | focus(boolean selectText) Try to focus this component. | native public void | focus(boolean selectText, int delay) Try to focus this component. | public Element | getApplyTo() | protected String | getAttribute(String attribute) | protected boolean | getAttributeAsBoolean(String attribute) | protected float | getAttributeAsFloat(String attribute) | protected int | getAttributeAsInt(String attribute) | protected JavaScriptObject | getAttributeAsJavaScriptObject(String attribute) | public boolean | getAutoShow() | public String | getCls() | native protected static JavaScriptObject | getComponentJS(String id) | public JavaScriptObject | getConfig() | abstract protected JavaScriptObject | getConfigPrototype() | public String | getCtCls() | public String | getDisabledClass() | native public ExtElement | getEl() | native protected Element | getElement(JavaScriptObject jsObj) | public Element | getElement() | public String | getHideMode() How this component should hidden. | public boolean | getHideParent() | public String | getId() | native public String | getItemId() Returns the item id of this component. | public JavaScriptObject | getJsObj() | public int | getOffsetHeight() | public int | getOffsetWidth() | public JavaScriptObject | getOrCreateJsObj() | native public Container | getOwnerContainer() The component's owner Ext.Container (defaults to undefined, and is set automatically when the
component is added to a container). | public Element | getRenderTo() | public String[] | getStateEvents() An array of events that, when fired, should trigger this component to save its state (defaults to none). | public String | getStateId() The unique id for this component to use for state management purposes (defaults to the component id). | public String | getStyle() | protected Element | getStyleElement() | public String | getTitle() | public String | getXType() Gets the xtype for this component as registered with ComponentMgr. | native public String | getXTypes() Returns this component's xtype hierarchy as a slash-delimited string. | public int | hashCode() | public void | hide() Hide this component. | protected void | initComponent() This template method is called after the Component has been instantiated but before it's rendered. | public boolean | isCreated() | public boolean | isDisabled() True if this component is disabled. | public boolean | isHidden() | native public boolean | isRendered() | native public boolean | isVisible() Returns true if this component is visible. | native public boolean | isXType(String xtype) Tests whether or not this component is of a specific xtype. | native public boolean | isXType(String xtype, boolean shallow) Tests whether or not this component is of a specific xtype. | protected void | onDestroy() This template method is called on component destroy. | native public void | removeClass(String cls) Removes a CSS class from the component's underlying element. | native public void | render(String id) If this is a lazy rendering component, render it to its container element. | native public void | render(String id, String position) If this is a lazy rendering component, render it to its container element. | native public void | render(String id, int position) If this is a lazy rendering component, render it to its container element. | native public void | render(Element element) If this is a lazy rendering component, render it to its container element. | native public void | render(Element element, String position) If this is a lazy rendering component, render it to its container element. | native public void | render(Element element, int position) If this is a lazy rendering component, render it to its container element. | public void | setApplyTo(Element element) The id of the node, a DOM node or an existing Element corresponding to a DIV that is
already present in the document that specifies some structural markup for this component.
When applyTo is used, constituent parts of the component can also be specified by id or CSS class name within the
main element, and the component being created may attempt to create its subcomponents from that markup if applicable.
Using this config, a call to render() is not required. | protected void | setAttribute(String attribute, String value, boolean allowPostCreate) | protected void | setAttribute(String attribute, String value, boolean allowPostCreate, boolean allowPostRendered) | protected void | setAttribute(String attribute, int[] value, boolean allowPostCreate) | protected void | setAttribute(String attribute, int[] value, boolean allowPostCreate, boolean allowPostRender) | protected void | setAttribute(String attribute, long value, boolean allowPostCreate) | protected void | setAttribute(String attribute, double value, boolean allowPostCreate) | protected void | setAttribute(String attribute, int value, boolean allowPostCreate) | protected void | setAttribute(String attribute, int value, boolean allowPostCreate, boolean allowPostRender) | protected void | setAttribute(String attribute, Date value, boolean allowPostCreate) | protected void | setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate) | protected void | setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate, boolean allowPostRender) | protected void | setAttribute(String attribute, String[] value, boolean allowPostCreate) | protected void | setAttribute(String attribute, String[] value, boolean allowPostCreate, boolean allowPostRender) | protected void | setAttribute(String attribute, boolean value, boolean allowPostCreate) | protected void | setAttribute(String attribute, boolean value, boolean allowPostCreate, boolean allowPostRendered) | protected void | setAttribute(String attribute, Element value, boolean allowPostCreate) | protected void | setAttribute(String attribute, Element value, boolean allowPostCreate, boolean allowPostRendered) | public void | setAutoEl(String autoEl) | public void | setAutoShow(boolean autoShow) True if the component should check for hidden classes (e.g. | public void | setCls(String cls) An optional extra CSS class that will be added to this component's Element (defaults to ''). | public void | setCtCls(String ctCls) An optional extra CSS class that will be added to this component's container (defaults to ''). | public void | setDisabled(boolean disabled) Convenience function for setting disabled/enabled by boolean. | public void | setDisabledClass(String disabledClass) CSS class added to the component when it is disabled (defaults to "x-item-disabled"). | public void | setEl(Element el) Sets the underlying Element for the component. | public void | setEl(String elementID) | public void | setHeight(String height) | public void | setHideMode(String hideMode) How this component should hidden. | public void | setHideParent(boolean hideParent) True to hide and show the component's container when hide/show is called on the component, false to hide and show
the component itself (defaults to false). | final public void | setId(String id) The unique id of this component (defaults to an auto-assigned id). | public void | setRenderTo(Element elem) The id of the node, a DOM node or an existing Element that will be the container to render this component into. | public void | setStateEvents(String[] stateEvents) An array of events that, when fired, should trigger this component to save its state (defaults to none). | public void | setStateId(String stateId) The unique id for this component to use for state management purposes (defaults to the component id). | public void | setStyle(String style) A custom style specification to be applied to this component's Element. | public void | setTitle(String title) | public void | setVisible(boolean visible) Convenience function to hide or show this component by boolean. | public void | setWidth(String width) | public void | show() Show this component. |
config | protected JavaScriptObject config(Code) | | |
Component | public Component()(Code) | | Create a new Component.
|
Component | public Component(Element element)(Code) | | Component Constructor. Applies the Component to an existing element.
Parameters: element - the Element to apply the Component to |
Component | public Component(JavaScriptObject jsObj)(Code) | | |
Component | public Component(String id)(Code) | | Creates a Component object reference for an already rendered Component.
Parameters: id - the Component ID |
addClass | public void addClass(String cls)(Code) | | Adds a CSS class to the component's underlying element.
Parameters: cls - the CSS class |
addClassCreated | native public void addClassCreated(String cls)(Code) | | |
addListener | protected void addListener(String event, JavaScriptObject fn)(Code) | | |
addListener | native public void addListener(String event, Function funtion)(Code) | | Add a raw event listener.
Parameters: event - the event name Parameters: funtion - the fintion to execute |
addListener | native protected void addListener(ComponentListener listener)(Code) | | Add a component listner.
Parameters: listener - the listener |
afterRender | protected void afterRender()(Code) | | Template method that is called after the Component has been renedered.
|
beforeDestroy | protected void beforeDestroy()(Code) | | This template method is called before the component is destroy. Subclasses can add any cleanup logic on destoy here.
|
cloneComponent | public Component cloneComponent()(Code) | | Clone the current component using the original config values passed into this instance by default.
the cloned copy of this component |
cloneComponent | public Component cloneComponent(Component overrides)(Code) | | Clone the current component using the original config values passed into this instance by default.
Parameters: overrides - when cloning the cloned copy of this component |
cloneConfig | native protected JavaScriptObject cloneConfig(JavaScriptObject config)(Code) | | |
create | abstract protected JavaScriptObject create(JavaScriptObject config)(Code) | | |
destroy | native public void destroy()(Code) | | Destroys this component by purging any event listeners, removing the component's element from the DOM, removing
the component from its
Container (if applicable) and unregistering it from
ComponentMgr . Destruction
is generally handled automatically by the framework and this method should usually not need to be called directly.
|
disable | public void disable()(Code) | | Disable this component.
|
enable | public void enable()(Code) | | Enable this component.
|
focus | public void focus()(Code) | | Try to focus this component.
|
focus | native public void focus(boolean selectText)(Code) | | Try to focus this component.
Parameters: selectText - True to also select the text in this component (if applicable) |
focus | native public void focus(boolean selectText, int delay)(Code) | | Try to focus this component.
Parameters: selectText - True to also select the text in this component (if applicable) Parameters: delay - delay the focus this number of milliseconds (true for 10 milliseconds) |
getApplyTo | public Element getApplyTo()(Code) | | the Element this component was applied to |
getAttributeAsBoolean | protected boolean getAttributeAsBoolean(String attribute)(Code) | | |
getAttributeAsFloat | protected float getAttributeAsFloat(String attribute)(Code) | | |
getAttributeAsInt | protected int getAttributeAsInt(String attribute)(Code) | | |
getAttributeAsJavaScriptObject | protected JavaScriptObject getAttributeAsJavaScriptObject(String attribute)(Code) | | |
getAutoShow | public boolean getAutoShow()(Code) | | true if auto show |
getCls | public String getCls()(Code) | | the extra CSS applied to the components Element |
getComponentJS | native protected static JavaScriptObject getComponentJS(String id)(Code) | | |
getConfig | public JavaScriptObject getConfig()(Code) | | |
getConfigPrototype | abstract protected JavaScriptObject getConfigPrototype()(Code) | | |
getCtCls | public String getCtCls()(Code) | | the extra CSS class applied to the components container. |
getDisabledClass | public String getDisabledClass()(Code) | | the CSS class used when the component is disabled |
getElement | native protected Element getElement(JavaScriptObject jsObj)(Code) | | |
getElement | public Element getElement()(Code) | | |
getHideMode | public String getHideMode()(Code) | | How this component should hidden. Supported values are "visibility" (css visibility), "offsets" (negative offset
position) and "display" (css display) - defaults to "display".
the hide mode |
getHideParent | public boolean getHideParent()(Code) | | true if hideParent enabled |
getItemId | native public String getItemId()(Code) | | Returns the item id of this component.
the item ID |
getJsObj | public JavaScriptObject getJsObj()(Code) | | |
getOffsetHeight | public int getOffsetHeight()(Code) | | |
getOffsetWidth | public int getOffsetWidth()(Code) | | |
getOrCreateJsObj | public JavaScriptObject getOrCreateJsObj()(Code) | | |
getOwnerContainer | native public Container getOwnerContainer()(Code) | | The component's owner Ext.Container (defaults to undefined, and is set automatically when the
component is added to a container).
Note: This method should be called only after the component has been rendered.
the owner container |
getRenderTo | public Element getRenderTo()(Code) | | the element the Component is rendered to |
getStateEvents | public String[] getStateEvents()(Code) | | An array of events that, when fired, should trigger this component to save its state (defaults to none). These can be
any types of events supported by this component, including browser or custom events (e.g., ['click', 'customerchange']).
an array of state events |
getStateId | public String getStateId()(Code) | | The unique id for this component to use for state management purposes (defaults to the component id).
the state ID |
getStyle | public String getStyle()(Code) | | the custom style specification applied to the element |
getStyleElement | protected Element getStyleElement()(Code) | | |
getXType | public String getXType()(Code) | | Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes,
see the Component javadocs.
TextField field = new TextField();
field.getXType() returns "textfield"
the xtype |
getXTypes | native public String getXTypes()(Code) | | Returns this component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the
Component class javadocs.
TextField field = new TextField();
field.getXTypes() returns "component/box/field/textfield"
the xtype hierarchy string |
hashCode | public int hashCode()(Code) | | |
hide | public void hide()(Code) | | Hide this component.
|
initComponent | protected void initComponent()(Code) | | This template method is called after the Component has been instantiated but before it's rendered. Subclasses
can override it to provide any "constructor" type logic thats desired/
|
isCreated | public boolean isCreated()(Code) | | true if the underlying widget object has been created |
isDisabled | public boolean isDisabled()(Code) | | True if this component is disabled.
true if disabled |
isHidden | public boolean isHidden()(Code) | | true if the component is hidden |
isRendered | native public boolean isRendered()(Code) | | true if component has been rendered |
isVisible | native public boolean isVisible()(Code) | | Returns true if this component is visible.
true if visible |
isXType | native public boolean isXType(String xtype)(Code) | | Tests whether or not this component is of a specific xtype. This can test whether this component is descended from
the xtype (default) or whether it is directly of the xtype specified (shallow = true). For a list of all available xtypes,
see the
Component header. Example usage:
TextField t = new TextField();
boolean isText = t.isXType('textfield'); // true
boolean isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
boolean isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
Parameters: xtype - the xtype to check for this component true if is style |
isXType | native public boolean isXType(String xtype, boolean shallow)(Code) | | Tests whether or not this component is of a specific xtype. This can test whether this component is descended from
the xtype (default) or whether it is directly of the xtype specified (shallow = true). For a list of all available xtypes,
see the
Component header. Example usage:
TextField t = new TextField();
boolean isText = t.isXType('textfield'); // true
boolean isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
boolean isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
Parameters: xtype - the xtype to check for this component Parameters: shallow - false to check whether this component is descended from the xtype (this is the default), or true to check whether this component is directly of the specified xtype. true if is style |
onDestroy | protected void onDestroy()(Code) | | This template method is called on component destroy. Subclasses can add any cleanup logic on destoy here.
|
removeClass | native public void removeClass(String cls)(Code) | | Removes a CSS class from the component's underlying element.
Parameters: cls - the CSS class to remove |
render | native public void render(String id)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: id - the element id |
render | native public void render(String id, String position)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: id - the element id Parameters: position - the element ID within the container before which thiscomponent will be inserted (defaults to appending to the end of the container) |
render | native public void render(String id, int position)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: id - the element id Parameters: position - the DOM node index within the container before which thiscomponent will be inserted (defaults to appending to the end of the container) |
render | native public void render(Element element)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: element - the element |
render | native public void render(Element element, String position)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: element - the element Parameters: position - the element ID within the container before which thiscomponent will be inserted (defaults to appending to the end of the container) |
render | native public void render(Element element, int position)(Code) | | If this is a lazy rendering component, render it to its container element.
Parameters: element - the element Parameters: position - the DOM node index within the container before which thiscomponent will be inserted (defaults to appending to the end of the container) |
setApplyTo | public void setApplyTo(Element element) throws IllegalStateException(Code) | | The id of the node, a DOM node or an existing Element corresponding to a DIV that is
already present in the document that specifies some structural markup for this component.
When applyTo is used, constituent parts of the component can also be specified by id or CSS class name within the
main element, and the component being created may attempt to create its subcomponents from that markup if applicable.
Using this config, a call to render() is not required. If applyTo is specified, any value passed for renderTo will be
ignored and the target element's parent node will automatically be used as the component's container.
Parameters: element - the ID of existing DIV throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setAttribute | protected void setAttribute(String attribute, String value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, String value, boolean allowPostCreate, boolean allowPostRendered)(Code) | | |
setAttribute | protected void setAttribute(String attribute, int[] value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, int[] value, boolean allowPostCreate, boolean allowPostRender)(Code) | | |
setAttribute | protected void setAttribute(String attribute, long value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, double value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, int value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, int value, boolean allowPostCreate, boolean allowPostRender)(Code) | | |
setAttribute | protected void setAttribute(String attribute, Date value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate, boolean allowPostRender)(Code) | | |
setAttribute | protected void setAttribute(String attribute, String[] value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, String[] value, boolean allowPostCreate, boolean allowPostRender)(Code) | | |
setAttribute | protected void setAttribute(String attribute, boolean value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, boolean value, boolean allowPostCreate, boolean allowPostRendered)(Code) | | |
setAttribute | protected void setAttribute(String attribute, Element value, boolean allowPostCreate)(Code) | | |
setAttribute | protected void setAttribute(String attribute, Element value, boolean allowPostCreate, boolean allowPostRendered)(Code) | | |
setAutoShow | public void setAutoShow(boolean autoShow) throws IllegalStateException(Code) | | True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove them on render (defaults to false).
Parameters: autoShow - true to autoShow throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setCls | public void setCls(String cls)(Code) | | An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be useful
for adding customized styles to the component or any of its children using standard CSS rules.
Parameters: cls - the CSS class |
setCtCls | public void setCtCls(String ctCls) throws IllegalStateException(Code) | | An optional extra CSS class that will be added to this component's container (defaults to ''). This can be useful
for adding customized styles to the container or any of its children using standard CSS rules.
Parameters: ctCls - the container CSS class throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setDisabled | public void setDisabled(boolean disabled)(Code) | | Convenience function for setting disabled/enabled by boolean.
Parameters: disabled - true to disable |
setDisabledClass | public void setDisabledClass(String disabledClass)(Code) | | CSS class added to the component when it is disabled (defaults to "x-item-disabled").
Parameters: disabledClass - the disabled CSS class |
setEl | public void setEl(Element el) throws IllegalStateException(Code) | | Sets the underlying Element for the component.
Parameters: el - the element throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setHideMode | public void setHideMode(String hideMode)(Code) | | How this component should hidden. Supported values are "visibility" (css visibility), "offsets" (negative offset
position) and "display" (css display) - defaults to "display".
Parameters: hideMode - the hide mode |
setHideParent | public void setHideParent(boolean hideParent) throws IllegalStateException(Code) | | True to hide and show the component's container when hide/show is called on the component, false to hide and show
the component itself (defaults to false). For example, this can be used as a shortcut for a hide button on a window
by setting hide:true on the button when adding it to its parent container.
Parameters: hideParent - true to hide and show the component's container when hide/show is called on the component throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setId | final public void setId(String id) throws IllegalStateException(Code) | | The unique id of this component (defaults to an auto-assigned id).
Note: ID's cannot be changed after the component has been rendered.
Parameters: id - the components ID throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setRenderTo | public void setRenderTo(Element elem) throws IllegalStateException(Code) | | The id of the node, a DOM node or an existing Element that will be the container to render this component into.
Using this config, a call to render() is not required.
Parameters: elem - the container element throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setStateEvents | public void setStateEvents(String[] stateEvents) throws IllegalStateException(Code) | | An array of events that, when fired, should trigger this component to save its state (defaults to none). These can be
any types of events supported by this component, including browser or custom events (e.g., ['click', 'customerchange']).
Parameters: stateEvents - an array of state events throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setStateId | public void setStateId(String stateId) throws IllegalStateException(Code) | | The unique id for this component to use for state management purposes (defaults to the component id).
Parameters: stateId - the state ID throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setStyle | public void setStyle(String style) throws IllegalStateException(Code) | | A custom style specification to be applied to this component's Element.
Parameters: style - the CSS style specification throws: IllegalStateException - this property cannot be changed after the Component has been rendered |
setVisible | public void setVisible(boolean visible)(Code) | | Convenience function to hide or show this component by boolean.
Parameters: visible - True to show, false to hide |
show | public void show()(Code) | | Show this component.
|
|
|