Java Doc for Window.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.Window

All known Subclasses:   org.zkoss.zul.impl.MessageboxDlg,  org.zkoss.zul.impl.FileuploadDlg,
Window
public class Window extends XulElement implements IdSpace(Code)
A generic window.

Unlike other elements, each Window is an independent ID space (by implementing IdSpace ). It means a window and all its descendants forms a ID space and the ID of each of them is unique in this space. You could retrieve any of them in this space by calling Window.getFellow .

If a window X is a descendant of another window Y, X's descendants are not visible in Y's space. To retrieve a descendant, say Z, of X, you have to invoke Y.getFellow('X').getFellow('Z').

Events:
onMove, onOpen, onClose, onOK, onCacnel and onCtrlKey.
Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see org.zkoss.zk.ui.event.Deferrable ).

onClose is sent when the close button is pressed (if Window.isClosable is true). The window has to detach or hide the window. By default, Window.onClose detaches the window. To prevent it from detached, you have to call org.zkoss.zk.ui.event.Event.stopPropagation to prevent Window.onClose is called.

On the other hand, onOpen is sent when a popup window (i.e., Window.getMode is popup) is closed due to user's activity (such as press ESC). This event is only a notification. In other words, the popup is hidden before the event is sent to the server. The application cannot prevent the window from being hidden.
author:
   tomyeh


Inner Class :protected class ExtraCtrl extends XulElement.ExtraCtrl implements MultiBranch,Openable,Floating


Constructor Summary
public  Window()
    
public  Window(String title, String border, boolean closable)
    

Method Summary
public  Objectclone()
    
public  voiddoEmbedded()
     Makes this window as embeded with other components (Default).
public  voiddoHighlighted()
     Makes this window as highlited.
public  voiddoModal()
     Makes this window as a modal dialog.
public  voiddoOverlapped()
     Makes this window as overlapped with other components.
public  voiddoPopup()
     Makes this window as popup, which is overlapped with other component and auto-hiden when user clicks outside of the window.
public  StringgetBorder()
     Returns the border. The border actually controls what the content style class is is used.
public  CaptiongetCaption()
     Returns the caption of this window.
public  StringgetContentSclass()
     Returns the style class used for the content block.
public  StringgetContentStyle()
     Returns the CSS style for the content block of the window.
public  StringgetCtrlKeys()
     Returns what keystrokes to intercept.
public static  StringgetDefaultActionOnShow()
     Returns the animating name of function.
public  StringgetMode()
     Returns the current mode.
public  StringgetOuterAttrs()
    
public  StringgetPosition()
     Returns how to position the window at the client screen. It is meaningless if the embedded mode is used.

Default: null which depends on Window.getMode : If overlapped or popup, Window.setLeft and Window.setTop are assumed.

protected  StringgetRealStyle()
    
public  StringgetSclass()
     Returns the style class.
public  StringgetTitle()
     Returns the title.
public  StringgetTitleSclass()
     Returns the style class used for the title.
public  booleaninEmbedded()
     Returns whether this is embedded with other components (Default).
public  booleaninHighlighted()
     Returns whether this is a highlighted window.
public  booleaninModal()
     Returns whether this is a modal dialog.
public  booleaninOverlapped()
     Returns whether this is a overlapped window.
public  booleaninPopup()
     Returns whether this is a popup window.
public  booleaninsertBefore(Component child, Component insertBefore)
    
public  booleanisClosable()
     Returns whether to show a close button on the title bar.
public  booleanisSizable()
     Returns whether the window is sizable.
protected  ObjectnewExtraCtrl()
    
public  voidonChildRemoved(Component child)
    
public  voidonClose()
     Process the onClose event sent when the close button is pressed.
public  voidonModal()
     Process the onModal event by making itself a modal window.
public  voidsetBorder(String border)
     Sets the border (either none or normal).
Parameters:
  border - the border.
public  voidsetClosable(boolean closable)
     Sets whether to show a close button on the title bar.
public  voidsetContentSclass(String scls)
     Sets the style class used for the content block.
public  voidsetContentStyle(String style)
     Sets the CSS style for the content block of the window.
public  voidsetCtrlKeys(String ctrlKeys)
     Sets what keystrokes to intercept.

The string could be a combination of the following:

^k
A control key, i.e., Ctrl+k, where k could be a~z, 0~9, #n
@k
A alt key, i.e., Alt+k, where k could be a~z, 0~9, #n
$k
A shift key, i.e., Shift+k, where k could be #n
#home
Home
#end
End
#ins
Insert
#del
Delete
#left
Left arrow
#right
Right arrow
#up
Up arrow
#down
Down arrow
#pgup
PageUp
#pgdn
PageDn
#f1 #f2 ...
public static  voidsetDefaultActionOnShow(String onshow)
     Sets the action of window component to show the animating effect by default.

Default: null.

public  voidsetDraggable(String draggable)
    
public  voidsetMode(String name)
     Sets the mode to overlapped, popup, modal, embedded or highlighted.

Notice: Events.ON_MODAL is posted if you specify "modal" to this method and in a thread other than an event listener ( Events.inEventListener ). In other words, if this method is called with modal and not in any event listener, the mode won't be changed immediately (until Events.ON_MODAL is processed later).
Parameters:
  name - the mode which could be one of"embedded", "overlapped", "popup", "modal", "highlighted".Note: it cannot be "modal".

public  voidsetMode(int mode)
     Sets the mode to overlapped, popup, modal, embedded or highlighted.
public  voidsetPage(Page page)
    
public  voidsetParent(Component parent)
    
public  voidsetPosition(String pos)
     Sets how to position the window at the client screen. It is meaningless if the embedded mode is used.
Parameters:
  pos - how to position.
public  voidsetSclass(String sclass)
    
public  voidsetSizable(boolean sizable)
     Sets whether the window is sizable.
public  voidsetTitle(String title)
     Sets the title.
public  booleansetVisible(boolean visible)
     Changes the visibility of the window.

Note: If a modal dialog becomes invisible, the modal state will be ended automatically.



Constructor Detail
Window
public Window()(Code)



Window
public Window(String title, String border, boolean closable)(Code)

Parameters:
  title - the window title (see Window.setTitle).
Parameters:
  border - the border (see Window.setBorder).
Parameters:
  closable - whether it is closable (see Window.setClosable).




Method Detail
clone
public Object clone()(Code)



doEmbedded
public void doEmbedded()(Code)
Makes this window as embeded with other components (Default).



doHighlighted
public void doHighlighted()(Code)
Makes this window as highlited. The visual effect is the similar to the modal window, but, like overlapped, it doesn't suspend (block) the execution at the server. In other words, it is more like an overlapped window from the server side's viewpoint.



doModal
public void doModal() throws InterruptedException, SuspendNotAllowedException(Code)
Makes this window as a modal dialog. It will automatically center the window (ignoring Window.getLeft and Window.getTop ).

Notice: Events.ON_MODAL is posted if you specify "modal" to this method and in a thread other than an event listener ( Events.inEventListener ). In other words, if this method is called with modal and not in any event listener, the mode won't be changed immediately (until Events.ON_MODAL is processed later).
exception:
  SuspendNotAllowedException - if there are too many suspendedprocessing thread than the deployer allows.By default, there is no limit of # of suspended threads.
exception:
  InterruptedException - thrown if the desktop orthe Web application is being destroyed, ororg.zkoss.zk.ui.sys.DesktopCtrl.ceaseSuspendedThread.To tell the difference, check the getMessage method of InterruptedException.




doOverlapped
public void doOverlapped()(Code)
Makes this window as overlapped with other components.



doPopup
public void doPopup()(Code)
Makes this window as popup, which is overlapped with other component and auto-hiden when user clicks outside of the window.



getBorder
public String getBorder()(Code)
Returns the border. The border actually controls what the content style class is is used. In fact, the name of the border (except "normal") is generate as part of the style class used for the content block. Refer to Window.getContentSclass for more details.

Default: "none".




getCaption
public Caption getCaption()(Code)
Returns the caption of this window.



getContentSclass
public String getContentSclass()(Code)
Returns the style class used for the content block.

If Window.setContentSclass was called with a non-empty value, say, "mycnt", then

  1. Case 1: If Window.getBorder is "normal", "mycnt" is returned.
  2. Case 2: Otherwise, "mycnt-border" is returned where border is the value returned by Window.getBorder .

If Window.setContentSclass was not called, or called with null, then the content style class is decided by Window.getSclass as follows:

  1. Case 1: If Window.getBorder is "normal", "wc-sclass" is returned, where sclass is the value returned by Window.getSclass .
  2. Otherwise, "wc-mode-border", where border is the value returned by Window.getBorder .

  3. See Also:   Window.setContentSclass



getContentStyle
public String getContentStyle()(Code)
Returns the CSS style for the content block of the window.



getCtrlKeys
public String getCtrlKeys()(Code)
Returns what keystrokes to intercept.

Default: null.




getDefaultActionOnShow
public static String getDefaultActionOnShow()(Code)
Returns the animating name of function.
since:
   3.0.2



getMode
public String getMode()(Code)
Returns the current mode. One of "modal", "embedded", "overlapped", "popup", and "highlighted".



getOuterAttrs
public String getOuterAttrs()(Code)



getPosition
public String getPosition()(Code)
Returns how to position the window at the client screen. It is meaningless if the embedded mode is used.

Default: null which depends on Window.getMode : If overlapped or popup, Window.setLeft and Window.setTop are assumed. If modal or highlighted, it is centered.




getRealStyle
protected String getRealStyle()(Code)



getSclass
public String getSclass()(Code)
Returns the style class. If the style class is not defined ( Window.setSclass is not called or called with null or empty), it returns Window.getMode . In other words, the style class is, by default, the same as the mode name.



getTitle
public String getTitle()(Code)
Returns the title. Besides this attribute, you could use Caption to define a more sophiscated caption (aka., title).

If a window has a caption whose label ( Caption.getLabel ) is not empty, then this attribute is ignored.

Default: empty.




getTitleSclass
public String getTitleSclass()(Code)
Returns the style class used for the title.

It returns "wt-sclass" is returned, where sclass is the value returned by Window.getSclass .




inEmbedded
public boolean inEmbedded()(Code)
Returns whether this is embedded with other components (Default).
See Also:   Window.doEmbedded



inHighlighted
public boolean inHighlighted()(Code)
Returns whether this is a highlighted window.



inModal
public boolean inModal()(Code)
Returns whether this is a modal dialog.



inOverlapped
public boolean inOverlapped()(Code)
Returns whether this is a overlapped window.



inPopup
public boolean inPopup()(Code)
Returns whether this is a popup window.



insertBefore
public boolean insertBefore(Component child, Component insertBefore)(Code)



isClosable
public boolean isClosable()(Code)
Returns whether to show a close button on the title bar.



isSizable
public boolean isSizable()(Code)
Returns whether the window is sizable.



newExtraCtrl
protected Object newExtraCtrl()(Code)



onChildRemoved
public void onChildRemoved(Component child)(Code)



onClose
public void onClose()(Code)
Process the onClose event sent when the close button is pressed.

Default: detach itself.




onModal
public void onModal() throws InterruptedException(Code)
Process the onModal event by making itself a modal window.



setBorder
public void setBorder(String border)(Code)
Sets the border (either none or normal).
Parameters:
  border - the border. If null or "0", "none" is assumed.Since 2.4.1, We assume "0" to be "none".



setClosable
public void setClosable(boolean closable)(Code)
Sets whether to show a close button on the title bar. If closable, a button is displayed and the onClose event is sent if an user clicks the button.

Default: false.

You can intercept the default behavior by either overriding Window.onClose , or listening the onClose event.

Note: the close button won't be displayed if no title or caption at all.




setContentSclass
public void setContentSclass(String scls)(Code)
Sets the style class used for the content block.
See Also:   Window.getContentSclass
since:
   3.0.0



setContentStyle
public void setContentStyle(String style)(Code)
Sets the CSS style for the content block of the window.

Default: null.




setCtrlKeys
public void setCtrlKeys(String ctrlKeys) throws UiException(Code)
Sets what keystrokes to intercept.

The string could be a combination of the following:

^k
A control key, i.e., Ctrl+k, where k could be a~z, 0~9, #n
@k
A alt key, i.e., Alt+k, where k could be a~z, 0~9, #n
$k
A shift key, i.e., Shift+k, where k could be #n
#home
Home
#end
End
#ins
Insert
#del
Delete
#left
Left arrow
#right
Right arrow
#up
Up arrow
#down
Down arrow
#pgup
PageUp
#pgdn
PageDn
#f1 #f2 ... #f12
Function keys representing F1, F2, ... F12

For example,

^a^d@c#f10#left#right
It means you want to intercept Ctrl+A, Ctrl+D, Alt+C, F10, Left and Right.
^#left
It means Ctrl+Left.
^#f1
It means Ctrl+F1.
@#f3
It means Alt+F3.

Note: it doesn't support Ctrl+Alt, Shift+Ctrl, Shift+Alt or Shift+Ctrl+Alt.




setDefaultActionOnShow
public static void setDefaultActionOnShow(String onshow)(Code)
Sets the action of window component to show the animating effect by default.

Default: null. In other words, if the property is null, it will refer to the configuration of zk.xml to find the preference with "org.zkoss.zul.Window.defaultActionOnShow", if any. For example,

<preference>
 <name>org.zkoss.zul.Window.defaultActionOnShow</name>
 <value>moveDown</value>
 </preference>
Otherwise, the animating effect is depended on component itself.

In JavaScript, the property will match the same function name with the prefix "anima.". For example, if the property is "moveDown", the function name should be "anima.moveDown" accordingly.

Node: The method is available in modal mode only. And if the onshow command of client-side action has been assigned on the component, its priority is higher than this method.
For example,

action="onshow:anima.appear(#{self});"


Parameters:
  onshow - the function name in JavaScript. You could use the followinganimations, e.g. "moveDown", "moveRight", "moveDiagonal", "appear", "slideDown", and so forth.
since:
   3.0.2



setDraggable
public void setDraggable(String draggable)(Code)



setMode
public void setMode(String name) throws InterruptedException(Code)
Sets the mode to overlapped, popup, modal, embedded or highlighted.

Notice: Events.ON_MODAL is posted if you specify "modal" to this method and in a thread other than an event listener ( Events.inEventListener ). In other words, if this method is called with modal and not in any event listener, the mode won't be changed immediately (until Events.ON_MODAL is processed later).
Parameters:
  name - the mode which could be one of"embedded", "overlapped", "popup", "modal", "highlighted".Note: it cannot be "modal". Use Window.doModal instead.
exception:
  InterruptedException - thrown if "modal" is specified,and one of the following conditions occurs:1) the desktop or the Web application is being destroyed, or2) org.zkoss.zk.ui.sys.DesktopCtrl.ceaseSuspendedThread.To tell the difference, check the getMessage method of InterruptedException.




setMode
public void setMode(int mode) throws InterruptedException(Code)
Sets the mode to overlapped, popup, modal, embedded or highlighted.
See Also:   Window.setMode(String)



setPage
public void setPage(Page page)(Code)



setParent
public void setParent(Component parent)(Code)



setPosition
public void setPosition(String pos)(Code)
Sets how to position the window at the client screen. It is meaningless if the embedded mode is used.
Parameters:
  pos - how to position. It can be null (the default), ora combination of the following values (by separating with comma).
center
Position the window at the center. Window.setTop and Window.setLeftare both ignored.
left
Position the window at the left edge. Window.setLeft is ignored.
right
Position the window at the right edge. Window.setLeft is ignored.
top
Position the window at the top edge. Window.setTop is ignored.
bottom
Position the window at the bottom edge. Window.setTop is ignored.
parent
Position the window relative to its parent.That is, the left and top (Window.getTop and Window.getLeft)is an offset to his parent's let-top corner. (since 3.0.2)

For example, "left,center" means to position it at the center ofthe left edge.




setSclass
public void setSclass(String sclass)(Code)



setSizable
public void setSizable(boolean sizable)(Code)
Sets whether the window is sizable. If true, an user can drag the border to change the window width.

Default: false.




setTitle
public void setTitle(String title)(Code)
Sets the title.



setVisible
public boolean setVisible(boolean visible)(Code)
Changes the visibility of the window.

Note: If a modal dialog becomes invisible, the modal state will be ended automatically. In other words, the mode ( Window.getMode ) will become Window.OVERLAPPED and the suspending thread is resumed.




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.