org.kuali.student.common.ui.client.widgets
Class KSLightBox

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 org.kuali.student.common.ui.client.widgets.KSLightBox
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.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.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, Iterable<com.google.gwt.user.client.ui.Widget>

public class KSLightBox
extends com.google.gwt.user.client.ui.DialogBox

A KSLightBox is a dialog box that lays out its contents as follows using a DockLayoutPanel:

------------------
HEADER (either static caption / header widget that is not part of the scrollable area)
------------------
CONTENT (part of the scrollable area that will fill available space)
------------------
BUTTONS (static button area that is not part of the scrollable area)
------------------

The size of the dock panel will determine the size of the lightbox. Thus only the dock panel size will need to be set.
The size of the dock panel is usually determined dynamically when the lightbox is displayed, but you can also statically set it with one of the 'setSize' methods.
If you however set the size statically, the lightbox won't resize.
If you're making use of the static sizes, the non-caption header and displaying the buttons, don't set the height of the dialog smaller than about 155px. Otherwise there's too little space left for the content and the content (even if its just one line of text) will be displayed in a scroll panel.


Nested Class Summary
static class KSLightBox.Size
          An enum that specifies predefined width and height values (in pixels) for the lightbox.
 
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
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
KSLightBox()
           
KSLightBox(boolean addCloseLink)
           
KSLightBox(String title)
           
KSLightBox(String title, KSLightBox.Size size)
           
 
Method Summary
 void addButton(com.google.gwt.user.client.ui.Widget button)
          Adds a button to the bottom of the lightbox.
 void addButtonGroup(ButtonGroup group)
          Adds a ButtonGroup to the button panel at the bottom of the lightbox.
 void addButtonGroup(ButtonGroup group)
          Adds a ButtonGroup to the button panel at the bottom of the lightbox.
 com.google.gwt.event.shared.HandlerRegistration addCloseLinkClickHandler(com.google.gwt.event.dom.client.ClickHandler clickHandler)
           
 void clearButtons()
          Removes all the buttons at the bottom of the lightbox.
 com.google.gwt.user.client.ui.Widget getWidget()
           
 void hide()
           
 void installResizeHandler()
           
protected  void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent preview)
           
 void removeCloseLink()
           
 void setCloseLinkVisible(boolean visible)
           
 void setMaxHeight(int height)
          Set the maximum height in pixels that this dialog will grow to.
Please note: If the lightbox's size was set explicitly, this call will have no effect.
 void setMaxWidth(int width)
          Set the maximum width in pixels that this dialog will grow to.
Please note: If the lightbox's size was set explicitly, this call will have no effect.
 void setNonCaptionHeader(com.google.gwt.user.client.ui.Widget widget)
          Sets the header that will be displayed at the top of the lightbox.
Please note: This header will not be displayed in the caption, but in the actual lightbox content area.
 void setSize(int width, int height)
          Set the width and height of the lightbox in pixels.
Please note: These values will not be affected by resizing.
 void setSize(KSLightBox.Size size)
          Set the width and height of the lightbox in pixels using the KSLightBox.Size enum.
 void setText(String text)
           
 void setWidget(com.google.gwt.user.client.ui.Widget content)
           
 void show()
           
 void showButtons(boolean show)
           
 void uninstallResizeHandler()
           
 
Methods inherited from class com.google.gwt.user.client.ui.DialogBox
beginDragging, continueDragging, doAttachChildren, doDetachChildren, endDragging, getCaption, getHTML, getText, onBrowserEvent, onEnsureDebugId, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseUp, setHTML, setHTML
 
Methods inherited from class com.google.gwt.user.client.ui.DecoratedPopupPanel
clear, getCellElement, iterator, remove
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, 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, adopt, adopt, disown, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

KSLightBox

public KSLightBox()

KSLightBox

public KSLightBox(boolean addCloseLink)

KSLightBox

public KSLightBox(String title)

KSLightBox

public KSLightBox(String title,
                  KSLightBox.Size size)
Method Detail

setCloseLinkVisible

public void setCloseLinkVisible(boolean visible)

removeCloseLink

public void removeCloseLink()

addCloseLinkClickHandler

public com.google.gwt.event.shared.HandlerRegistration addCloseLinkClickHandler(com.google.gwt.event.dom.client.ClickHandler clickHandler)

setNonCaptionHeader

public void setNonCaptionHeader(com.google.gwt.user.client.ui.Widget widget)
Sets the header that will be displayed at the top of the lightbox.
Please note: This header will not be displayed in the caption, but in the actual lightbox content area.

Parameters:
widget - The header widget.

setText

public void setText(String text)
Specified by:
setText in interface com.google.gwt.user.client.ui.HasText
Overrides:
setText in class com.google.gwt.user.client.ui.DialogBox

clearButtons

public void clearButtons()
Removes all the buttons at the bottom of the lightbox.


addButton

public void addButton(com.google.gwt.user.client.ui.Widget button)
Adds a button to the bottom of the lightbox.


addButtonGroup

public void addButtonGroup(ButtonGroup group)
Adds a ButtonGroup to the button panel at the bottom of the lightbox.

Parameters:
group -

addButtonGroup

public void addButtonGroup(ButtonGroup group)
Adds a ButtonGroup to the button panel at the bottom of the lightbox.

Parameters:
group -

showButtons

public void showButtons(boolean show)

setMaxWidth

public void setMaxWidth(int width)
Set the maximum width in pixels that this dialog will grow to.
Please note: If the lightbox's size was set explicitly, this call will have no effect.

Parameters:
width - The dialog's maximum width in pixels.

setMaxHeight

public void setMaxHeight(int height)
Set the maximum height in pixels that this dialog will grow to.
Please note: If the lightbox's size was set explicitly, this call will have no effect.

Parameters:
height - The dialog's maximum height in pixels.

setSize

public void setSize(int width,
                    int height)
Set the width and height of the lightbox in pixels.
Please note: These values will not be affected by resizing. Thus the lightbox will remain the specified size, irrespective of resizing.

Parameters:
width - The specified width in pixels.
height - The specified height in pixels.

setSize

public void setSize(KSLightBox.Size size)
Set the width and height of the lightbox in pixels using the KSLightBox.Size enum.

Parameters:
size - A predefined dialog size.

setWidget

public void setWidget(com.google.gwt.user.client.ui.Widget content)
Specified by:
setWidget in interface com.google.gwt.user.client.ui.HasOneWidget
Overrides:
setWidget in class com.google.gwt.user.client.ui.DecoratedPopupPanel

getWidget

public com.google.gwt.user.client.ui.Widget getWidget()
Specified by:
getWidget in interface com.google.gwt.user.client.ui.HasOneWidget
Overrides:
getWidget in class com.google.gwt.user.client.ui.DecoratedPopupPanel

hide

public void hide()
Overrides:
hide in class com.google.gwt.user.client.ui.DialogBox

show

public void show()
Overrides:
show in class com.google.gwt.user.client.ui.DialogBox

onPreviewNativeEvent

protected void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent preview)
Overrides:
onPreviewNativeEvent in class com.google.gwt.user.client.ui.DialogBox

uninstallResizeHandler

public void uninstallResizeHandler()

installResizeHandler

public void installResizeHandler()


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.