|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.Panel
public class Panel
Panel - a simple single component container.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.server.VariableOwner |
---|
VariableOwner.ErrorEvent |
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.server.Sizeable |
---|
Sizeable.Unit |
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer |
---|
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener |
Field Summary | |
---|---|
protected ActionManager |
actionManager
Keeps track of the Actions added to this component, and manages the painting and handling as well. |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
Panel()
Creates a new empty panel. |
|
Panel(ComponentContainer content)
Creates a new empty panel which contains the given content. |
|
Panel(java.lang.String caption)
Creates a new empty panel with caption. |
|
Panel(java.lang.String caption,
ComponentContainer content)
Creates a new empty panel with the given caption and content. |
Method Summary | ||
---|---|---|
|
addAction(T action)
|
|
void |
addActionHandler(Action.Handler actionHandler)
Registers a new action handler for this container |
|
void |
addClickListener(MouseEvents.ClickListener listener)
Add a click listener to the Panel. |
|
void |
addComponent(Component c)
Adds the component into this container. |
|
void |
addListener(MouseEvents.ClickListener listener)
Deprecated. Since 7.0, replaced by #addClickListener(ClickListener) |
|
void |
changeVariables(java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> variables)
Called when one or more variables handled by the implementing class are changed. |
|
void |
componentAttachedToContainer(ComponentContainer.ComponentAttachEvent event)
A new component is attached to container. |
|
void |
componentDetachedFromContainer(ComponentContainer.ComponentDetachEvent event)
A component has been detached from container. |
|
void |
focus()
Moves keyboard focus to the component. |
|
protected ActionManager |
getActionManager()
Gets the ActionManager used to manage the
ShortcutListener s added to this Field . |
|
int |
getComponentCount()
Gets the number of children this ComponentContainer has. |
|
java.util.Iterator<Component> |
getComponentIterator()
Gets the component container iterator for going through all the components in the container. |
|
ComponentContainer |
getContent()
Returns the content of the Panel. |
|
int |
getScrollLeft()
Gets scroll left offset. |
|
int |
getScrollTop()
Gets scroll top offset. |
|
protected com.vaadin.shared.ui.panel.PanelState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
|
int |
getTabIndex()
Gets the tabulator index of the Focusable component. |
|
void |
paintContent(PaintTarget target)
Paints the Paintable into a UIDL stream. |
|
|
removeAction(T action)
|
|
void |
removeActionHandler(Action.Handler actionHandler)
Removes a previously registered action handler for the contents of this container. |
|
void |
removeAllActionHandlers()
Removes all action handlers |
|
void |
removeAllComponents()
Removes all components from this container. |
|
void |
removeClickListener(MouseEvents.ClickListener listener)
Remove a click listener from the Panel. |
|
void |
removeComponent(Component c)
Removes the component from this container. |
|
void |
removeListener(MouseEvents.ClickListener listener)
Deprecated. Since 7.0, replaced by #removeClickListener(ClickListener) |
|
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replaces the component in the container with another one without changing position. |
|
void |
setCaption(java.lang.String caption)
Sets the caption of the panel. |
|
void |
setContent(ComponentContainer newContent)
Set the content of the Panel. |
|
void |
setScrollLeft(int scrollLeft)
Sets scroll left offset. |
|
void |
setScrollTop(int scrollTop)
Sets scroll top offset. |
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the Focusable component. |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addExtension, addMethodInvocationToQueue, createState, encodeState, getAllChildrenIterable, getConnectorId, getExtensions, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.server.LegacyComponent |
---|
markAsDirty |
Methods inherited from interface com.vaadin.server.VariableOwner |
---|
isEnabled, isImmediate |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setEnabled, setIcon, setId, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
beforeClientResponse, detach, encodeState, getExtensions, getStateType, handleConnectorRequest, isConnectorEnabled, markAsDirtyRecursive, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setParent |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.RpcTarget |
---|
getRpcManager |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth |
Field Detail |
---|
protected ActionManager actionManager
Constructor Detail |
---|
public Panel()
public Panel(ComponentContainer content)
content
- the content for the panel.public Panel(java.lang.String caption)
caption
- the caption used in the panel (HTML).public Panel(java.lang.String caption, ComponentContainer content)
caption
- the caption of the panel (HTML).content
- the content used in the panel.Method Detail |
---|
public void setCaption(java.lang.String caption)
setCaption
in interface Component
setCaption
in class AbstractComponent
caption
- the new caption String
for the component.AbstractComponent.setCaption(String)
public ComponentContainer getContent()
public void setContent(ComponentContainer newContent)
content
- The new contentpublic void paintContent(PaintTarget target) throws PaintException
LegacyComponent
Paints the Paintable into a UIDL stream. This method creates the UIDL sequence describing it and outputs it to the given UIDL stream.
It is called when the contents of the component should be painted in response to the component first being shown or having been altered so that its visual representation is changed.
paintContent
in interface LegacyComponent
target
- the target UIDL stream where the component should paint itself
to.
PaintException
- if the paint operation failed.public void addComponent(Component c)
addComponent
in interface ComponentContainer
addComponent
in class AbstractComponentContainer
c
- the component to be added.AbstractComponentContainer.addComponent(com.vaadin.ui.Component)
public void removeComponent(Component c)
removeComponent
in interface ComponentContainer
removeComponent
in class AbstractComponentContainer
c
- The component to be removed.AbstractComponentContainer.removeComponent(com.vaadin.ui.Component)
public java.util.Iterator<Component> getComponentIterator()
getComponentIterator
in interface HasComponents
HasComponents.getComponentIterator()
public void changeVariables(java.lang.Object source, java.util.Map<java.lang.String,java.lang.Object> variables)
changeVariables
in interface VariableOwner
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.VariableOwner.changeVariables(Object, Map)
public int getScrollLeft()
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled right.
getScrollLeft
in interface Scrollable
public int getScrollTop()
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled down.
getScrollTop
in interface Scrollable
public void setScrollLeft(int scrollLeft)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled right.
setScrollLeft
in interface Scrollable
scrollLeft
- the xOffset.public void setScrollTop(int scrollTop)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled down.
The scrolling position is limited by the current height of the content area. If the position is below the height, it is scrolled to the bottom. However, if the same response also adds height to the content area, scrolling to bottom only scrolls to the bottom of the previous content area.
setScrollTop
in interface Scrollable
scrollTop
- the yOffset.public void replaceComponent(Component oldComponent, Component newComponent)
ComponentContainer
This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.
replaceComponent
in interface ComponentContainer
oldComponent
- the old component that will be replaced.newComponent
- the new component to be replaced.public void componentAttachedToContainer(ComponentContainer.ComponentAttachEvent event)
componentAttachedToContainer
in interface ComponentContainer.ComponentAttachListener
event
- the component attach event.ComponentContainer.ComponentAttachListener.componentAttachedToContainer(com.vaadin.ui.ComponentContainer.ComponentAttachEvent)
public void componentDetachedFromContainer(ComponentContainer.ComponentDetachEvent event)
componentDetachedFromContainer
in interface ComponentContainer.ComponentDetachListener
event
- the component detach event.ComponentContainer.ComponentDetachListener.componentDetachedFromContainer(com.vaadin.ui.ComponentContainer.ComponentDetachEvent)
public void removeAllComponents()
removeAllComponents
in interface ComponentContainer
removeAllComponents
in class AbstractComponentContainer
ComponentContainer.removeAllComponents()
protected ActionManager getActionManager()
AbstractComponent
ActionManager
used to manage the
ShortcutListener
s added to this Field
.
getActionManager
in class AbstractComponent
public <T extends Action & Action.Listener> void addAction(T action)
addAction
in interface Action.Notifier
public <T extends Action & Action.Listener> void removeAction(T action)
removeAction
in interface Action.Notifier
public void addActionHandler(Action.Handler actionHandler)
Action.Container
addActionHandler
in interface Action.Container
actionHandler
- the new handler to be added.public void removeActionHandler(Action.Handler actionHandler)
Action.Container
removeActionHandler
in interface Action.Container
actionHandler
- the handler to be removed.public void removeAllActionHandlers()
public void addClickListener(MouseEvents.ClickListener listener)
#removeListener(ClickListener)
to remove the listener.
listener
- The listener to add@Deprecated public void addListener(MouseEvents.ClickListener listener)
#addClickListener(ClickListener)
public void removeClickListener(MouseEvents.ClickListener listener)
#addListener(ClickListener)
.
listener
- The listener to remove@Deprecated public void removeListener(MouseEvents.ClickListener listener)
#removeClickListener(ClickListener)
public int getTabIndex()
Focusable
component.
getTabIndex
in interface Component.Focusable
Focusable
componentComponent.Focusable.setTabIndex(int)
public void setTabIndex(int tabIndex)
Focusable
component.
The tab index property is used to specify the order in which the
fields are focused when the user presses the Tab key. Components with
a defined tab index are focused sequentially first, and then the
components with no tab index.
Form loginBox = new Form(); loginBox.setCaption("Login"); layout.addComponent(loginBox); // Create the first field which will be focused TextField username = new TextField("User name"); loginBox.addField("username", username); // Set focus to the user name username.focus(); TextField password = new TextField("Password"); loginBox.addField("password", password); Button login = new Button("Login"); loginBox.getFooter().addComponent(login); // An additional component which natural focus order would // be after the button. CheckBox remember = new CheckBox("Remember me"); loginBox.getFooter().addComponent(remember); username.setTabIndex(1); password.setTabIndex(2); remember.setTabIndex(3); // Different than natural place login.setTabIndex(4);
After all focusable user interface components are done, the browser can begin again from the component with the smallest tab index, or it can take the focus out of the page, for example, to the location bar.
If the tab index is not set (is set to zero), the default tab order is used. The order is somewhat browser-dependent, but generally follows the HTML structure of the page.
A negative value means that the component is completely removed from the tabulation order and can not be reached by pressing the Tab key at all.
setTabIndex
in interface Component.Focusable
tabIndex
- the tab order of this component. Indexes usually start
from 1. Zero means that default tab order should be used.
A negative value means that the field should not be
included in the tabbing sequence.Component.Focusable.getTabIndex()
public void focus()
Component.Focusable.focus()
focus
in interface Component.Focusable
focus
in class AbstractComponent
FieldEvents
,
FieldEvents.FocusEvent
,
FieldEvents.FocusListener
,
FieldEvents.BlurEvent
,
FieldEvents.BlurListener
public int getComponentCount()
ComponentContainer
ComponentContainer
has. This
must be symmetric with what HasComponents.getComponentIterator()
returns.
getComponentCount
in interface ComponentContainer
protected com.vaadin.shared.ui.panel.PanelState getState()
AbstractComponent
getState
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |