public class PageContext extends Object
PageManager
.
Keeps information about the page properties and state.
Allows the user to interact with a page in an abstract way.
Keeps a list of listeners that should be notified of changes in the page state.Modifier and Type | Method and Description |
---|---|
void |
addPageListener(PageListener listener)
Adds a page listener to receive notifications of user initiated changes.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener that should be notified of changes in properties modified with
putProperty . |
void |
close()
Closes this page.
|
Icon |
getIcon()
Returns the icon associated with the page.
|
Component |
getPage()
Returns the component associated with this page.
|
PageManager |
getPageManager() |
Object |
getProperty(Object key)
Returns the value of the property with the key obtained by calling
toString() method on the argument. |
String |
getTitle()
Returns the name associated with the page.
|
Object |
putProperty(Object key,
Object value)
Adds a key/value property to this page.
|
void |
removePageListener(PageListener listener)
Remove a previously installed PageListener
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.
|
void |
requestShow()
Requests that the associated page be shown.
|
void |
setIcon(Icon icon)
Sets the icon associated with this page.
|
void |
setTitle(String title)
Sets the title of this page.
|
void |
setType(String type)
Sets the type of this page.
|
String |
toString() |
String |
type()
Returns the type of this page.
|
public PageManager getPageManager()
public void addPageListener(PageListener listener)
listener
- The PageListener to installpublic void removePageListener(PageListener listener)
listener
- The PageListener to removepublic void requestShow()
public void close()
public Component getPage()
public String getTitle()
public Icon getIcon()
public void setTitle(String title)
public void setIcon(Icon icon)
public String type()
public void setType(String type)
public Object getProperty(Object key)
toString()
method on the argument.
Only properties added with putProperty
will return a non-null value.key
- The property key.null
.public Object putProperty(Object key, Object value)
get/putProperty
methods provide access to a small per-instance hash map.
Objects specified as keys are converted to strings by calling their toString()
methods before being used as keys to the map.If value is null
this method will
remove the property. Changes to client properties are reported with PropertyChange events.key
- The property key.value
- The property value.public void addPropertyChangeListener(PropertyChangeListener listener)
putProperty
.listener
- The listener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener to be removed.Copyright © 2000–2017 FreeHEP. All rights reserved.