org.zkoss.zk.ui.ext
Interface Scope
- All Known Subinterfaces:
- Component, Desktop, Execution, IdSpace, Macro, Page, Session, WebApp
- All Known Implementing Classes:
- A, A, Abbr, Absolutechildren, Absolutelayout, AbstractComponent, AbstractExecution, AbstractPage, AbstractTag, AbstractWebApp, Acronym, Address, Anchorchildren, Anchorlayout, Applet, Area, Area, Audio, Auxhead, Auxheader, B, Bandbox, Bandpopup, Base, Big, Biglistbox, Blockquote, Body, Borderlayout, Box, Br, Button, Button, Calendar, Captcha, Caption, Caption, Cardlayout, Cell, Center, Center, Chart, Checkbox, Chosenbox, Cite, Code, Col, Colgroup, Colorbox, Column, Columnchildren, Columnlayout, Columns, Combobox, Combobutton, Comboitem, ContentTag, Datebox, Dd, Decimalbox, Del, DesktopImpl, Detail, Dfn, Dir, Div, Div, Dl, Doublebox, Doublespinner, Dropupload, Dt, East, Em, Embed, ExecutionImpl, Fieldset, Fileupload, Fileupload, FileuploadDlg, Fisheye, Fisheyebar, Flash, Font, Foot, Footer, FooterElement, Form, FormatInputElement, Frozen, Fusionchart, Grid, Group, Groupbox, Groupfoot, H1, H2, H3, H4, Hbox, Head, HeaderElement, HeadersElement, Hlayout, Hr, Html, Html, HtmlBasedComponent, HtmlMacroComponent, HtmlNativeComponent, I, Idspace, Iframe, Iframe, Image, Imagemap, Img, Include, Input, InputElement, Ins, Intbox, Isindex, Jasperreport, Kbd, Label, Label, LabelElement, LabelImageElement, Layout, LayoutRegion, Legend, Li, Link, Listbox, Listcell, Listfoot, Listfooter, Listgroup, Listgroupfoot, Listhead, Listheader, Listitem, Longbox, Map, Menu, Menu, Menubar, Menuitem, Menupopup, Menuseparator, MeshElement, MessageboxDlg, MessageboxDlg.Button, Meta, Nobr, North, NumberInputElement, Object, Ol, Optgroup, Option, P, PageImpl, Paging, Panel, Panelchildren, Popup, Portalchildren, Portallayout, Pre, Progressmeter, Q, Radio, Radiogroup, Raw, Row, Rows, S, Samp, Script, Script, Scrollview, Select, Selectbox, Separator, SerializableSession, SimpleScope, SimpleSession, SimpleWebApp, Slider, Small, South, Space, Span, Span, Spinner, Splitter, Strong, StubComponent, StubsComponent, Style, Style, Sub, Sup, SynchronizedScope, Tab, Tabbox, Table, Tablechildren, Tablelayout, Tabpanel, Tabpanels, Tabs, Tbody, Td, Text, Textarea, Textbox, Tfoot, Th, Thead, Timebox, Timer, Title, Toolbar, Toolbarbutton, Tr, Transformer, Tree, Treecell, Treechildren, Treecol, Treecols, Treefoot, Treefooter, Treeitem, Treerow, Tt, Ul, Var, Vbox, Vlayout, VolatilePage, West, Window, XmlMacroComponent, XmlNativeComponent, XulElement, Zkhead
public interface Scope
Represents a scope of attributes.
- Since:
- 3.6.0
- Author:
- tomyeh
- See Also:
SimpleScope
Method Summary |
boolean |
addScopeListener(ScopeListener listener)
Adds a listener to listen whether this scope is changed. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the custom attribute associated with this object (scope). |
java.lang.Object |
getAttribute(java.lang.String name,
boolean recurse)
Returns the custom attribute associated with this object. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns all custom attributes associated with this object (scope). |
boolean |
hasAttribute(java.lang.String name)
Returns if a custom attribute is associated with this object (scope). |
boolean |
hasAttribute(java.lang.String name,
boolean recurse)
Returns if a custom attribute is associated with this object. |
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the attribute from the current scope if any. |
java.lang.Object |
removeAttribute(java.lang.String name,
boolean recurse)
Removes the custom attribute associated with this scope. |
boolean |
removeScopeListener(ScopeListener listener)
Removes a change listener from this scope. |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets (a.k.a., associates) the value for a custom attribute with this object (scope). |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value,
boolean recurse)
Sets the custom attribute associated with this scope, or the parent
scope. |
getAttributes
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
- Returns all custom attributes associated with this object (scope).
getAttribute
java.lang.Object getAttribute(java.lang.String name)
- Returns the custom attribute associated with this object (scope).
hasAttribute
boolean hasAttribute(java.lang.String name)
- Returns if a custom attribute is associated with this object (scope).
Notice that null
is a valid value, so you can
tell if an attribute is associated by examining the return value
of getAttribute(java.lang.String)
.
- Since:
- 5.0.0
setAttribute
java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value)
- Sets (a.k.a., associates) the value for a custom attribute with this object (scope).
- Returns:
- the previous value associated with the attribute, if any
- Since:
- 5.0.0
removeAttribute
java.lang.Object removeAttribute(java.lang.String name)
- Removes the attribute from the current scope if any.
- Returns:
- the previous value associated with the attribute, if any,
- Since:
- 5.0.0
getAttribute
java.lang.Object getAttribute(java.lang.String name,
boolean recurse)
- Returns the custom attribute associated with this object.
- Parameters:
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.- Since:
- 5.0.0
hasAttribute
boolean hasAttribute(java.lang.String name,
boolean recurse)
- Returns if a custom attribute is associated with this object.
Notice that null
is a valid value, so you can
tell if an attribute is associated by examining the return value
of getAttribute(java.lang.String)
.
- Parameters:
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.- Since:
- 5.0.0
setAttribute
java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value,
boolean recurse)
- Sets the custom attribute associated with this scope, or the parent
scope.
- Parameters:
recurse
- whether to look up the parent scope for the
existence of the attribute.
If recurse is true and the attribute is defined in
one of its ancestor (including page), the attribute is replaced.
Otherwise, it is the same as setAttribute(String,Object)
.- Since:
- 5.0.0
removeAttribute
java.lang.Object removeAttribute(java.lang.String name,
boolean recurse)
- Removes the custom attribute associated with this scope.
- Parameters:
recurse
- whether to look up the parent scope for the
existence of the attribute.
If recurse is true and the attribute is defined in
one of its ancestor (including page), the attribute is removed.
Otherwise, it is the same as removeAttribute(String)
.- Since:
- 5.0.0
addScopeListener
boolean addScopeListener(ScopeListener listener)
- Adds a listener to listen whether this scope is changed.
The listener is called when a custom attribute is added, removed, or
the parent is changed.
- Returns:
- weather the listener is added successfully.
Note: if the resolver was added before, it won't be added again
and this method returns false.
- Since:
- 5.0.0
removeScopeListener
boolean removeScopeListener(ScopeListener listener)
- Removes a change listener from this scope.
- Returns:
- false if listener is not added before.
- Since:
- 5.0.0
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.