|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.Identifiable
com.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractComponentContainer
com.itmill.toolkit.ui.Panel
com.itmill.toolkit.ui.Window
public class Window
Application window component.
| Nested Class Summary | |
|---|---|
class |
Window.CloseEvent
|
static interface |
Window.CloseListener
|
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.URIHandler |
|---|
URIHandler.ErrorEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.ParameterHandler |
|---|
ParameterHandler.ErrorEvent |
| 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 int |
BORDER_DEFAULT
Window with default borders. |
static int |
BORDER_MINIMAL
Window with only minimal border. |
static int |
BORDER_NONE
Window with no border. |
| Fields inherited from interface com.itmill.toolkit.terminal.Sizeable |
|---|
UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNITS_ROWS |
| Constructor Summary | |
|---|---|
Window()
Creates a new empty unnamed window with default layout. |
|
Window(String caption)
Creates a new empty window with default layout. |
|
Window(String caption,
Layout layout)
Creates a new window. |
|
| Method Summary | |
|---|---|
void |
addListener(Window.CloseListener listener)
Adds the listener. |
void |
addParameterHandler(ParameterHandler handler)
Adds the new parameter handler to this window. |
void |
addURIHandler(URIHandler handler)
Adds the new URI handler to this window. |
void |
changeVariables(Object source,
Map variables)
Called when one or more variables handled by the implementing class are changed. |
protected void |
fireClose()
|
Application |
getApplication()
Gets the application instance of the component. |
int |
getBorder()
Returns the border. |
static Component.Focusable |
getFocusableById(long focusableId)
Maps the focusable id back to focusable component. |
Component.Focusable |
getFocusedComponent()
Gets the currently focused component in this window. |
String |
getName()
Gets the unique name of the window that indentifies it on the terminal. |
static long |
getNewFocusableId(Component.Focusable focusable)
Gets an id for focusable component. |
Component |
getParent()
Getter for property parent. |
int |
getPositionX()
Gets the distance of Window left border in pixels from left border of the containing (main window). |
int |
getPositionY()
Gets the distance of Window top border in pixels from top border of the containing (main window). |
String |
getTag()
Gets the component UIDL tag. |
Terminal |
getTerminal()
Gets the terminal type. |
String |
getTheme()
Gets the theme for this window. |
URL |
getURL()
Returns the full url of the window, this returns window specific url even for the main window. |
Window |
getWindow()
Gets the window of the component. |
void |
handleParameters(Map parameters)
Handles the given parameters. |
DownloadStream |
handleURI(URL context,
String relativeUri)
Handles uri recursively. |
void |
open(Resource resource)
Opens the given resource in this window. |
void |
open(Resource resource,
String windowName)
Opens the given resource in named terminal window. |
void |
open(Resource resource,
String windowName,
int width,
int height,
int border)
Opens the given resource in named terminal window with given size and border properties. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
static void |
removeFocusableId(long focusableId)
Releases the focusable component id when not used anymore. |
void |
removeListener(Window.CloseListener listener)
Removes the listener. |
void |
removeParameterHandler(ParameterHandler handler)
Removes the given URI handler from this window. |
void |
removeURIHandler(URIHandler handler)
Removes the given URI handler from this window. |
void |
setApplication(Application application)
Sets the application this window is connected to. |
void |
setBorder(int border)
Sets the border. |
void |
setFocusedComponent(Component.Focusable focusable)
Sets the currently focused component in this window. |
void |
setHeightUnits(int units)
Window only supports pixels as unit. |
void |
setName(String name)
Sets the name. |
void |
setParent(Component parent)
Setter for property parent. |
void |
setPositionX(int positionX)
Sets the distance of Window left border in pixels from left border of the containing (main window). |
void |
setPositionY(int positionY)
Sets the distance of Window top border in pixels from top border of the containing (main window). |
void |
setTerminal(Terminal type)
Sets the terminal type. |
void |
setTheme(String theme)
Sets the theme for this window. |
void |
setWidthUnits(int units)
Window only supports pixels as unit. |
| Methods inherited from class com.itmill.toolkit.ui.Panel |
|---|
addComponent, attach, componentAttachedToContainer, componentDetachedFromContainer, detach, getComponentIterator, getHeight, getHeightUnits, getLayout, getScrollOffsetX, getScrollOffsetY, getWidth, getWidthUnits, isScrollable, removeAllComponents, removeComponent, replaceComponent, setHeight, setLayout, setScrollable, setScrollOffsetX, setScrollOffsetY, setWidth |
| Methods inherited from class com.itmill.toolkit.ui.AbstractComponentContainer |
|---|
addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeListener, removeListener |
| Methods inherited from class com.itmill.toolkit.ui.AbstractComponent |
|---|
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, fireComponentErrorEvent, fireComponentEvent, fireEvent, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getStyle, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setReadOnly, setStyle, setVisible |
| Methods inherited from class com.itmill.toolkit.terminal.Identifiable |
|---|
getDebugId, getUIID, setDebugId, setUIID |
| 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, childRequestedRepaint, getCaption, getIcon, getLocale, getStyle, isEnabled, isReadOnly, isVisible, removeListener, setEnabled, setReadOnly, setStyle, setVisible |
| Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
| Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
|---|
dependsOn, getDirectDependencies, isImmediate, removeDirectDependency |
| Field Detail |
|---|
public static final int BORDER_NONE
public static final int BORDER_MINIMAL
public static final int BORDER_DEFAULT
| Constructor Detail |
|---|
public Window()
To show the window in application, it must be added to application with
Application.addWindow method.
The windows are scrollable by default.
caption - the Title of the window.public Window(String caption)
To show the window in application, it must be added to application with
Application.addWindow method.
The windows are scrollable by default.
caption - the Title of the window.
public Window(String caption,
Layout layout)
To show the window in application, it must be added to application with
Application.addWindow method.
The windows are scrollable by default.
caption - the Title of the window.layout - the Layout of the window.| Method Detail |
|---|
public Terminal getTerminal()
public final Window getWindow()
getWindow in interface ComponentgetWindow in class AbstractComponentpublic final Application getApplication()
getApplication in interface ComponentgetApplication in class AbstractComponentpublic final Component getParent()
getParent in interface ComponentgetParent in class AbstractComponentpublic void setParent(Component parent)
setParent in interface ComponentsetParent in class AbstractComponentparent - the New value of property parent.public String getTag()
getTag in class Panelpublic void addURIHandler(URIHandler handler)
handler - the URI handler to add.public void removeURIHandler(URIHandler handler)
handler - the URI handler to remove.
public DownloadStream handleURI(URL context,
String relativeUri)
handleURI in interface URIHandlercontext - relativeUri -
public void addParameterHandler(ParameterHandler handler)
handler - the parameter handler to add.public void removeParameterHandler(ParameterHandler handler)
handler - the parameter handler to remove.public void handleParameters(Map parameters)
ParameterHandler
Handles the given parameters. The parameters are given as inmodifieable
name to value map. All parameters names are of type:
String. All the parameter values are arrays of
strings.
handleParameters in interface ParameterHandlerparameters - the Inmodifiable name to value[] mapping.public String getTheme()
public void setTheme(String theme)
theme - the New theme for this window. Null implies the default theme.
public void paintContent(PaintTarget target)
throws PaintException
paintContent in class Panelevent - the Paint Event.
PaintException - if the paint operation failed.public void open(Resource resource)
resource -
public void open(Resource resource,
String windowName)
null window name results the resource to be opened in this
window.
resource - the resource.windowName - the name of the window.
public void open(Resource resource,
String windowName,
int width,
int height,
int border)
null window name results the
resource to be opened in this window.
resource - windowName - width - height - border - public URL getURL()
public String getName()
public int getBorder()
public void setBorder(int border)
border - the border to set.public void setApplication(Application application)
This method should not be invoked directly. Instead the
Application.addWindow(Window) method should be
used to add the window to an application and
Application.removeWindow(Window) method for
removing the window from the applicion. These methods call this method
implicitly.
The method invokes Component.attach() and
Component.detach() methods when necessary.
application - the application to set.public void setName(String name)
The name of the window must be unique inside the application. Also the name may only contain the following characters: a-z, A-Z and 0-9.
If the name is null, the the window is given name automatically when it is added to an application.
name - the name to set.public void setTerminal(Terminal type)
type - the terminal type to set.public void setHeightUnits(int units)
setHeightUnits in interface SizeablesetHeightUnits in class Panelunits - the units used in height property.Sizeable.getHeightUnits()public void setWidthUnits(int units)
setWidthUnits in interface SizeablesetWidthUnits in class Panelunits - the units used in width property.Sizeable.getWidthUnits()
public void changeVariables(Object source,
Map variables)
changeVariables in interface VariableOwnerchangeVariables in class Panelsource - 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(java.lang.Object,
java.util.Map)public Component.Focusable getFocusedComponent()
public void setFocusedComponent(Component.Focusable focusable)
focusable - the Focused component or null if none is focused.public static long getNewFocusableId(Component.Focusable focusable)
focusable - the focused component.public static Component.Focusable getFocusableById(long focusableId)
focusableId - the Focused Id.
public static void removeFocusableId(long focusableId)
focusableId - the focusable Id to remove.public int getPositionX()
public void setPositionX(int positionX)
positionX - the Distance of Window left border in pixels from left border
of the containing (main window). or -1 if unspecified.public int getPositionY()
public void setPositionY(int positionY)
positionY - the Distance of Window top border in pixels from top border of
the containing (main window). or -1 if unspecifiedpublic void addListener(Window.CloseListener listener)
listener - the listener to add.public void removeListener(Window.CloseListener listener)
listener - the listener to remove.protected void fireClose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||