VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class FocusModel<VR> extends java.lang.Object implements IPropertyChangeNotifier
FocusModel stores the IContentPart which has keyboard
focus. Note that you are responsible for synchronizing keyboard focus with
the model.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FOCUS_PROPERTY
The
FocusModel fires PropertyChangeEvents when the
focused part changes. |
static java.lang.String |
VIEWER_FOCUS_PROPERTY
The
FocusModel fires PropertyChangeEvents when the viewer
focused state changes. |
| Constructor and Description |
|---|
FocusModel()
Constructs a new
FocusModel. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
IContentPart<VR,? extends VR> |
getFocused()
Returns the
IContentPart which has keyboard focus, or
null if no IContentPart currently has keyboard
focus. |
boolean |
isViewerFocused()
Returns
true if the viewer where this model is registered
currently has keyboard focus. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
setFocused(IContentPart<VR,? extends VR> focusPart)
Selects the given IContentPart as the focus part.
|
void |
setViewerFocused(boolean viewerFocused)
Updates the
isViewerFocused() property of this model. |
public static final java.lang.String FOCUS_PROPERTY
FocusModel fires PropertyChangeEvents when the
focused part changes. This is the name of the property that is delivered
with the event.setFocused(IContentPart),
Constant Field Valuespublic static final java.lang.String VIEWER_FOCUS_PROPERTY
FocusModel fires PropertyChangeEvents when the viewer
focused state changes. This is the name of the property that is delivered
with the event.setViewerFocused(boolean),
Constant Field Valuespublic FocusModel()
FocusModel. The focused
IContentPart is set to null and the
isViewerFocused() flag is set to false.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IPropertyChangeNotifierpublic IContentPart<VR,? extends VR> getFocused()
IContentPart which has keyboard focus, or
null if no IContentPart currently has keyboard
focus.nullpublic boolean isViewerFocused()
true if the viewer where this model is registered
currently has keyboard focus. Otherwise returns false.true if the viewer where this model is registered
currently has keyboard focus. Otherwise returns
false.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface IPropertyChangeNotifierpublic void setFocused(IContentPart<VR,? extends VR> focusPart)
focusPart - The IContentPart which should become the new focus
part.public void setViewerFocused(boolean viewerFocused)
isViewerFocused() property of this model.viewerFocused - true to indicate that the viewer has keyboard
focus, or false to indicate that the viewer does
not have keyboard focus.Copyright (c) 2014 itemis AG and others. All rights reserved.