Java Doc for Grid.java in  » Ajax » zk » org » zkoss » zul » 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 » zk » org.zkoss.zul 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.zkoss.zul.impl.XulElement
   org.zkoss.zul.Grid

Grid
public class Grid extends XulElement (Code)
A grid is an element that contains both rows and columns elements. It is used to create a grid of elements. Both the rows and columns are displayed at once although only one will typically contain content, while the other may provide size information.

Besides creating Row programmingly, you can assign a data model (a ListModel instance) to a grid via Grid.setModel and then the grid will retrieve data by calling ListModel.getElementAt when necessary.

Besides assign a list model, you could assign a renderer (a RowRenderer instance) to a grid, such that the grid will use this renderer to render the data returned by ListModel.getElementAt . If not assigned, the default renderer, which assumes a label per row, is used. In other words, the default renderer adds a label to a row by calling toString against the object returned by ListModel.getElementAt

There are two ways to handle long content: scrolling and paging. If Grid.getMold is "default", scrolling is used if Grid.setHeight is called and too much content to display. If Grid.getMold is "paging", paging is used if two or more pages are required. To control the number of rows to display in a page, use Grid.setPageSize .

If paging is used, the page controller is either created automatically or assigned explicity by Grid.setPaginal . The paging controller specified explicitly by Grid.setPaginal is called the external page controller. It is useful if you want to put the paging controller at different location (other than as a child component), or you want to use the same controller to control multiple grids.

Default Grid.getSclass : grid.

To have a grid without stripping, you can specify a non-existent style class to Grid.setOddRowSclass . If you want to disable all striping, you can specify the style:


 tr.odd td.gc {
 background: white;
 }
 

author:
   tomyeh
See Also:   ListModel
See Also:   RowRenderer
See Also:   RowRendererExt

Inner Class :protected class ExtraCtrl extends XulElement.ExtraCtrl implements InnerWidth,RenderOnDemand


Constructor Summary
public  Grid()
    

Method Summary
public  Objectclone()
    
public  StringgetAlign()
     Returns the horizontal alignment of the whole grid.
public  ComponentgetCell(int row, int col)
     Returns the specified cell, or null if not available.
public  ColumnsgetColumns()
     Returns the columns.
public  FootgetFoot()
     Returns the foot.
public  CollectiongetHeads()
     Returns a collection of heads, including Grid.getColumns and auxiliary heads ( Auxhead ) (never null).
public  StringgetInnerWidth()
     Returns the inner width of this component.
public  ListModelgetModel()
     Returns the list model associated with this grid, or null if this grid is not associated with any list data model.
public  StringgetOddRowSclass()
     Returns the style class for the odd rows.
public  StringgetOuterAttrs()
    
public  intgetPageSize()
     Returns the page size, aka., the number rows per page.
public  PaginalgetPaginal()
     Returns the paging controller, or null if not available.
public  PaginggetPaging()
     Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by Grid.setPaginal .
public  intgetPreloadSize()
     Returns the number of rows to preload when receiving the rendering request from the client.
public  RowRenderergetRowRenderer()
     Returns the renderer to render each row, or null if the default renderer is used.
public  RowsgetRows()
     Returns the rows.
 booleaninPagingMold()
     Returns whether this grid is in the paging mold.
public  booleaninsertBefore(Component newChild, Component refChild)
    
protected  ObjectnewExtraCtrl()
    
public  voidonInitRender()
     Handles a private event, onInitRender.
public  booleanremoveChild(Component child)
    
public  voidrenderAll()
     Renders all Row if not loaded yet, with Grid.getRowRenderer .
public  voidrenderItems(Set rows)
    
public  voidrenderRow(Row row)
     Renders the specified Row if not loaded yet, with Grid.getRowRenderer .
public  voidrenderRows(Set rows)
     Renders a set of specified rows.
public  voidsetAlign(String align)
     Sets the horizontal alignment of the whole grid.
public  voidsetInnerWidth(String innerWidth)
     Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%.
public  voidsetModel(ListModel model)
     Sets the list model associated with this grid.
public  voidsetMold(String mold)
    
public  voidsetOddRowSclass(String scls)
     Sets the style class for the odd rows.
public  voidsetPageSize(int pgsz)
     Sets the page size, aka., the number rows per page.
public  voidsetPaginal(Paginal pgi)
    
public  voidsetPreloadSize(int sz)
     Sets the number of rows to preload when receiving the rendering request from the client.

It is used only if live data ( Grid.setModel and not paging ( Grid.getPaging .
Parameters:
  sz - the number of rows to preload.

public  voidsetRowRenderer(RowRenderer renderer)
     Sets the renderer which is used to render each row if Grid.getModel is not null.
public  voidsetRowRenderer(String clsnm)
     Sets the renderer by use of a class name.


Constructor Detail
Grid
public Grid()(Code)




Method Detail
clone
public Object clone()(Code)



getAlign
public String getAlign()(Code)
Returns the horizontal alignment of the whole grid.

Default: null (system default: left unless CSS specified).




getCell
public Component getCell(int row, int col)(Code)
Returns the specified cell, or null if not available.
Parameters:
  row - which row to fetch (starting at 0).
Parameters:
  col - which column to fetch (starting at 0).



getColumns
public Columns getColumns()(Code)
Returns the columns.



getFoot
public Foot getFoot()(Code)
Returns the foot.



getHeads
public Collection getHeads()(Code)
Returns a collection of heads, including Grid.getColumns and auxiliary heads ( Auxhead ) (never null).
since:
   3.0.0



getInnerWidth
public String getInnerWidth()(Code)
Returns the inner width of this component. The inner width is the width of the inner table.

Default: "100%"
See Also:   Grid.setInnerWidth
since:
   3.0.0




getModel
public ListModel getModel()(Code)
Returns the list model associated with this grid, or null if this grid is not associated with any list data model.



getOddRowSclass
public String getOddRowSclass()(Code)
Returns the style class for the odd rows.

Default: odd.
since:
   3.0.0




getOuterAttrs
public String getOuterAttrs()(Code)



getPageSize
public int getPageSize()(Code)
Returns the page size, aka., the number rows per page.
exception:
  IllegalStateException - if Grid.getPaginal returns null,i.e., mold is not "paging" and no external controller is specified.



getPaginal
public Paginal getPaginal()(Code)
Returns the paging controller, or null if not available. Note: the paging controller is used only if Grid.getMold is "paging".

If mold is "paging", this method never returns null, because a child paging controller is created automcatically (if not specified by developers with Grid.setPaginal ).

If a paging controller is specified (either by Grid.setPaginal , or by Grid.setMold with "paging"), the grid will rely on the paging controller to handle long-content instead of scrolling.




getPaging
public Paging getPaging()(Code)
Returns the child paging controller that is created automatically, or null if mold is not "paging", or the controller is specified externally by Grid.setPaginal .



getPreloadSize
public int getPreloadSize()(Code)
Returns the number of rows to preload when receiving the rendering request from the client.

Default: 7.

It is used only if live data ( Grid.setModel and not paging ( Grid.getPaging .
since:
   2.4.1




getRowRenderer
public RowRenderer getRowRenderer()(Code)
Returns the renderer to render each row, or null if the default renderer is used.



getRows
public Rows getRows()(Code)
Returns the rows.



inPagingMold
boolean inPagingMold()(Code)
Returns whether this grid is in the paging mold.



insertBefore
public boolean insertBefore(Component newChild, Component refChild)(Code)



newExtraCtrl
protected Object newExtraCtrl()(Code)



onInitRender
public void onInitRender()(Code)
Handles a private event, onInitRender. It is used only for implementation, and you rarely need to invoke it explicitly.



removeChild
public boolean removeChild(Component child)(Code)



renderAll
public void renderAll()(Code)
Renders all Row if not loaded yet, with Grid.getRowRenderer .



renderItems
public void renderItems(Set rows)(Code)



renderRow
public void renderRow(Row row)(Code)
Renders the specified Row if not loaded yet, with Grid.getRowRenderer .

It does nothing if Grid.getModel returns null. In other words, it is meaningful only if live data model is used.




renderRows
public void renderRows(Set rows)(Code)
Renders a set of specified rows. It is the same as Grid.renderItems .



setAlign
public void setAlign(String align)(Code)
Sets the horizontal alignment of the whole grid.

Allowed: "left", "center", "right"




setInnerWidth
public void setInnerWidth(String innerWidth)(Code)
Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%. That is, it is the same as the width of this component. However, it is changed when the user is sizing the column's width.

Application developers rarely call this method, unless they want to preserve the widths of sizable columns changed by the user. To preserve the widths, the developer have to store the widths of all columns and the inner width ( Grid.getInnerWidth ), and then restore them when re-creating this component.
Parameters:
  innerWidth - the inner width. If null, "100%" is assumed.
since:
   3.0.0




setModel
public void setModel(ListModel model)(Code)
Sets the list model associated with this grid. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.
Parameters:
  model - the list model to associate, or null to dis-associateany previous model.
exception:
  UiException - if failed to initialize with the model



setMold
public void setMold(String mold)(Code)



setOddRowSclass
public void setOddRowSclass(String scls)(Code)
Sets the style class for the odd rows. If the style class doesn't exist, the striping effect disappears. You can provide different effects by providing the proper style classes.
since:
   3.0.0



setPageSize
public void setPageSize(int pgsz)(Code)
Sets the page size, aka., the number rows per page.
exception:
  IllegalStateException - if Grid.getPaginal returns null,i.e., mold is not "paging" and no external controller is specified.



setPaginal
public void setPaginal(Paginal pgi)(Code)



setPreloadSize
public void setPreloadSize(int sz)(Code)
Sets the number of rows to preload when receiving the rendering request from the client.

It is used only if live data ( Grid.setModel and not paging ( Grid.getPaging .
Parameters:
  sz - the number of rows to preload. If zero, no preloadat all.
exception:
  UiException - if sz is negative
since:
   2.4.1




setRowRenderer
public void setRowRenderer(RowRenderer renderer)(Code)
Sets the renderer which is used to render each row if Grid.getModel is not null.

Note: changing a render will not cause the grid to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(getModel())), or fire an ListDataEvent event.
Parameters:
  renderer - the renderer, or null to use the default.
exception:
  UiException - if failed to initialize with the model




setRowRenderer
public void setRowRenderer(String clsnm) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, java.lang.reflect.InvocationTargetException(Code)
Sets the renderer by use of a class name. It creates an instance automatically.



Methods inherited from org.zkoss.zul.impl.XulElement
public String getAction()(Code)(Java Doc)
public String getActionAttrs()(Code)(Java Doc)
protected String getAllOnClickAttrs(boolean ignoreOnClick)(Code)(Java Doc)
public String getContext()(Code)(Java Doc)
public String getInnerAttrs()(Code)(Java Doc)
public String getOuterAttrs()(Code)(Java Doc)
public String getPopup()(Code)(Java Doc)
public String getTooltip()(Code)(Java Doc)
public void setAction(String action)(Code)(Java Doc)
public void setContext(String context)(Code)(Java Doc)
public void setContext(Popup popup)(Code)(Java Doc)
public void setPopup(String popup)(Code)(Java Doc)
public void setPopup(Popup popup)(Code)(Java Doc)
public void setTooltip(String tooltip)(Code)(Java Doc)
public void setTooltip(Popup popup)(Code)(Java Doc)

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