de.hs_rm.cs.lecturenotes.client.module.paragraph
Class ParagraphViewerEditor

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.ComplexPanel
                  extended by com.google.gwt.user.client.ui.CellPanel
                      extended by com.google.gwt.user.client.ui.VerticalPanel
                          extended by de.hs_rm.cs.lecturenotes.client.core.presentation.ui.editor.AbstractParagraphViewerEditor
                              extended by de.hs_rm.cs.lecturenotes.client.module.paragraph.ParagraphViewerEditor
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasAlignment, com.google.gwt.user.client.ui.HasHorizontalAlignment, com.google.gwt.user.client.ui.HasVerticalAlignment, 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.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.InsertPanel, com.google.gwt.user.client.ui.InsertPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, IParagraphViewerEditor, java.lang.Iterable<com.google.gwt.user.client.ui.Widget>

public final class ParagraphViewerEditor
extends AbstractParagraphViewerEditor

Originates from class ScriptViewMode. This class represents the Viewer and Editor to Paragraph objects of a Lecture entity.

Version:
$LastChangedRevision: 259 $
Author:
Enrico Homann

Nested Class Summary
 
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.HasHorizontalAlignment
com.google.gwt.user.client.ui.HasHorizontalAlignment.AutoHorizontalAlignmentConstant, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel
com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
 
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 PARAGRAPH_ICONHTML_CONTENT
          Icon Html Image Code for Paragraph Tab Content.
static int PARAGRAPHVIEW_MINIMUMHEIGHT_PX
          Minimal height of a paragraph view.
static java.lang.String TEMPLATE_MENUHEADER
          Template for Html menu header per paragraph.
static java.lang.String TEMPLATEKEY_NUMBEROFANNOTATIONS
          Template Key for number of annotations.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
 
Fields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP
 
Constructor Summary
ParagraphViewerEditor(Lecture lecture, Paragraph pararaph)
          Constructor.
 
Method Summary
 com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Annotation>> getDocentAnnotationCallback(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.Widget panel, java.lang.String result)
          Will return the GWT RPC callback to receive Docent annotations using method getAnnotationListByParaId(...).
 java.lang.String getMenuHeaderByTemplate(java.lang.String template, Paragraph paragraph, java.lang.Long numberOfAnnotations)
          Will return the replaced menu html header String using the template String template and Long numberOfAnnotations.
 com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Long> getNumberAnnotationsForParagraphCallback(Paragraph paragraph, com.google.gwt.user.client.ui.HTML html)
          Will return the AsyncCallback for retrieval of the number of annotations per Paragraph paragraph.
 com.google.gwt.user.client.ui.Widget getParagraphEditPanel(Paragraph para, java.lang.String position, com.google.gwt.user.client.ui.VerticalPanel parentPanel, com.google.gwt.user.client.ui.Widget paragraphMenu, com.google.gwt.user.client.ui.HTML htmlParaView)
          Will return the edit panel that is displayed for Paragraph para's contents in edit mode.
 com.google.gwt.user.client.ui.Widget getParagraphMenuPanel(Paragraph paragraph)
          Will return the Paragraph ViewerEditor menu panel.
 com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Annotation>> getUserAnnotationCallback(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.Widget panel, java.lang.String result)
          Will return the GWT RPC callback to receive User annotations using method getAnnotationListByParaId(...).
 void onRenderParaAsHTMLSuccess(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.Widget panel, java.lang.String result)
          Event Callback that gets triggered if the RPC to RenderParaAsHTML was successful.
 void showParagraph(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.VerticalPanel panel)
          Called to show the paragraph's contents.
 
Methods inherited from class de.hs_rm.cs.lecturenotes.client.core.presentation.ui.editor.AbstractParagraphViewerEditor
getFlexTable, getLecture, getParagraph, getScrollPanel, setLecture, setParagraph
 
Methods inherited from class com.google.gwt.user.client.ui.VerticalPanel
add, getHorizontalAlignment, getVerticalAlignment, insert, insert, remove, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from class com.google.gwt.user.client.ui.CellPanel
getSpacing, setBorderWidth, setCellHeight, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellWidth, setCellWidth, setSpacing
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, clear, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, 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.user.client.ui.InsertPanel.ForIsWidget
add
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

Field Detail

PARAGRAPH_ICONHTML_CONTENT

public static final java.lang.String PARAGRAPH_ICONHTML_CONTENT
Icon Html Image Code for Paragraph Tab Content.


TEMPLATEKEY_NUMBEROFANNOTATIONS

public static final java.lang.String TEMPLATEKEY_NUMBEROFANNOTATIONS
Template Key for number of annotations.

See Also:
Constant Field Values

TEMPLATE_MENUHEADER

public static final java.lang.String TEMPLATE_MENUHEADER
Template for Html menu header per paragraph.

See Also:
Constant Field Values

PARAGRAPHVIEW_MINIMUMHEIGHT_PX

public static final int PARAGRAPHVIEW_MINIMUMHEIGHT_PX
Minimal height of a paragraph view. Used to keep up with the right annotation panel view.

See Also:
Constant Field Values
Constructor Detail

ParagraphViewerEditor

public ParagraphViewerEditor(Lecture lecture,
                             Paragraph pararaph)
Constructor.

Parameters:
lecture - Lecture
pararaph - Paragraph main application panel
Method Detail

getMenuHeaderByTemplate

public java.lang.String getMenuHeaderByTemplate(java.lang.String template,
                                                Paragraph paragraph,
                                                java.lang.Long numberOfAnnotations)
Will return the replaced menu html header String using the template String template and Long numberOfAnnotations.

Parameters:
template - String
paragraph - Paragraph
numberOfAnnotations - Long
Returns:
String

getParagraphMenuPanel

public com.google.gwt.user.client.ui.Widget getParagraphMenuPanel(Paragraph paragraph)
Will return the Paragraph ViewerEditor menu panel. One menu panel per Paragraph.

Parameters:
paragraph - Paragraph
Returns:
Widget

getNumberAnnotationsForParagraphCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Long> getNumberAnnotationsForParagraphCallback(Paragraph paragraph,
                                                                                                             com.google.gwt.user.client.ui.HTML html)
Will return the AsyncCallback for retrieval of the number of annotations per Paragraph paragraph. The result is meant to be shown in HTML html.

Parameters:
paragraph - Paragraph
html - HTML
Returns:
AsyncCallback of Long

showParagraph

public void showParagraph(int currentTableRow,
                          Paragraph para,
                          java.lang.String newPosition,
                          com.google.gwt.user.client.ui.HTML htmlParaView,
                          com.google.gwt.user.client.ui.VerticalPanel panel)
Description copied from interface: IParagraphViewerEditor
Called to show the paragraph's contents.

Parameters:
currentTableRow - int Position of the panel within the FlexTable
para - Paragraph
newPosition - String UI display position
htmlParaView - HTML the view widget of the contents
panel - VerticalPanel

onRenderParaAsHTMLSuccess

public void onRenderParaAsHTMLSuccess(int currentTableRow,
                                      Paragraph para,
                                      java.lang.String newPosition,
                                      com.google.gwt.user.client.ui.HTML htmlParaView,
                                      com.google.gwt.user.client.ui.Widget panel,
                                      java.lang.String result)
Event Callback that gets triggered if the RPC to RenderParaAsHTML was successful.

Parameters:
currentTableRow - int Row position in ViewerEditor
para - Paragraph
newPosition - String
htmlParaView - HTML
panel - Widget
result - String

getDocentAnnotationCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Annotation>> getDocentAnnotationCallback(int currentTableRow,
                                                                                                            Paragraph para,
                                                                                                            java.lang.String newPosition,
                                                                                                            com.google.gwt.user.client.ui.HTML htmlParaView,
                                                                                                            com.google.gwt.user.client.ui.Widget panel,
                                                                                                            java.lang.String result)
Will return the GWT RPC callback to receive Docent annotations using method getAnnotationListByParaId(...).

Parameters:
currentTableRow - int Row position in ViewerEditor
para - Paragraph
newPosition - String
htmlParaView - HTML
panel - Widget
result - String
Returns:
AsyncCallback of List of Annotation

getUserAnnotationCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Annotation>> getUserAnnotationCallback(int currentTableRow,
                                                                                                          Paragraph para,
                                                                                                          java.lang.String newPosition,
                                                                                                          com.google.gwt.user.client.ui.HTML htmlParaView,
                                                                                                          com.google.gwt.user.client.ui.Widget panel,
                                                                                                          java.lang.String result)
Will return the GWT RPC callback to receive User annotations using method getAnnotationListByParaId(...).

Parameters:
currentTableRow - int Row position in ViewerEditor
para - Paragraph
newPosition - String
htmlParaView - HTML
panel - Widget
result - String
Returns:
AsyncCallback of List of Annotation

getParagraphEditPanel

public com.google.gwt.user.client.ui.Widget getParagraphEditPanel(Paragraph para,
                                                                  java.lang.String position,
                                                                  com.google.gwt.user.client.ui.VerticalPanel parentPanel,
                                                                  com.google.gwt.user.client.ui.Widget paragraphMenu,
                                                                  com.google.gwt.user.client.ui.HTML htmlParaView)
Description copied from interface: IParagraphViewerEditor
Will return the edit panel that is displayed for Paragraph para's contents in edit mode.

Parameters:
para - Paragraph
position - String
parentPanel - VerticalPanel
paragraphMenu - Widget
htmlParaView - HTML
Returns:
Widget