eu.livotov.tpt.gui.windows
Class TPTHtmlWindow

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractComponentContainer
          extended by com.vaadin.ui.Panel
              extended by com.vaadin.ui.Window
                  extended by eu.livotov.tpt.gui.windows.TPTWindow
                      extended by eu.livotov.tpt.gui.windows.TPTHtmlWindow
All Implemented Interfaces:
com.vaadin.event.Action.Container, com.vaadin.event.Action.Handler, com.vaadin.event.Action.Notifier, com.vaadin.event.MethodEventSource, com.vaadin.terminal.Paintable, com.vaadin.terminal.ParameterHandler, com.vaadin.terminal.Scrollable, com.vaadin.terminal.Sizeable, com.vaadin.terminal.URIHandler, com.vaadin.terminal.VariableOwner, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, com.vaadin.ui.ComponentContainer.ComponentAttachListener, com.vaadin.ui.ComponentContainer.ComponentDetachListener, com.vaadin.ui.Window.CloseListener, java.io.Serializable, java.util.EventListener

public class TPTHtmlWindow
extends TPTWindow

A Window, that contains an HTML code as its background, with an actual dynamic compoment, inserted at the specified location. Location must be specified using ITMill custom layout naming rule, e.g. by providing an exact line  <div location="content"></div> somewhere in the html code, supplied as background.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.Window
com.vaadin.ui.Window.CloseEvent, com.vaadin.ui.Window.CloseListener, com.vaadin.ui.Window.CloseShortcut, com.vaadin.ui.Window.Notification, com.vaadin.ui.Window.ResizeEvent, com.vaadin.ui.Window.ResizeListener
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponent.ComponentErrorEvent, com.vaadin.ui.AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.URIHandler
com.vaadin.terminal.URIHandler.ErrorEvent
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.ParameterHandler
com.vaadin.terminal.ParameterHandler.ErrorEvent
 
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer
com.vaadin.ui.ComponentContainer.ComponentAttachEvent, com.vaadin.ui.ComponentContainer.ComponentAttachListener, com.vaadin.ui.ComponentContainer.ComponentDetachEvent, com.vaadin.ui.ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.ErrorListener, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable
com.vaadin.terminal.Paintable.RepaintRequestEvent, com.vaadin.terminal.Paintable.RepaintRequestListener
 
Field Summary
static java.lang.String CONTENT_LOCATION_ID
           
private  com.vaadin.ui.Component currentMainContent
           
private  TranslatableCustomLayout layout
           
 
Fields inherited from class com.vaadin.ui.Window
BORDER_DEFAULT, BORDER_MINIMAL, BORDER_NONE, closeShortcut
 
Fields inherited from class com.vaadin.ui.Panel
actionManager, STYLE_LIGHT
 
Fields inherited from interface com.vaadin.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
TPTHtmlWindow(java.lang.String name, java.io.InputStream htmlBackground)
          Constructs window
TPTHtmlWindow(java.lang.String name, java.io.InputStream htmlBackground, com.vaadin.ui.Component content)
          Constructs window also providing the content
TPTHtmlWindow(java.lang.String name, java.lang.String htmlBackground)
          Constructs window
TPTHtmlWindow(java.lang.String name, java.lang.String htmlBackground, com.vaadin.ui.Component content)
          Constructs window also providing the content
 
Method Summary
 void addComponent(com.vaadin.ui.Component component, java.lang.String locationId)
          Allows to add more components into the window's background layout by providing custom layout connection slot name (location name)
 void removeComponent(java.lang.String locationId)
          Removes component by it's location id
 void setContent(com.vaadin.ui.Component content)
          Sets new or changes the active component of the window.
 void setWindowBackground(java.io.InputStream htmlCode)
          Sets new background layout for the window.
 void setWindowBackground(java.lang.String htmlCode)
          Sets new background layout for the window.
 
Methods inherited from class eu.livotov.tpt.gui.windows.TPTWindow
applyHtmlFormatting, enterKeyPressed, escapeKeyPressed, getActions, getURL, handleAction, showErrorMessage, showMessage, showNotification, showWarningMessage, windowClose
 
Methods inherited from class com.vaadin.ui.Window
addComponent, addListener, addListener, addParameterHandler, addURIHandler, addWindow, center, changeVariables, close, executeJavaScript, fireClose, fireResize, getApplication, getBorder, getChildWindows, getName, getParent, getPositionX, getPositionY, getTerminal, getTheme, getWindow, handleParameters, handleURI, isClosable, isDraggable, isModal, isResizable, open, open, open, paintContent, removeCloseShortcut, removeListener, removeListener, removeParameterHandler, removeURIHandler, removeWindow, setApplication, setBorder, setClosable, setCloseShortcut, setDraggable, setModal, setName, setParent, setPositionX, setPositionY, setResizable, setTerminal, setTheme, showNotification, showNotification, showNotification, showNotification, showNotification
 
Methods inherited from class com.vaadin.ui.Panel
addAction, addActionHandler, addListener, attach, componentAttachedToContainer, componentDetachedFromContainer, detach, getActionManager, getComponentIterator, getContent, getLayout, getScrollLeft, getScrollOffsetX, getScrollOffsetY, getScrollTop, isScrollable, removeAction, removeActionHandler, removeAllActionHandlers, removeAllComponents, removeComponent, removeListener, replaceComponent, requestRepaintAll, setContent, setLayout, setScrollable, setScrollLeft, setScrollOffsetX, setScrollOffsetY, setScrollTop
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeListener, removeListener, setEnabled, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getLocale, getStyle, getStyleName, getTag, getWidth, getWidthUnits, handleError, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, childRequestedRepaint, getCaption, getIcon, getLocale, getStyleName, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.terminal.Paintable
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.vaadin.terminal.VariableOwner
isImmediate
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits
 

Field Detail

CONTENT_LOCATION_ID

public static final java.lang.String CONTENT_LOCATION_ID
See Also:
Constant Field Values

layout

private TranslatableCustomLayout layout

currentMainContent

private com.vaadin.ui.Component currentMainContent
Constructor Detail

TPTHtmlWindow

public TPTHtmlWindow(java.lang.String name,
                     java.lang.String htmlBackground)
Constructs window

Parameters:
name - window name, that is used in URLs
htmlBackground - custom layout file name (without extension) to use for both layout and background of this window. The specified layout file must contain a  <div location="content"></div> declaration, where the actual content will be inserted.

TPTHtmlWindow

public TPTHtmlWindow(java.lang.String name,
                     java.lang.String htmlBackground,
                     com.vaadin.ui.Component content)
Constructs window also providing the content

Parameters:
name - window name, that is used in URLs
htmlBackground - custom layout file name (without extension) to use for both layout and background of this window. The specified layout file must contain a  <div location="content"></div> declaration, where the actual content will be inserted.
content - actual component to be displayed in the window in the location, specified by  <div location="content"></div> tag of custom layout file.

TPTHtmlWindow

public TPTHtmlWindow(java.lang.String name,
                     java.io.InputStream htmlBackground)
              throws java.io.IOException
Constructs window

Parameters:
name - window name, that is used in URLs
htmlBackground - custom layout data stream to use for both layout and background of this window. The specified layout file must contain a  <div location="content"></div> declaration, where the actual content will be inserted.
Throws:
java.io.IOException

TPTHtmlWindow

public TPTHtmlWindow(java.lang.String name,
                     java.io.InputStream htmlBackground,
                     com.vaadin.ui.Component content)
              throws java.io.IOException
Constructs window also providing the content

Parameters:
name - window name, that is used in URLs
htmlBackground - custom layout data stream to use for both layout and background of this window. The specified layout file must contain a  <div location="content"></div> declaration, where the actual content will be inserted.
content - actual component to be displayed in the window in the location, specified by  <div location="content"></div> tag of custom layout file.
Throws:
java.io.IOException
Method Detail

setContent

public void setContent(com.vaadin.ui.Component content)
Sets new or changes the active component of the window. Component is placed into the location, described with attribute location="content"

Parameters:
content - new component that is used as window main component

addComponent

public void addComponent(com.vaadin.ui.Component component,
                         java.lang.String locationId)
Allows to add more components into the window's background layout by providing custom layout connection slot name (location name)

Parameters:
component - component to be added to the window
locationId - name of the location where component should be inserted

removeComponent

public void removeComponent(java.lang.String locationId)
Removes component by it's location id

Parameters:
locationId -

setWindowBackground

public void setWindowBackground(java.lang.String htmlCode)
Sets new background layout for the window. This will transfer your main active component as well but will not transfer all extra components, added to previoud background by addComponent(...) method.

Parameters:
htmlCode - layout file name (without extension)

setWindowBackground

public void setWindowBackground(java.io.InputStream htmlCode)
                         throws java.io.IOException
Sets new background layout for the window. This will transfer your main active component as well but will not transfer all extra components, added to previoud background by addComponent(...) method.

Parameters:
htmlCode - layout data stream
Throws:
java.io.IOException - in case of layout stream loading errors