com.vaadin.terminal.
Interface Paintable
All Superinterfaces:
All Known Subinterfaces:
Component, Component.Focusable, ComponentContainer, DragSource, DropTarget, ErrorMessage, Field, Layout
All Known Implementing Classes:
AbsoluteLayout, AbstractComponent, AbstractComponentContainer, AbstractField, AbstractLayout, AbstractMedia, AbstractOrderedLayout, AbstractSelect, AbstractSplitPanel, AbstractTextField, Accordion, Audio, Buffered.SourceException, Button, CheckBox, ComboBox, CompositeErrorMessage, CssLayout, CustomComponent, CustomLayout, DateField, DateField.UnparsableDateString, DragAndDropWrapper, Embedded, ExpandLayout, Form, FormLayout, GridLayout, HorizontalLayout, HorizontalSplitPanel, InlineDateField, Label, Link, ListSelect, LoginForm, MenuBar, NativeButton, NativeSelect, OptionGroup, OrderedLayout, Panel, PasswordField, PopupDateField, PopupView, ProgressIndicator, RichTextArea, Select, Slider, SplitPanel, SystemError, Table, TabSheet, TextArea, TextField, Tree, TreeTable, TwinColSelect, Upload, UriFragmentUtility, UserError, Validator.EmptyValueException, Validator.InvalidValueException, VerticalLayout, VerticalSplitPanel, Video, Window
- extends EventListener, Serializable
public interface Paintable
Interface implemented by all classes that can be painted. Classes implementing this interface know how to output themselves to a UIDL stream and that way describing to the terminal how it should be displayed in the UI.
Since:
3.0
Version:
6.8.18
Author:
Vaadin Ltd.
Nested Class Summary | |
---|---|
static class |
Paintable.RepaintRequestEvent
Repaint request event is thrown when the paintable needs to be repainted. |
static interface |
Paintable.RepaintRequestListener
Listens repaint requests. |
Method Summary | |
---|---|
void |
addListener(Paintable.RepaintRequestListener listener)
Adds repaint request listener. |
String |
getDebugId()
Get's currently set debug identifier |
void |
paint(PaintTarget target)
Paints the Paintable into a UIDL stream. |
void |
removeListener(Paintable.RepaintRequestListener listener)
Removes repaint request listener. |
void |
requestRepaint()
Requests that the paintable should be repainted as soon as possible. |
void |
requestRepaintRequests()
Request sending of repaint events on any further visible changes. |
void |
setDebugId(String id)
Adds an unique id for component that get's transferred to terminal for testing purposes. |
Method Detail |
---|
paint
void paint(PaintTarget target)
throws PaintException
- Parameters:
target
- the target UIDL stream where the component should paint itself to.- Throws:
PaintException
- if the paint operation failed.
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.
requestRepaint
void requestRepaint()
Requests that the paintable should be repainted as soon as possible.
setDebugId
void setDebugId(String id)
- Parameters:
id
- A short (< 20 chars) alphanumeric id
Adds an unique id for component that get's transferred to terminal for testing purposes. Keeping identifiers unique throughout the Application instance is on programmers responsibility.
Note, that with the current terminal implementation the identifier cannot be changed while the component is visible. This means that the identifier should be set before the component is painted for the first time and kept the same while visible in the client.
getDebugId
String getDebugId()
- Returns:
- current debug id, null if not set
Get's currently set debug identifier
addListener
void addListener(Paintable.RepaintRequestListener listener)
- Parameters:
listener
- the listener to be added.
Adds repaint request listener. In order to assure that no repaint requests are missed, the new repaint listener should paint the paintable right after adding itself as listener.
removeListener
void removeListener(Paintable.RepaintRequestListener listener)
- Parameters:
listener
- the listener to be removed.
Removes repaint request listener.
requestRepaintRequests
void requestRepaintRequests()
Request sending of repaint events on any further visible changes. Normally the paintable only send up to one repaint request for listeners after paint as the paintable as the paintable assumes that the listeners already know about the repaint need. This method resets the assumtion. Paint implicitly does the assumtion reset functionality implemented by this method.
This method is normally used only by the terminals to note paintables about implicit repaints (painting the component without actually invoking paint method).