Java Doc for Component.java in  » Ajax » MyGWT » net » mygwt » ui » client » widget » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » MyGWT » net.mygwt.ui.client.widget 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.mygwt.ui.client.widget.Component

All known Subclasses:   net.mygwt.ui.client.widget.Shadow,  net.mygwt.ui.client.widget.table.TableColumnUI,  net.mygwt.ui.client.widget.table.Table,  net.mygwt.ui.client.widget.Info,  net.mygwt.ui.client.widget.Container,  net.mygwt.ui.client.widget.ExpandItem,  net.mygwt.ui.client.widget.PagingToolBar,  net.mygwt.ui.client.widget.Item,  net.mygwt.ui.client.widget.Shell,  net.mygwt.ui.client.widget.tree.TreeItem,  net.mygwt.ui.client.widget.SplitBar,  net.mygwt.ui.client.widget.tree.Tree,  net.mygwt.ui.client.widget.HTMLComponent,  net.mygwt.ui.client.widget.ToolTip,  net.mygwt.ui.client.widget.Popup,  net.mygwt.ui.client.widget.table.TableItem,  net.mygwt.ui.client.widget.table.TableHeader,  net.mygwt.ui.client.widget.IconButton,
Component
abstract public class Component extends Widget (Code)
Base class for MyGWT widgets.
Events:
Resize : (widget, width, height)
Fires when the components location or size change.
  • widget : this
  • width : the widget width
  • height : the widget height
Enable : (widget)
Fires after the component is enabled.
  • widget : this
Disable : (widget)
Fires after the component is disabled.
  • widget : this
BeforeDispose : (widget)
Fires before the component is disposed.
  • widget : this
Dispose : (widget)
Fires after the component is disposed.
  • widget : this
BeforeHide : (widget)
Fires before the component is hidden.
  • widget : this
BeforeShow : (widget)
Fires before the component is shown.
  • widget : this
Hide : (widget)
Fires after the component is hidden.
  • widget : this
Show : (widget)
Fires after the component is shown.
  • widget : this
ContextMenu : (widget)
Fires before the components context menu is shown. Listeners can set the doit field to false to cancel the action.
  • widget : this
Attach : (widget)
Fires after the component is attached.
  • widget : this
Detach : (widget)
Fires after the component is detached.
  • widget : this
Render : (widget)
Fires after the component is rendered.
  • widget : this


Field Summary
protected  RectangleattachBounds
    
protected  StringbaseStyle
     The base style is typically set as the component's style when rendered.
protected  MenucontextMenu
    
protected  StringdisabledStyle
     The style used when a component is disabled.
protected  ElementfocusElem
    
protected  booleanrendereddisposed
    
protected  intstyle
    

Constructor Summary
public  Component()
     Creates a new component instance.
public  Component(int style)
     Creates a new component instance with the given style.

Method Summary
public  voidaddListener(int eventType, Listener listener)
     Adds a listener bound by the given event type.
public  voidaddStyleName(String style)
     Adds a CSS style name to the component's underlying element.
public  voidaddWidgetListener(WidgetListener listener)
     Adds a listener to receive widget events.
protected  voidafterRender()
     Called after the component has been rendered.
protected  Componentblur()
    
public  voiddisable()
     Disable this component.
protected  voiddisableContextMenu(boolean disable)
     Enables and disables the component's context menu.
public  voiddisableTextSelection(boolean disable)
     Enables and disables text selection for the component.
public  voiddispose()
     Disposes this component by purging any event listeners, removing the component's element from the DOM, removing the component from its parent (if applicable).
public  voidenable()
     Enable this component.
public  voidenableEvents(boolean enable)
     Enables or disables event processing.
public  booleanfireEvent(int type)
     Fires an event.
public  booleanfireEvent(int type, BaseEvent be)
     Fires an event.
public  booleanfireEvent(int eventType, Widget widget, Widget item)
     Fires an event.
public  booleanfireEvent(int eventType, Widget widget, Widget item, int index)
     Fires an event.
public  Componentfocus()
     Try to focus this component.
public  RectanglegetBounds()
     Returns the component's bounds.
public  RectanglegetBounds(boolean content)
     Returns the component's bounds.
protected  MenugetContextMenu()
     Returns the component's context menu.
public  ObjectgetData()
     Returns the application defined data associated with the component, or null if it has not been set.
public  ObjectgetData(String key)
     Returns the application defined property for the given name, or null if it has not been set.
public  StringgetDisabledStyle()
     Returns the disabled style.
public  ElementgetElement()
    
protected  ElementgetFocusElement()
    
public  intgetHeight()
     Returns the component's height.
public  intgetHeight(boolean content)
     Returns the component's height.
public  StringgetId()
     Returns the component's id.
public  intgetStyle()
     Returns the component's style information.
public  ToolTipgetToolTip()
     Returns the component's tool tip.
public  intgetWidth()
     Returns the component's width.
public  intgetWidth(boolean content)
     Returns the component's width.
public  voidhide()
     Hide this component.
public  booleanisDisposed()
     Returns true if the component is disposed.
public  booleanisEnabled()
     Returns true if the component is enabled.
public  booleanisRendered()
     Returns true if the component is rendered.
public  booleanisVisible()
     Returns true if the component is visible.
protected  voidonAttach()
    
public  voidonBaseEvent(BaseEvent be)
     Any events a component receives will be forwarded to this method. Subclasses should override as needed.
public  voidonBrowserEvent(Event event)
     Components delegate event handling to Component.onBaseEvent .
protected  voidonDestroy()
    
protected  voidonDetach()
    
protected  voidonDisable()
    
protected  voidonEnable()
    
protected  voidonHide()
    
protected  voidonHideContextMenu()
    
protected  voidonLoad()
    
protected  voidonRender()
     Subclasses should override and ensure setElement is called.
protected  voidonResize(int width, int height)
     Called whenever the component is resized.
protected  voidonRightClick(BaseEvent be)
    
protected  voidonShow()
    
protected  voidonShowContextMenu(int x, int y)
    
public  voidrecalculate()
     Notifies the component that it should recalculate its layout based on its current size if neccessary.
public  voidremoveAllListeners()
     Removes all listeners.
public  voidremoveFromParent()
    
public  voidremoveListener(int eventType, Listener listener)
     Removes a listener.
public  voidremoveStyleName(String style)
     Removes a CSS style name from the component's underlying element.
public  voidremoveWidgetListener(WidgetListener listener)
     Removes a previously added listener.
protected  voidrender()
     Renders the element.
public  voidsetBorders(boolean show)
     Adds or removes a border.
public  voidsetBounds(int x, int y, int width, int height)
     Sets the component's bounds.
public  voidsetBounds(Rectangle rect)
     Sets the component's bounds.
protected  voidsetContextMenu(Menu menu)
     Sets the component's context menu.
public  voidsetData(Object data)
     Sets the application defined component data.
public  voidsetData(String key, Object data)
     Sets the application defined property with the given name.
public  voidsetDisabledStyle(String style)
     Sets the disabled style.
public  voidsetElement(Element elem)
    
public  voidsetEnabled(boolean enabled)
     Convenience function for setting disabled/enabled by boolean.
public  voidsetHeight(int height)
     Sets the component's height.
public  voidsetHeight(String height)
     Sets the object's height.
public  voidsetId(String id)
     Sets the component's id.
public  voidsetIntStyleAttribute(String attr, int value)
     Sets a style attribute.
public  voidsetPagePosition(int x, int y)
     Sets the page XY position of the component.
public  voidsetPixelSize(int width, int height)
    
public  voidsetSize(int width, int height)
     Sets the width and height of the component.
public  voidsetSize(String width, String height)
     Sets the component's size.
public  voidsetStyleAttribute(String attr, String value)
     Sets a style attribute.
public  voidsetStyleName(String style)
    
public  voidsetTitle(String title)
    
public  voidsetToolTip(String text)
     Sets the component's tool tip.
public  voidsetToolTip(String title, String text)
     Sets the component's tool tip.
public  voidsetVisible(boolean visible)
     Convenience function to hide or show this component by boolean.
public  voidsetWidth(int width)
     Sets the component's width.
public  voidsetWidth(String width)
     Sets the component's width.
public  voidshow()
     Show this component.
public  voidunhook(int type, EventListener listener)
    

Field Detail
attachBounds
protected Rectangle attachBounds(Code)



baseStyle
protected String baseStyle(Code)
The base style is typically set as the component's style when rendered. All child styles should be calculated based on the the base style when the component is rendered. This allows the component's style to be swapped by only modifying the basse style. Default value is null.



contextMenu
protected Menu contextMenu(Code)



disabledStyle
protected String disabledStyle(Code)
The style used when a component is disabled. Default value is "my-component-disabled".



focusElem
protected Element focusElem(Code)



rendereddisposed
protected boolean rendereddisposed(Code)



style
protected int style(Code)




Constructor Detail
Component
public Component()(Code)
Creates a new component instance.



Component
public Component(int style)(Code)
Creates a new component instance with the given style.
Parameters:
  style - the component's style information




Method Detail
addListener
public void addListener(int eventType, Listener listener)(Code)
Adds a listener bound by the given event type.
Parameters:
  eventType - the eventType
Parameters:
  listener - the listener to be added



addStyleName
public void addStyleName(String style)(Code)
Adds a CSS style name to the component's underlying element.
Parameters:
  style - the CSS style name to add



addWidgetListener
public void addWidgetListener(WidgetListener listener)(Code)
Adds a listener to receive widget events.
Parameters:
  listener - the listener to be added



afterRender
protected void afterRender()(Code)
Called after the component has been rendered.



blur
protected Component blur()(Code)



disable
public void disable()(Code)
Disable this component.



disableContextMenu
protected void disableContextMenu(boolean disable)(Code)
Enables and disables the component's context menu.
Parameters:
  disable - true to disable the context menu



disableTextSelection
public void disableTextSelection(boolean disable)(Code)
Enables and disables text selection for the component.
Parameters:
  disable - true to disable text selection



dispose
public void dispose()(Code)
Disposes this component by purging any event listeners, removing the component's element from the DOM, removing the component from its parent (if applicable). Subclasses should override as needed.



enable
public void enable()(Code)
Enable this component.



enableEvents
public void enableEvents(boolean enable)(Code)
Enables or disables event processing.
Parameters:
  enable - the enable state



fireEvent
public boolean fireEvent(int type)(Code)
Fires an event.
Parameters:
  type - the event type false if any listeners return false



fireEvent
public boolean fireEvent(int type, BaseEvent be)(Code)
Fires an event.
Parameters:
  type - the event type
Parameters:
  be - the base event false if any listeners return false



fireEvent
public boolean fireEvent(int eventType, Widget widget, Widget item)(Code)
Fires an event.
Parameters:
  eventType - the event type
Parameters:
  widget - the source widget
Parameters:
  item - the action widget true if any listeners cancel the event



fireEvent
public boolean fireEvent(int eventType, Widget widget, Widget item, int index)(Code)
Fires an event.
Parameters:
  eventType - the event type
Parameters:
  widget - the source widget
Parameters:
  item - the action widget
Parameters:
  index - the index true if any listeners cancel the event



focus
public Component focus()(Code)
Try to focus this component. this



getBounds
public Rectangle getBounds()(Code)
Returns the component's bounds. the component bounds



getBounds
public Rectangle getBounds(boolean content)(Code)
Returns the component's bounds.
Parameters:
  content - true to adjust for box model issues the elements bounds



getContextMenu
protected Menu getContextMenu()(Code)
Returns the component's context menu. This method is marked protected, subclasses can change access to public to expose the contenxt menu. the context menu



getData
public Object getData()(Code)
Returns the application defined data associated with the component, or null if it has not been set.



getData
public Object getData(String key)(Code)
Returns the application defined property for the given name, or null if it has not been set.
Parameters:
  key - the name of the property the value or null if it has not been set



getDisabledStyle
public String getDisabledStyle()(Code)
Returns the disabled style. the disabled style



getElement
public Element getElement()(Code)



getFocusElement
protected Element getFocusElement()(Code)



getHeight
public int getHeight()(Code)
Returns the component's height. the height



getHeight
public int getHeight(boolean content)(Code)
Returns the component's height.
Parameters:
  content - true to get the height minus borders andpadding the height



getId
public String getId()(Code)
Returns the component's id. If an id has not been set one will be created. the component's id



getStyle
public int getStyle()(Code)
Returns the component's style information. the style information



getToolTip
public ToolTip getToolTip()(Code)
Returns the component's tool tip. the tool tip



getWidth
public int getWidth()(Code)
Returns the component's width. the width



getWidth
public int getWidth(boolean content)(Code)
Returns the component's width.
Parameters:
  content - true to get the width minus borders andpadding the component's width



hide
public void hide()(Code)
Hide this component.



isDisposed
public boolean isDisposed()(Code)
Returns true if the component is disposed. the dispose state



isEnabled
public boolean isEnabled()(Code)
Returns true if the component is enabled. the enabled state



isRendered
public boolean isRendered()(Code)
Returns true if the component is rendered. the rendered state



isVisible
public boolean isVisible()(Code)
Returns true if the component is visible. A component is visible if it is rendered and visible as defined by MyDOM.isVisible(Element) .



onAttach
protected void onAttach()(Code)



onBaseEvent
public void onBaseEvent(BaseEvent be)(Code)
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent method should not be overridden or modified.
Parameters:
  be - the base event



onBrowserEvent
public void onBrowserEvent(Event event)(Code)
Components delegate event handling to Component.onBaseEvent . Sublcasses should not override.
Parameters:
  event - the dom event



onDestroy
protected void onDestroy()(Code)



onDetach
protected void onDetach()(Code)



onDisable
protected void onDisable()(Code)



onEnable
protected void onEnable()(Code)



onHide
protected void onHide()(Code)



onHideContextMenu
protected void onHideContextMenu()(Code)



onLoad
protected void onLoad()(Code)



onRender
protected void onRender()(Code)
Subclasses should override and ensure setElement is called.



onResize
protected void onResize(int width, int height)(Code)
Called whenever the component is resized. Default implementation calls recalcuate.
Parameters:
  width - the new width
Parameters:
  height - the new height



onRightClick
protected void onRightClick(BaseEvent be)(Code)



onShow
protected void onShow()(Code)



onShowContextMenu
protected void onShowContextMenu(int x, int y)(Code)



recalculate
public void recalculate()(Code)
Notifies the component that it should recalculate its layout based on its current size if neccessary. Default implementation does nothing.



removeAllListeners
public void removeAllListeners()(Code)
Removes all listeners.



removeFromParent
public void removeFromParent()(Code)



removeListener
public void removeListener(int eventType, Listener listener)(Code)
Removes a listener.
Parameters:
  eventType - the event type
Parameters:
  listener - the listener to be removed



removeStyleName
public void removeStyleName(String style)(Code)
Removes a CSS style name from the component's underlying element.
Parameters:
  style - the CSS style name to remove



removeWidgetListener
public void removeWidgetListener(WidgetListener listener)(Code)
Removes a previously added listener.
Parameters:
  listener - the listener to be removed



render
protected void render()(Code)
Renders the element. This method is not intended to be called directly.



setBorders
public void setBorders(boolean show)(Code)
Adds or removes a border. The style name 'my-border' is added to the widget to display a border.
Parameters:
  show - the show state



setBounds
public void setBounds(int x, int y, int width, int height)(Code)
Sets the component's bounds.
Parameters:
  x - the x coordinate
Parameters:
  y - the y coordinate
Parameters:
  width - the new width
Parameters:
  height - the new height



setBounds
public void setBounds(Rectangle rect)(Code)
Sets the component's bounds.
Parameters:
  rect - the bounds



setContextMenu
protected void setContextMenu(Menu menu)(Code)
Sets the component's context menu.
Parameters:
  menu - the context menu



setData
public void setData(Object data)(Code)
Sets the application defined component data.
Parameters:
  data - the widget data



setData
public void setData(String key, Object data)(Code)
Sets the application defined property with the given name.
Parameters:
  key - the name of the property
Parameters:
  data - the new value for the property



setDisabledStyle
public void setDisabledStyle(String style)(Code)
Sets the disabled style. Default value is 'my-item-disabled'.
Parameters:
  style - the disabled style



setElement
public void setElement(Element elem)(Code)



setEnabled
public void setEnabled(boolean enabled)(Code)
Convenience function for setting disabled/enabled by boolean.
Parameters:
  enabled - the enabled state



setHeight
public void setHeight(int height)(Code)
Sets the component's height.
Parameters:
  height - the new height



setHeight
public void setHeight(String height)(Code)
Sets the object's height. This height does not include decorations such as border, margin, and padding.
Parameters:
  height - the object's new height, in CSS units (e.g. "10px", "1em")



setId
public void setId(String id)(Code)
Sets the component's id.
Parameters:
  id - the new id



setIntStyleAttribute
public void setIntStyleAttribute(String attr, int value)(Code)
Sets a style attribute.
Parameters:
  attr - the attribute
Parameters:
  value - the attribute value



setPagePosition
public void setPagePosition(int x, int y)(Code)
Sets the page XY position of the component.
Parameters:
  x - the x coordinate
Parameters:
  y - the y coordinate



setPixelSize
public void setPixelSize(int width, int height)(Code)



setSize
public void setSize(int width, int height)(Code)
Sets the width and height of the component. This method fires the resize event.
Parameters:
  width - the new width
Parameters:
  height - the new height



setSize
public void setSize(String width, String height)(Code)
Sets the component's size. This size does not include decorations such as border, margin, and padding.
Parameters:
  width - the object's new width, in CSS units (e.g. "10px", "1em")
Parameters:
  height - the object's new height, in CSS units (e.g. "10px", "1em")



setStyleAttribute
public void setStyleAttribute(String attr, String value)(Code)
Sets a style attribute.
Parameters:
  attr - the attribute
Parameters:
  value - the attribute value



setStyleName
public void setStyleName(String style)(Code)



setTitle
public void setTitle(String title)(Code)



setToolTip
public void setToolTip(String text)(Code)
Sets the component's tool tip.
Parameters:
  text - the text



setToolTip
public void setToolTip(String title, String text)(Code)
Sets the component's tool tip.
Parameters:
  title - the title
Parameters:
  text - the text



setVisible
public void setVisible(boolean visible)(Code)
Convenience function to hide or show this component by boolean.
Parameters:
  visible - the visible state



setWidth
public void setWidth(int width)(Code)
Sets the component's width.
Parameters:
  width - the width



setWidth
public void setWidth(String width)(Code)
Sets the component's width. This width does not include decorations such as border, margin, and padding.
Parameters:
  width - the object's new width, in CSS units (e.g. "10px", "1em")



show
public void show()(Code)
Show this component.



unhook
public void unhook(int type, EventListener listener)(Code)



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.