|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractComponentContainer
com.itmill.toolkit.ui.Panel
public class Panel
Panel - a simple single component container.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractComponent |
---|
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.ComponentContainer |
---|
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component |
---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary | |
---|---|
static String |
STYLE_LIGHT
|
Fields inherited from interface com.itmill.toolkit.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 | |
---|---|
Panel()
Creates a new empty panel. |
|
Panel(Layout layout)
Creates a new empty panel with given layout. |
|
Panel(String caption)
Creates a new empty panel with caption. |
|
Panel(String caption,
Layout layout)
Creates a new empty panel with caption. |
Method Summary | |
---|---|
void |
addActionHandler(Action.Handler actionHandler)
Registers a new action handler for this container |
void |
addComponent(Component c)
Adds the component into this container. |
void |
attach()
Notifies the component that it is connected to an application. |
void |
changeVariables(Object source,
Map 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 |
detach()
Notifies the component that it is detached from the application. |
Iterator |
getComponentIterator()
Gets the component container iterator for going trough all the components in the container. |
Layout |
getLayout()
Gets the current layout of the panel. |
int |
getScrollLeft()
Gets scroll left offset. |
int |
getScrollOffsetX()
Deprecated. use getScrollLeft() instead |
int |
getScrollOffsetY()
Deprecated. use getScrollTop() instead |
int |
getScrollTop()
Gets scroll top offset. |
String |
getTag()
Gets the component UIDL tag. |
boolean |
isScrollable()
Is the scrolling enabled. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
void |
removeActionHandler(Action.Handler actionHandler)
Removes an action handler. |
void |
removeAllComponents()
Removes all components from this container. |
void |
removeComponent(Component c)
Removes the component from this container. |
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replaces the component in the container with another one without changing position. |
void |
requestRepaintAll()
Causes a repaint of this component, and all components below it. |
void |
setLayout(Layout newLayout)
Sets the layout of the panel. |
void |
setScrollable(boolean isScrollingEnabled)
Enables or disables scrolling.. |
void |
setScrollLeft(int pixelsScrolled)
Sets scroll left offset. |
void |
setScrollOffsetX(int pixels)
Deprecated. use setScrollLeft() method instead |
void |
setScrollOffsetY(int pixels)
Deprecated. use setScrollTop() method instead |
void |
setScrollTop(int pixelsScrolledDown)
Sets scroll top offset. |
Methods inherited from class com.itmill.toolkit.ui.AbstractComponentContainer |
---|
addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeListener, removeListener, setEnabled, setHeight, setWidth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.itmill.toolkit.ui.Component |
---|
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId |
Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
---|
isImmediate |
Methods inherited from interface com.itmill.toolkit.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits |
Field Detail |
---|
public static final String STYLE_LIGHT
Constructor Detail |
---|
public Panel()
public Panel(Layout layout)
layout
- the layout used in the panel.public Panel(String caption)
caption
- the caption used in the panel.public Panel(String caption, Layout layout)
caption
- the caption of the panel.layout
- the layout used in the panel.Method Detail |
---|
public Layout getLayout()
public void setLayout(Layout newLayout)
newLayout
- the New layout of the panel.public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractComponent
target
- the Paint Event.
PaintException
- if the paint operation failed.public void requestRepaintAll()
ComponentContainer
requestRepaintAll
in interface ComponentContainer
requestRepaintAll
in class AbstractComponentContainer
public String getTag()
getTag
in class AbstractComponent
public void addComponent(Component c)
addComponent
in interface ComponentContainer
addComponent
in class AbstractComponentContainer
c
- the component to be added.AbstractComponentContainer.addComponent(com.itmill.toolkit.ui.Component)
public void removeComponent(Component c)
removeComponent
in interface ComponentContainer
removeComponent
in class AbstractComponentContainer
c
- The component to be added.AbstractComponentContainer.removeComponent(com.itmill.toolkit.ui.Component)
public Iterator getComponentIterator()
getComponentIterator
in interface ComponentContainer
ComponentContainer.getComponentIterator()
public void changeVariables(Object source, Map variables)
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.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
@Deprecated public int getScrollOffsetX()
public int getScrollTop()
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled down.
getScrollTop
in interface Scrollable
@Deprecated public int getScrollOffsetY()
public boolean isScrollable()
Scrollable
Enabling scrolling allows the user to scroll the scrollable view interactively
isScrollable
in interface Scrollable
true
if the scrolling is allowed, otherwise
false
.public void setScrollable(boolean isScrollingEnabled)
Scrollable
Enabling scrolling allows the user to scroll the scrollable view interactively
setScrollable
in interface Scrollable
isScrollingEnabled
- true if the scrolling is allowed.public void setScrollLeft(int pixelsScrolled)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled right.
setScrollLeft
in interface Scrollable
pixelsScrolled
- the xOffset.@Deprecated public void setScrollOffsetX(int pixels)
public void setScrollTop(int pixelsScrolledDown)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled down.
setScrollTop
in interface Scrollable
pixelsScrolledDown
- the yOffset.@Deprecated public void setScrollOffsetY(int pixels)
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.itmill.toolkit.ui.ComponentContainer.ComponentAttachEvent)
public void componentDetachedFromContainer(ComponentContainer.ComponentDetachEvent event)
componentDetachedFromContainer
in interface ComponentContainer.ComponentDetachListener
event
- the component detach event.ComponentContainer.ComponentDetachListener.componentDetachedFromContainer(com.itmill.toolkit.ui.ComponentContainer.ComponentDetachEvent)
public void attach()
attach
in interface Component
attach
in class AbstractComponentContainer
Component.attach()
public void detach()
detach
in interface Component
detach
in class AbstractComponentContainer
Component.detach()
public void removeAllComponents()
removeAllComponents
in interface ComponentContainer
removeAllComponents
in class AbstractComponentContainer
ComponentContainer.removeAllComponents()
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)
removeActionHandler
in interface Action.Container
actionHandler
- the handler to be removed.Action.Container.removeActionHandler(Action.Handler)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |