de.hs_rm.cs.lecturenotes.client.module.exercise
Class ExerciseViewerEditor

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.exercise.ExerciseViewerEditor
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 ExerciseViewerEditor
extends AbstractParagraphViewerEditor

Viewer and editor for Exercise system objects.

Version:
$LastChangedRevision: 273 $
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 boolean EDIT_MODE
          This components state towards editing.
 
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
ExerciseViewerEditor(Lecture oLecture, Paragraph oPararaph)
          Constructor.
 
Method Summary
 void callRenderer(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.FlexTable table, int tablePositionExercise, Exercise currentExercise)
          Calls the GWT RPC (paragraph) HTML renderer for Exercise HTML rendering usage.
 com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> getCreateExerciseCallback(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.FlexTable table)
          Will return the create Exercise GWT RPC service callback.
 Exercise getDefaultEmptyExercise(int position, Paragraph paragraph)
          Will return the default empty Exercise used for a new Exercise.
 com.google.gwt.user.client.rpc.AsyncCallback<java.lang.String> getExerciseRenderCallback(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.FlexTable table, Exercise currentExercise, int tablePositionExercise)
          Will return the GWT RPC callback for Exercise HTML rendering.
 com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Exercise>> getExercisesPerParaCallback(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.FlexTable table)
          Will return the GWT RPC callback for receiving exercises to a paragraph specified by Paragraph para.
 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 para)
          Will return a top menu panel that is displayed above the paragraph's contents.
 void replaceViewWithEditor(int currentTableRow, Paragraph para, java.lang.String newPosition, com.google.gwt.user.client.ui.HTML htmlParaView, com.google.gwt.user.client.ui.FlexTable table, Exercise currentExercise, int tablePositionExercise, com.google.gwt.user.client.ui.VerticalPanel vp)
          Replaces the current read-only view with the editor panel.
 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

EDIT_MODE

public static boolean EDIT_MODE
This components state towards editing.

Constructor Detail

ExerciseViewerEditor

public ExerciseViewerEditor(Lecture oLecture,
                            Paragraph oPararaph)
Constructor.

Parameters:
oLecture - Lecture
oPararaph - Paragraph
Method Detail

getParagraphMenuPanel

public com.google.gwt.user.client.ui.Widget getParagraphMenuPanel(Paragraph para)
Description copied from interface: IParagraphViewerEditor
Will return a top menu panel that is displayed above the paragraph's contents.

Parameters:
para - Paragraph
Returns:
Widget

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

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

getDefaultEmptyExercise

public Exercise getDefaultEmptyExercise(int position,
                                        Paragraph paragraph)
Will return the default empty Exercise used for a new Exercise.

Parameters:
position - int position
paragraph - Paragraph
Returns:
Exercise

getCreateExerciseCallback

public com.google.gwt.user.client.rpc.AsyncCallback<ResponseStatusEnum> getCreateExerciseCallback(int currentTableRow,
                                                                                                  Paragraph para,
                                                                                                  java.lang.String newPosition,
                                                                                                  com.google.gwt.user.client.ui.HTML htmlParaView,
                                                                                                  com.google.gwt.user.client.ui.FlexTable table)
Will return the create Exercise GWT RPC service callback.

Parameters:
currentTableRow - int indicates Paragraph position in the paragraph table
para - Paragraph
newPosition - for Paragraph
htmlParaView - HTML for Paragraph
table - FlexTable for exercises to their paragraph
Returns:
AsyncCallback of ResponseStatusEnum

getExercisesPerParaCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Exercise>> getExercisesPerParaCallback(int currentTableRow,
                                                                                                          Paragraph para,
                                                                                                          java.lang.String newPosition,
                                                                                                          com.google.gwt.user.client.ui.HTML htmlParaView,
                                                                                                          com.google.gwt.user.client.ui.FlexTable table)
Will return the GWT RPC callback for receiving exercises to a paragraph specified by Paragraph para.

Parameters:
currentTableRow - int
para - Paragraph
newPosition - String
htmlParaView - HTML
table - FlexTable
Returns:
AsyncCallback of List of Exercise

callRenderer

public void callRenderer(int currentTableRow,
                         Paragraph para,
                         java.lang.String newPosition,
                         com.google.gwt.user.client.ui.HTML htmlParaView,
                         com.google.gwt.user.client.ui.FlexTable table,
                         int tablePositionExercise,
                         Exercise currentExercise)
Calls the GWT RPC (paragraph) HTML renderer for Exercise HTML rendering usage.

Parameters:
currentTableRow - int indicates Paragraph position in the paragraph table
para - Paragraph
newPosition - for Paragraph
htmlParaView - HTML for Paragraph
table - FlexTable for exercises to their paragraph
currentExercise - Exercise
tablePositionExercise - int Table position for Exercise

getExerciseRenderCallback

public com.google.gwt.user.client.rpc.AsyncCallback<java.lang.String> getExerciseRenderCallback(int currentTableRow,
                                                                                                Paragraph para,
                                                                                                java.lang.String newPosition,
                                                                                                com.google.gwt.user.client.ui.HTML htmlParaView,
                                                                                                com.google.gwt.user.client.ui.FlexTable table,
                                                                                                Exercise currentExercise,
                                                                                                int tablePositionExercise)
Will return the GWT RPC callback for Exercise HTML rendering.

Parameters:
currentTableRow - int indicates Paragraph position in the paragraph table
para - Paragraph
newPosition - for Paragraph
htmlParaView - HTML for Paragraph
table - FlexTable for exercises to their paragraph
currentExercise - Exercise
tablePositionExercise - int Table position for Exercise
Returns:
AsyncCallback of String

replaceViewWithEditor

public void replaceViewWithEditor(int currentTableRow,
                                  Paragraph para,
                                  java.lang.String newPosition,
                                  com.google.gwt.user.client.ui.HTML htmlParaView,
                                  com.google.gwt.user.client.ui.FlexTable table,
                                  Exercise currentExercise,
                                  int tablePositionExercise,
                                  com.google.gwt.user.client.ui.VerticalPanel vp)
Replaces the current read-only view with the editor panel.

Parameters:
currentTableRow - int indicates Paragraph position in the paragraph table
para - Paragraph
newPosition - for Paragraph
htmlParaView - HTML for Paragraph
table - FlexTable for exercises to their paragraph
currentExercise - Exercise
tablePositionExercise - int Table position for Exercise
vp - vp Parent Panel