fi.paatti.mobile.mobileview
Class MobileView

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractComponentContainer
          extended by com.vaadin.ui.AbstractLayout
              extended by com.vaadin.ui.AbstractOrderedLayout
                  extended by com.vaadin.ui.VerticalLayout
                      extended by fi.paatti.mobile.mobileview.MobileView
All Implemented Interfaces:
com.vaadin.event.LayoutEvents.LayoutClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.terminal.Paintable, com.vaadin.terminal.Sizeable, com.vaadin.terminal.VariableOwner, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, com.vaadin.ui.Layout, com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler, MobileViewButtons, MobileViewHeaderAndFooterActions, Serializable, EventListener

public class MobileView
extends com.vaadin.ui.VerticalLayout
implements MobileViewButtons, MobileViewHeaderAndFooterActions

Layout for all the mobile views.

Has a place for header, footer and the content.

Author:
Lauri Satokangas, lauri.n.satokangas@student.jyu.fi @date 6.3.2012
See Also:
Serialized Form
 

Nested Class Summary
 
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.ui.Layout
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.MarginInfo, com.vaadin.ui.Layout.SpacingHandler
 
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
 
Fields inherited from class com.vaadin.ui.AbstractOrderedLayout
ALIGNMENT_DEFAULT, components
 
Fields inherited from class com.vaadin.ui.AbstractLayout
margins
 
Fields inherited from interface fi.paatti.mobile.mobileview.MobileViewButtons
FOOTER_BUTTON_LEFT, FOOTER_BUTTON_MIDDLE, FOOTER_BUTTON_RIGHT
 
Fields inherited from interface com.vaadin.ui.Layout.AlignmentHandler
ALIGNMENT_BOTTOM, ALIGNMENT_HORIZONTAL_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, ALIGNMENT_VERTICAL_CENTER
 
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
MobileView()
          Constructor.
 
Method Summary
 HashMap<Object,com.vaadin.ui.Component> getFooterComponents()
          Get the component in the footer.
 void resetFooterButtons()
          Removes all text and icons from all the footer buttons.
 void setContent(com.vaadin.ui.ComponentContainer contentToBeSet)
          Set the main content.
 void setFooterButtonEnabled(Object footerButton, boolean enabled)
          Enable or disable the button.
 void setFooterButtonIcon(Object footerButton, com.vaadin.terminal.ThemeResource iconResource)
          Set the icon of the footer button.
 void setFooterButtonPressed(Object footerButton, boolean pressed)
          Sets the button state as pressed.
 void setFooterButtonsEnabled(boolean enabled)
          Enable all footerbuttons.
 void setFooterButtonsVisible(boolean visible)
          Hide all the footer buttons or make them visible.
 void setFooterButtonText(Object footerButton, String text)
          Set the text of the footer button.
 void setHeaderIcon(com.vaadin.terminal.ThemeResource iconResource)
          Set icon for the header.
 void setHeaderText(String text)
          Set the text of the header label.
 void setViewHeight(int height)
          Set the height of the layout (which should be the height of the mobile browser).
 void setViewLogic(MobileViewLogic logic)
          Set the logic that handles the footer button clicks.
 
Methods inherited from class com.vaadin.ui.AbstractOrderedLayout
addComponent, addComponent, addComponentAsFirst, addListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getComponentIterator, getExpandRatio, isSpacing, isSpacingEnabled, paintContent, removeComponent, removeListener, replaceComponent, setComponentAlignment, setComponentAlignment, setComponentAlignment, setExpandRatio, setSpacing
 
Methods inherited from class com.vaadin.ui.AbstractLayout
changeVariables, fireClick, getMargin, setMargin, setMargin, setMargin
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, 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, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setWidth, setWidth, setWidthUnits, setVisible
 
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.ComponentContainer
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setParent, 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, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits
 

Constructor Detail

MobileView

public MobileView()
Constructor.

Method Detail

setContent

public void setContent(com.vaadin.ui.ComponentContainer contentToBeSet)
Set the main content.

Parameters:
contentToBeSet - Needs to be ComponentContainer because Panel doesn´t accept single Components.

setViewHeight

public void setViewHeight(int height)
Set the height of the layout (which should be the height of the mobile browser).

Parameters:
height - The new height

getFooterComponents

public HashMap<Object,com.vaadin.ui.Component> getFooterComponents()
Get the component in the footer.

Returns:

setViewLogic

public void setViewLogic(MobileViewLogic logic)
Set the logic that handles the footer button clicks.

Parameters:
logic - The logic to be set.

setHeaderText

public void setHeaderText(String text)
Set the text of the header label.

The text can be styled with the style name .v-label-headertext

Specified by:
setHeaderText in interface MobileViewHeaderAndFooterActions
Parameters:
text - The text for the header.

setHeaderIcon

public void setHeaderIcon(com.vaadin.terminal.ThemeResource iconResource)
Set icon for the header.

Specified by:
setHeaderIcon in interface MobileViewHeaderAndFooterActions
Parameters:
iconResource - ThemeResource containing the icon

setFooterButtonText

public void setFooterButtonText(Object footerButton,
                                String text)
Set the text of the footer button.

Specified by:
setFooterButtonText in interface MobileViewHeaderAndFooterActions
Parameters:
footerButton - On which button the text will be set
text - The new text of the button

setFooterButtonEnabled

public void setFooterButtonEnabled(Object footerButton,
                                   boolean enabled)
Enable or disable the button.

Specified by:
setFooterButtonEnabled in interface MobileViewHeaderAndFooterActions
Parameters:
footerButton - Wich button will be enabled/disabled
enabled - Will the button be enabled or disabled

setFooterButtonPressed

public void setFooterButtonPressed(Object footerButton,
                                   boolean pressed)
Description copied from interface: MobileViewHeaderAndFooterActions
Sets the button state as pressed.

This means adding the button a style 'pressed' or removing the style.

Specified by:
setFooterButtonPressed in interface MobileViewHeaderAndFooterActions
Parameters:
footerButton - Wich button will be pressed/unpressed
pressed - Will the button be pressed or not.

setFooterButtonIcon

public void setFooterButtonIcon(Object footerButton,
                                com.vaadin.terminal.ThemeResource iconResource)
Set the icon of the footer button.

Specified by:
setFooterButtonIcon in interface MobileViewHeaderAndFooterActions
Parameters:
footerButton - On which button the icon will be set.
iconResource - ThemeResource containing the icon

resetFooterButtons

public void resetFooterButtons()
Removes all text and icons from all the footer buttons. Also sets the state as enabled and makes all the buttons visible.

Specified by:
resetFooterButtons in interface MobileViewHeaderAndFooterActions

setFooterButtonsEnabled

public void setFooterButtonsEnabled(boolean enabled)
Enable all footerbuttons.

Specified by:
setFooterButtonsEnabled in interface MobileViewHeaderAndFooterActions
Parameters:
enabled - Will the buttons be set to enabled or disabled.

setFooterButtonsVisible

public void setFooterButtonsVisible(boolean visible)
Hide all the footer buttons or make them visible.

Specified by:
setFooterButtonsVisible in interface MobileViewHeaderAndFooterActions
Parameters:
visible - Will the buttons be visible or hidden.


Copyright © 2012. All Rights Reserved.