|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.UriFragmentUtility
public class UriFragmentUtility
Experimental web browser dependent component for URI fragment (part after hash mark "#") reading and writing. Component can be used to workaround common ajax web applications pitfalls: bookmarking a program state and back button.
Nested Class Summary | |
---|---|
class |
UriFragmentUtility.FragmentChangedEvent
Event fired when uri fragment changes. |
static interface |
UriFragmentUtility.FragmentChangedListener
Listener that listens changes in URI fragment. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
---|
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
UriFragmentUtility()
|
Method Summary | |
---|---|
void |
addListener(UriFragmentUtility.FragmentChangedListener listener)
|
void |
changeVariables(Object source,
Map<String,Object> variables)
Called when one or more variables handled by the implementing class are changed. |
String |
getFragment()
Gets currently set URI fragment. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
removeListener(UriFragmentUtility.FragmentChangedListener listener)
|
void |
setFragment(String newFragment)
Sets URI fragment. |
void |
setFragment(String newFragment,
boolean fireEvent)
Sets URI fragment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UriFragmentUtility()
Method Detail |
---|
public void addListener(UriFragmentUtility.FragmentChangedListener listener)
public void removeListener(UriFragmentUtility.FragmentChangedListener listener)
public void paintContent(PaintTarget target) throws PaintException
AbstractComponent
AbstractComponent.paint(PaintTarget)
method handles all general
attributes common to all components, and it calls this method to paint
any component-specific attributes to the UIDL stream.
paintContent
in class AbstractComponent
target
- the target UIDL stream where the component should paint itself
to
PaintException
- if the paint operation failed.public void changeVariables(Object source, Map<String,Object> variables)
VariableOwner
changeVariables
in interface VariableOwner
changeVariables
in class AbstractComponent
source
- the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.public String getFragment()
To listen changes in fragment, hook a UriFragmentUtility.FragmentChangedListener
.
Note that initial URI fragment that user used to enter the application will be read after application init. It fires FragmentChangedEvent only if it is not the same as on server side.
public void setFragment(String newFragment, boolean fireEvent)
UriFragmentUtility.FragmentChangedEvent
newFragment
- id of the new fragmentfireEvent
- true to fire eventUriFragmentUtility.FragmentChangedEvent
,
UriFragmentUtility.FragmentChangedListener
public void setFragment(String newFragment)
UriFragmentUtility.FragmentChangedEvent
newFragment
- id of the new fragmentUriFragmentUtility.FragmentChangedEvent
,
UriFragmentUtility.FragmentChangedListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |