de.hs_rm.cs.lecturenotes.client.module.slide
Class SlideOnlineViewDialogBox

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.SimplePanel
                  extended by com.google.gwt.user.client.ui.PopupPanel
                      extended by com.google.gwt.user.client.ui.DecoratedPopupPanel
                          extended by com.google.gwt.user.client.ui.DialogBox
                              extended by de.hs_rm.cs.lecturenotes.client.module.slide.SlideOnlineViewDialogBox
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>, com.google.gwt.event.logical.shared.ResizeHandler, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.safehtml.client.HasSafeHtml, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.EventPreview, com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasHTML, com.google.gwt.user.client.ui.HasOneWidget, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, com.google.gwt.user.client.ui.MouseListener, com.google.gwt.user.client.ui.SourcesPopupEvents, IForm<java.util.List<Slide>>, java.lang.Iterable<com.google.gwt.user.client.ui.Widget>

public final class SlideOnlineViewDialogBox
extends com.google.gwt.user.client.ui.DialogBox
implements IForm<java.util.List<Slide>>, com.google.gwt.event.logical.shared.ResizeHandler

Online Viewer for the slides of a Lecture. Does show the slides per Paragraph in a "slide-show" manner.

Version:
$LastChangedRevision: 241 $
Author:
Enrico Homann

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.DialogBox
com.google.gwt.user.client.ui.DialogBox.Caption, com.google.gwt.user.client.ui.DialogBox.CaptionImpl
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.PositionCallback
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
static java.lang.String DEFAULT_HEIGHT
          Default height of the DialogBox.
static java.lang.String DEFAULT_WIDTH
          Default width of the DialogBox.
static java.lang.String SLIDE_STATUS_TEMPLATE
          Display Status template for the slide.
static java.lang.String SLIDE_STATUS_TEMPLATE_EMPTY
          String Template for the slide status.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SlideOnlineViewDialogBox(Paragraph oParentParagraph)
          Constructor.
 
Method Summary
 void addCurrentSlideListPosition(int increment)
          Adds int increment to the position.
 java.util.List<Paragraph> getFlattenedParagraphList()
          Will create and return the flattened paragraph list.
 java.util.List<Slide> getFormModel()
          Will return the form model.
 com.google.gwt.user.client.rpc.AsyncCallback<java.lang.String> getHTMLRendererCallback(Slide slide)
          Will return the AsyncCallback to receive a HTML rendered Slide slide content.
 Paragraph getParentParagraph()
          Will return the parent paragraph.
 com.google.gwt.user.client.ui.HTML getSlideContentHTML()
          Will return the content HTML object.
 com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Slide>> getSlideListCallback()
          Will return the GWT-RPC AsyncCallback for receiving slides.
 java.lang.String getSlideStatusString(Slide slide)
          Will return a small status String for Slide slide.
 boolean isValidSlideListPosition(int position)
          Checks whether int position would be a valid index position for the Slide List ( true ) or not false.
 void loadSlides()
          Loads slides from the back-end service.
 void onButtonClose()
          Event callback triggered if the user hits the close button.
 void onButtonFullscreen()
          Event callback triggered if the user hits the fullscreen button.
 void onButtonNextSlide()
          Event callback triggered if the user hits the next slide button.
 void onButtonPreviousSlide()
          Event callback triggered if the user hits the previous slide button.
 void onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
           
 void onUpdateModelFromView()
          Event callback meant to be called if an update of the model from the view components shall occur.
 void onUpdateViewFromModel()
          Event callback meant to be called if an update of the view components from the model shall occur.
 void setFormModel(java.util.List<Slide> model)
          Sets the model.
 void setParentParagraph(Paragraph oParentParagraph)
          Sets the parent paragraph.
 
Methods inherited from class com.google.gwt.user.client.ui.DialogBox
getCaption, getHTML, getText, hide, onBrowserEvent, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseUp, setHTML, setHTML, setText, show
 
Methods inherited from class com.google.gwt.user.client.ui.DecoratedPopupPanel
clear, getWidget, iterator, remove, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getTitle, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setHeight, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, setWidth, showRelativeTo
 
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Field Detail

SLIDE_STATUS_TEMPLATE

public static final java.lang.String SLIDE_STATUS_TEMPLATE
Display Status template for the slide. Use %slide_position for current Slide.position and %paragraph_title for Paragraph.title of "parentParagraph" instance. %slides_size for the formModel List of Slide objects.

See Also:
Constant Field Values

SLIDE_STATUS_TEMPLATE_EMPTY

public static final java.lang.String SLIDE_STATUS_TEMPLATE_EMPTY
String Template for the slide status.

See Also:
Constant Field Values

DEFAULT_WIDTH

public static final java.lang.String DEFAULT_WIDTH
Default width of the DialogBox.

See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final java.lang.String DEFAULT_HEIGHT
Default height of the DialogBox.

See Also:
Constant Field Values
Constructor Detail

SlideOnlineViewDialogBox

public SlideOnlineViewDialogBox(Paragraph oParentParagraph)
Constructor. Paragraph Mode. Slides only for the Paragraph paragraph and its children.

Parameters:
oParentParagraph - Paragraph
Method Detail

loadSlides

public void loadSlides()
Loads slides from the back-end service.


addCurrentSlideListPosition

public void addCurrentSlideListPosition(int increment)
Adds int increment to the position. A negative increment for emulating decreasing is also possible.

Parameters:
increment - int

isValidSlideListPosition

public boolean isValidSlideListPosition(int position)
Checks whether int position would be a valid index position for the Slide List ( true ) or not false.

Parameters:
position - int
Returns:
boolean

getFlattenedParagraphList

public java.util.List<Paragraph> getFlattenedParagraphList()
Will create and return the flattened paragraph list. Known Issues: Browser-Compatibility; There was a problem with Firefox 16 so that the user couldn't browse from one paragraph to another child paragraph. It was solved by creating a new flattened list with every call to this method. However I wasn't able to browse backwards over Paragraphs with Firefox 16.

Returns:
List of Paragraph

getSlideListCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Slide>> getSlideListCallback()
Will return the GWT-RPC AsyncCallback for receiving slides.

Returns:
AsyncCallback of List of Slide objects

getSlideStatusString

public java.lang.String getSlideStatusString(Slide slide)
Will return a small status String for Slide slide.

Parameters:
slide - Slide
Returns:
String

getSlideContentHTML

public com.google.gwt.user.client.ui.HTML getSlideContentHTML()
Will return the content HTML object.

Returns:
HTML

getParentParagraph

public Paragraph getParentParagraph()
Will return the parent paragraph.

Returns:
Paragraph

setParentParagraph

public void setParentParagraph(Paragraph oParentParagraph)
Sets the parent paragraph.

Parameters:
oParentParagraph - Paragraph

setFormModel

public void setFormModel(java.util.List<Slide> model)
Description copied from interface: IForm
Sets the model.

Specified by:
setFormModel in interface IForm<java.util.List<Slide>>
Parameters:
model - T

getFormModel

public java.util.List<Slide> getFormModel()
Description copied from interface: IForm
Will return the form model.

Specified by:
getFormModel in interface IForm<java.util.List<Slide>>
Returns:
T

onResize

public void onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
Specified by:
onResize in interface com.google.gwt.event.logical.shared.ResizeHandler

onButtonClose

public void onButtonClose()
Event callback triggered if the user hits the close button.


onButtonNextSlide

public void onButtonNextSlide()
Event callback triggered if the user hits the next slide button.


onButtonPreviousSlide

public void onButtonPreviousSlide()
Event callback triggered if the user hits the previous slide button.


onButtonFullscreen

public void onButtonFullscreen()
Event callback triggered if the user hits the fullscreen button.


onUpdateViewFromModel

public void onUpdateViewFromModel()
Description copied from interface: IForm
Event callback meant to be called if an update of the view components from the model shall occur.

Specified by:
onUpdateViewFromModel in interface IForm<java.util.List<Slide>>

getHTMLRendererCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.lang.String> getHTMLRendererCallback(Slide slide)
Will return the AsyncCallback to receive a HTML rendered Slide slide content.

Parameters:
slide - Slide
Returns:
AsyncCallback of String

onUpdateModelFromView

public void onUpdateModelFromView()
Description copied from interface: IForm
Event callback meant to be called if an update of the model from the view components shall occur.

Specified by:
onUpdateModelFromView in interface IForm<java.util.List<Slide>>