Java Doc for Listheader.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.HeaderElement
   org.zkoss.zul.Listheader

Listheader
public class Listheader extends HeaderElement (Code)
The list header which defines the attributes and header of a columen of a list box. Its parent must be Listhead .

Difference from XUL:

  1. There is no listcol in ZUL because it is merged into Listheader . Reason: easier to write Listbox.

author:
   tomyeh



Constructor Summary
public  Listheader()
    
public  Listheader(String label)
    
public  Listheader(String label, String src)
    

Method Summary
public  Objectclone()
    
public  StringgetColumnHtmlPrefix()
     Returns the prefix of the first column (in HTML tags), null if this is not first column.
public  intgetColumnIndex()
     Returns the column index, starting from 0.
public  ListboxgetListbox()
     Returns the listbox that this belongs to.
public  ListheadgetListhead()
     Returns the listhead that this belongs to.
public  intgetMaxlength()
     Returns the maximal length of each item's label.
public  StringgetOuterAttrs()
    
public  StringgetSclass()
     Returns the style class.
public  ComparatorgetSortAscending()
     Returns the ascending sorter, or null if not available.
public  ComparatorgetSortDescending()
     Returns the descending sorter, or null if not available.
public  StringgetSortDirection()
     Returns the sort direction.
protected  voidinvalidateWhole()
     Invalidates the whole box.
public  voidonSort()
     It invokes Listheader.sort(boolean) to sort list items and maintain Listheader.getSortDirection .
public  voidsetMaxlength(int maxlength)
     Sets the maximal length of each item's label.
public  voidsetParent(Component parent)
    
public  voidsetSort(String type)
     Sets the type of the sorter.
public  voidsetSortAscending(Comparator sorter)
     Sets the ascending sorter, or null for no sorter for the ascending order.
public  voidsetSortAscending(String clsnm)
     Sets the ascending sorter with the class name, or null for no sorter for the ascending order.
public  voidsetSortDescending(Comparator sorter)
     Sets the descending sorter, or null for no sorter for the descending order.
public  voidsetSortDescending(String clsnm)
     Sets the descending sorter with the class name, or null for no sorter for the descending order.
public  voidsetSortDirection(String sortDir)
     Sets the sort direction.
public  booleansort(boolean ascending)
     Sorts the list items based on Listheader.getSortAscending and Listheader.getSortDescending , if Listheader.getSortDirection doesn't matches the ascending argument.

It checks Listheader.getSortDirection to see whether sorting is required, and update Listheader.setSortDirection after sorted. For example, if Listheader.getSortDirection returns "ascending" and the ascending argument is false, nothing happens. To enforce the sorting, you can invoke Listheader.setSortDirection with "natural" before invoking this method. Alternatively, you can invoke Listheader.sort(boolean,boolean) instead.

It sorts the listitem by use of Components.sort data (i.e., Grid.getModel is null).

On the other hand, it invokes ListModelExt.sort to sort the list item, if live data (i.e., Listbox.getModel is not null). In other words, if you use the live data, you have to implement ListModelExt to sort the live data explicitly.
Parameters:
  ascending - whether to use Listheader.getSortAscending.If the corresponding comparator is not set, it returns falseand does nothing.

public  booleansort(boolean ascending, boolean force)
     Sorts the list items based on Listheader.getSortAscending and Listheader.getSortDescending .
Parameters:
  ascending - whether to use Listheader.getSortAscending.If the corresponding comparator is not set, it returns falseand does nothing.
Parameters:
  force - whether to enforce the sorting no matter what the sortdirection (Listheader.getSortDirection) is.If false, this method is the same as Listheader.sort(boolean).


Constructor Detail
Listheader
public Listheader()(Code)



Listheader
public Listheader(String label)(Code)



Listheader
public Listheader(String label, String src)(Code)




Method Detail
clone
public Object clone()(Code)



getColumnHtmlPrefix
public String getColumnHtmlPrefix()(Code)
Returns the prefix of the first column (in HTML tags), null if this is not first column. Called only by listheader.dsp.
since:
   3.0.1



getColumnIndex
public int getColumnIndex()(Code)
Returns the column index, starting from 0.



getListbox
public Listbox getListbox()(Code)
Returns the listbox that this belongs to.



getListhead
public Listhead getListhead()(Code)
Returns the listhead that this belongs to.



getMaxlength
public int getMaxlength()(Code)
Returns the maximal length of each item's label. Default: 0 (no limit).



getOuterAttrs
public String getOuterAttrs()(Code)



getSclass
public String getSclass()(Code)
Returns the style class. If the style class is not defined ( Listheader.setSclass is not called or called with null or empty), it returns "sort" if sortable, or null if not sortable.

By sortable we mean that Listheader.setSortAscending or Listheader.setSortDescending was called with a non-null comparator




getSortAscending
public Comparator getSortAscending()(Code)
Returns the ascending sorter, or null if not available.



getSortDescending
public Comparator getSortDescending()(Code)
Returns the descending sorter, or null if not available.



getSortDirection
public String getSortDirection()(Code)
Returns the sort direction.

Default: "natural".




invalidateWhole
protected void invalidateWhole()(Code)
Invalidates the whole box.



onSort
public void onSort()(Code)
It invokes Listheader.sort(boolean) to sort list items and maintain Listheader.getSortDirection .



setMaxlength
public void setMaxlength(int maxlength)(Code)
Sets the maximal length of each item's label.



setParent
public void setParent(Component parent)(Code)



setSort
public void setSort(String type)(Code)
Sets the type of the sorter. You might specify either "auto" or "none".

If "auto" is specified, it will call Listheader.setSortAscending and/or Listheader.setSortDescending are called with ListitemComparator , if Listheader.getSortDescending and/or Listheader.getSortAscending are null. If you assigned a comparator to them, it won't be affected. The auto created comparator is case-insensitive.

If "none" is specified, both Listheader.setSortAscending and Listheader.setSortDescending are called with null. Therefore, no more sorting is available to users for this column.




setSortAscending
public void setSortAscending(Comparator sorter)(Code)
Sets the ascending sorter, or null for no sorter for the ascending order.



setSortAscending
public void setSortAscending(String clsnm) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code)
Sets the ascending sorter with the class name, or null for no sorter for the ascending order.



setSortDescending
public void setSortDescending(Comparator sorter)(Code)
Sets the descending sorter, or null for no sorter for the descending order.



setSortDescending
public void setSortDescending(String clsnm) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code)
Sets the descending sorter with the class name, or null for no sorter for the descending order.



setSortDirection
public void setSortDirection(String sortDir) throws WrongValueException(Code)
Sets the sort direction. This does not sort the data, it only serves as an indicator as to how the list is sorted.

If you use Listheader.sort(boolean) to sort list items, the sort direction is maintained automatically. If you want to sort it in customized way, you have to set the sort direction manaully.
Parameters:
  sortDir - one of "ascending", "descending" and "natural"




sort
public boolean sort(boolean ascending)(Code)
Sorts the list items based on Listheader.getSortAscending and Listheader.getSortDescending , if Listheader.getSortDirection doesn't matches the ascending argument.

It checks Listheader.getSortDirection to see whether sorting is required, and update Listheader.setSortDirection after sorted. For example, if Listheader.getSortDirection returns "ascending" and the ascending argument is false, nothing happens. To enforce the sorting, you can invoke Listheader.setSortDirection with "natural" before invoking this method. Alternatively, you can invoke Listheader.sort(boolean,boolean) instead.

It sorts the listitem by use of Components.sort data (i.e., Grid.getModel is null).

On the other hand, it invokes ListModelExt.sort to sort the list item, if live data (i.e., Listbox.getModel is not null). In other words, if you use the live data, you have to implement ListModelExt to sort the live data explicitly.
Parameters:
  ascending - whether to use Listheader.getSortAscending.If the corresponding comparator is not set, it returns falseand does nothing. whether the list items are sorted.
exception:
  UiException - if Listbox.getModel is notnull but ListModelExt is not implemented.




sort
public boolean sort(boolean ascending, boolean force)(Code)
Sorts the list items based on Listheader.getSortAscending and Listheader.getSortDescending .
Parameters:
  ascending - whether to use Listheader.getSortAscending.If the corresponding comparator is not set, it returns falseand does nothing.
Parameters:
  force - whether to enforce the sorting no matter what the sortdirection (Listheader.getSortDirection) is.If false, this method is the same as Listheader.sort(boolean). whether the rows are sorted.



Methods inherited from org.zkoss.zul.impl.HeaderElement
public String getAlign()(Code)(Java Doc)
public String getColAttrs()(Code)(Java Doc)
public String getOuterAttrs()(Code)(Java Doc)
public String getValign()(Code)(Java Doc)
abstract protected void invalidateWhole()(Code)(Java Doc)
public void setAlign(String align)(Code)(Java Doc)
public void setValign(String valign)(Code)(Java Doc)
public boolean setVisible(boolean visible)(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.