asquare.gwt.tk.client.ui
Class ModalDialog.PositionDialogController
java.lang.Object
asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
asquare.gwt.tk.client.ui.behavior.ControllerAdaptor
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).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModalDialog.PositionDialogController
public ModalDialog.PositionDialogController()
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.
- post: the dialog content width (style attribute) will be updated
- post: the
dialogWidth property will be finalized
updateContentHeight
protected int updateContentHeight(ModalDialog dialog,
int contentHeight)
- Template method for updating the content height.
- post: the dialog content height (style attribute) will be updated
- post: the
dialogHeight property will be finalized
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)
© 2007 Mat Gessel