GWT Tk 0.2.3

asquare.gwt.tk.client.ui
Class ModalDialog.PositionDialogController

java.lang.Object
  extended by asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
      extended by asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
          extended by asquare.gwt.tk.client.ui.ModalDialog.PositionDialogController
All Implemented Interfaces:
Controller, EventDelegate
Direct Known Subclasses:
ModalDialog.PositionDialogControllerIE6
Enclosing class:
ModalDialog

public static class ModalDialog.PositionDialogController
extends ControllerAdaptor

A controller which encapsulates dialog sizing and positioning logic. Although this class doesn't react to events, we're going to implement Controller to enable dynamic configuration via ControllerSupport.getController(Class).


Constructor Summary
ModalDialog.PositionDialogController()
           
 
Method Summary
 void afterAttach(ModalDialog dialog)
           
protected  int applyMaxWidthConstraint(ModalDialog dialog, int contentWidth)
           
protected  int applyMinHeightConstraint(ModalDialog dialog, int contentHeight)
           
protected  int applyMinWidthConstraint(ModalDialog dialog, int contentWidth)
           
 void beforeAttach(ModalDialog dialog)
           
protected  int getViewportHeight()
           
protected  int getViewportWidth()
           
 void plugIn(Widget widget)
          Called when the widget is attached to the DOM.
protected  void setDialogPosition(ModalDialog dialog, int dialogWidth, int dialogHeight)
          Template method for setting the dialog's final position.
protected  void setViewportHeight(int centerY)
           
protected  void setViewportWidth(int centerX)
           
protected  int updateContentHeight(ModalDialog dialog, int contentHeight)
          Template method for updating the content height.
protected  int updateContentWidth(ModalDialog dialog, int contentWidth)
          Template method for updating the content width.
 
Methods inherited from class asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
getId, unplug
 
Methods inherited from class asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
doBrowserEvent, getEventBits, onBrowserEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface asquare.gwt.tk.client.ui.behavior.EventDelegate
getEventBits, onBrowserEvent
 

Constructor Detail

ModalDialog.PositionDialogController

public ModalDialog.PositionDialogController()
Method Detail

getViewportWidth

protected int getViewportWidth()

setViewportWidth

protected void setViewportWidth(int centerX)

getViewportHeight

protected int getViewportHeight()

setViewportHeight

protected void setViewportHeight(int centerY)

plugIn

public void plugIn(Widget widget)
Description copied from interface: Controller
Called when the widget is attached to the DOM. Use to initialize widget, install special hooks and attach listeners.

Specified by:
plugIn in interface Controller
Overrides:
plugIn in class ControllerAdaptor
Parameters:
widget - the view to control

applyMinWidthConstraint

protected int applyMinWidthConstraint(ModalDialog dialog,
                                      int contentWidth)

applyMaxWidthConstraint

protected int applyMaxWidthConstraint(ModalDialog dialog,
                                      int contentWidth)

applyMinHeightConstraint

protected int applyMinHeightConstraint(ModalDialog dialog,
                                       int contentHeight)

updateContentWidth

protected int updateContentWidth(ModalDialog dialog,
                                 int contentWidth)
Template method for updating the content width.


updateContentHeight

protected int updateContentHeight(ModalDialog dialog,
                                  int contentHeight)
Template method for updating the content height.


setDialogPosition

protected void setDialogPosition(ModalDialog dialog,
                                 int dialogWidth,
                                 int dialogHeight)
Template method for setting the dialog's final position. This implementation prevents the dialog being positioned above or left of the origin.

Parameters:
dialog -
dialogWidth -
dialogHeight -

beforeAttach

public void beforeAttach(ModalDialog dialog)

afterAttach

public void afterAttach(ModalDialog dialog)

GWT Tk 0.2.3

© 2007 Mat Gessel