com.sage.swt.client.widget
Class SwtThumbnailDock

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.Composite
              extended by com.sage.swt.client.widget.AbstractSwtWidget
                  extended by com.sage.swt.client.widget.SwtThumbnailDock
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.HasMouseWheelHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget, HasPropertyChangeHandlers, PropertyBag, InitialPortalDataLoadHandler, PortletsAndCategoriesDataErrorHandler, PortletsAndCategoriesDataReadyHandler, PortletLinkClickHandler, SwtEventSource, HasAfterWidgetKeyChangedHandlers, HasBeforeWidgetKeyChangedHandlers, HasPortletLinkClickHandlers, HasPreserveAddHandlers, HasPreserveDeleteHandlers, HasPreserveReorderHandlers, SwtWidget

public class SwtThumbnailDock
extends AbstractSwtWidget
implements HasPortletLinkClickHandlers, InitialPortalDataLoadHandler, SwtEventSource, PortletsAndCategoriesDataReadyHandler, PortletsAndCategoriesDataErrorHandler, HasPreserveAddHandlers, HasPreserveDeleteHandlers, HasPreserveReorderHandlers, PortletLinkClickHandler

The SwtThumbnailDock is primarily meant to be used in Portal applications, for providing quick access to a users most frequently accessed task portlets (their favorites or shortcuts).When a particular Thumbnail is clicked, then that task portlet will be opened in the workspace area of the Portal


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
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SwtThumbnailDock()
          Default constructor for the SwtThumbnailDock.
SwtThumbnailDock(WidgetKey widgetKey, SwtErrorStack errorStack)
          Constructor for the SwtThumbnailDock.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addPortletLinkClickHandler(PortletLinkClickHandler handler)
          Adds a PortletLinkClickEvent handler.
 com.google.gwt.event.shared.HandlerRegistration addPreserveAddHandler(PreserveAddHandler handler)
          Adds a PreserveAddEvent handler.
 com.google.gwt.event.shared.HandlerRegistration addPreserveDeleteHandler(PreserveDeleteHandler handler)
          Adds a PreserveDeleteEvent handler.
 com.google.gwt.event.shared.HandlerRegistration addPreserveReorderHandler(PreserveReorderHandler handler)
          Adds a PreserveReorderEvent handler.
static WidgetCategory getDesignerCategory()
          Gets the widget's category in the designer.
static ImageBundleMgr.BundledImage getDesignerImage()
          Get the image ENUM that will be used to render a graphic for this widget in the Widget List in UI Designer
static java.lang.String getDesignerTooltip()
          Gets the widget's tooltip in the designer.
static java.lang.String getDesignerTypeName()
          Gets the widget's type name as displayed in the designer.
 SwtEvent getEvent(java.lang.String eventName)
          Returns the event that matches the given event name.
 java.util.Map<java.lang.String,SwtEvent> getEvents()
          Returns a map of events that this widget supports.
 java.util.Collection<Property> getProperties()
          Gets the collection of properties contained in this bag.
protected  com.google.gwt.user.client.ui.Widget getWidget()
          Gets the topmost underlying widget that is being wrapped by this SWT widget.
static SwtWidgetCreator getWidgetCreator()
          Returns the widget creator for this widget.
 void onInitialPortalDataLoaded(InitialPortalDataLoadEvent event)
          Fired when initial portal-related data has been loaded.
 void onPortletLinkClicked(PortletLinkClickEvent event)
          Fired when a link to a portlet has been clicked.
 void onPortletsAndCategoriesDataError(PortletsAndCategoriesDataErrorEvent event)
          Notifies that there was an error when downloading the portlets or categories data.
 void onPortletsAndCategoriesDataReady(PortletsAndCategoriesDataReadyEvent event)
          Fired when the portlets and categories data are ready.
 void resizeScrollPanel()
          Resizes the width of the scroll Panel according to the size of the browser.
 void setCompanyID(java.lang.String companyID)
          Sets the company ID of the company whose shortcuts should be shown in the thumbnail dock.
protected  void setElementID()
          Set Element ID for this widget.
 void setInstanceContext(InstanceContext context)
          Sets the instance context where this widget resides.
 void setPropertyValue(Property property, java.lang.Object newValue)
          Sets the value of a property.
 void setTextCustomize(java.lang.String text)
          Set the caption of the Customize button.
 void setTextShortcuts(java.lang.String text)
          Set the caption of the Shortcuts label.
 void setTransTextCustomize(TransText transText)
          Set the caption of the Customize button.
 void setTransTextShortcuts(TransText transText)
          Set the caption of the Shortcuts label.
protected  void setupPropertyDefaultValues()
          Stores the current value of the widget properties as the default values.
 void setUserID(java.lang.String userID)
          Sets the user ID of the user whose shortcuts should be shown in the thumbnail dock.
 void setWidgetMinWidth(java.lang.String width)
          Sets the SwtThumbnailDock required minimum width.
 void setWidth(int width)
          Sets the width of the widget.
 
Methods inherited from class com.sage.swt.client.widget.AbstractSwtWidget
addAfterWidgetKeyChangedHandler, addBeforeWidgetKeyChangedHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addPropertyChangeHandler, changeAlignmentInParent, forceBrowserRepaint, getDatasourceID, getDefaultProperties, getErrorStack, getHelpID, getHorizontalAlignmentInParent, getInstanceContext, getPreferenceBinding, getPreferenceStoreID, getPropertyDefaultValue, getPropertyValue, getSymbolID, getTitle, getVerticalAlignmentInParent, getWidgetHelper, getWidgetKey, isEnabled, isVisible, setClientProperty, setDatasourceID, setDefaultPropertyValue, setEnabled, setHelpID, setHorizontalAlignmentInParent, setPreferenceBinding, setPreferenceStoreID, setPropertyDefaultValue, setSymbolID, setTitle, setupAlignmentInParentProperties, setupDefaultAlignmentInParentProperties, setupDefaultHeightProperty, setupDefaultWidthProperty, setVerticalAlignmentInParent, setVisible, setWidgetKey
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setWidth, 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

SwtThumbnailDock

public SwtThumbnailDock()
Default constructor for the SwtThumbnailDock.


SwtThumbnailDock

public SwtThumbnailDock(WidgetKey widgetKey,
                        SwtErrorStack errorStack)
Constructor for the SwtThumbnailDock.

Parameters:
widgetKey - The Key of the Widget.
errorStack - The ErrorStack of the widget.
Method Detail

setWidgetMinWidth

public void setWidgetMinWidth(java.lang.String width)
Sets the SwtThumbnailDock required minimum width.

Parameters:
width - The minimum width to set in the widget.

resizeScrollPanel

public void resizeScrollPanel()
Resizes the width of the scroll Panel according to the size of the browser.


getDesignerTypeName

public static java.lang.String getDesignerTypeName()
Gets the widget's type name as displayed in the designer. (For example, a "SpecialButton" class might have "Special Button" as the type name displayed in the designer.)

Returns:
The widget's displayed type name.

getDesignerTooltip

public static java.lang.String getDesignerTooltip()
Gets the widget's tooltip in the designer. (For example, a "SpecialButton" class might have a tooltip of "Button that does something special".)

Returns:
The widget's designer tooltip.

getDesignerImage

public static ImageBundleMgr.BundledImage getDesignerImage()
Get the image ENUM that will be used to render a graphic for this widget in the Widget List in UI Designer

Returns:
The image ENUM

getDesignerCategory

public static WidgetCategory getDesignerCategory()
Gets the widget's category in the designer. The widget's are grouped in widget area with respect to category.

Returns:
The category of the widget.

getWidgetCreator

public static SwtWidgetCreator getWidgetCreator()
Returns the widget creator for this widget.

Returns:
The widget creator for this widget.

addPortletLinkClickHandler

public com.google.gwt.event.shared.HandlerRegistration addPortletLinkClickHandler(PortletLinkClickHandler handler)
Adds a PortletLinkClickEvent handler.

Specified by:
addPortletLinkClickHandler in interface HasPortletLinkClickHandlers
Parameters:
handler - the handler
Returns:
the handler registration

getWidget

protected com.google.gwt.user.client.ui.Widget getWidget()
Gets the topmost underlying widget that is being wrapped by this SWT widget.

Specified by:
getWidget in class AbstractSwtWidget
Returns:
The topmost underlying widget that is being wrapped by this SWT widget.

setTransTextShortcuts

public void setTransTextShortcuts(TransText transText)
Set the caption of the Shortcuts label.

Parameters:
transText - caption text

setTransTextCustomize

public void setTransTextCustomize(TransText transText)
Set the caption of the Customize button.

Parameters:
transText - caption text

setTextShortcuts

public void setTextShortcuts(java.lang.String text)
Set the caption of the Shortcuts label.

Parameters:
text - caption text

setTextCustomize

public void setTextCustomize(java.lang.String text)
Set the caption of the Customize button.

Parameters:
text - caption string

setPropertyValue

public void setPropertyValue(Property property,
                             java.lang.Object newValue)
Sets the value of a property.

Specified by:
setPropertyValue in interface PropertyBag
Parameters:
property - The property in question.
newValue - The new value of the property.

getProperties

public java.util.Collection<Property> getProperties()
Gets the collection of properties contained in this bag.

Specified by:
getProperties in interface PropertyBag
Overrides:
getProperties in class AbstractSwtWidget
Returns:
The collection of properties contained in this bag. Implementors should make sure that this collection is unmodifiable.

setupPropertyDefaultValues

protected void setupPropertyDefaultValues()
Stores the current value of the widget properties as the default values. This information is then used when saving the declarative layout to determine whether or not the user has changed the value of that property to something other than the default (if they haven't - then the property is not saved). If there is no default value for a property - and the user changes it to a non-null, non-blank value, then the property will be saved.

The "default value" concept is only applicable for those properties that have an initial (i.e. non-null, non-blank) value. This value can be set automatically by the DOM or by code within the widget.

Properties that are not set to an initial value by the DOM or GWT or the widget programmer, do not belong in this function.

For example: when a widget is first created in the DOM - it has an intrinsic value for the Enabled property (true). Therefore, the Enabled property has a default value of true. The Title property on the other hand does not have an initial value in the DOM - so it does not have a default value, and should not be included in this method.

Note: This function should be called immediately after your widget has been created and its initial properties have been set. Only properties that are not set by parameters in your widget's constructor should be specified here (i.e. optional properties).

Overrides:
setupPropertyDefaultValues in class AbstractSwtWidget

getEvent

public SwtEvent getEvent(java.lang.String eventName)
Returns the event that matches the given event name.

Specified by:
getEvent in interface SwtEventSource
Parameters:
eventName - The name of the event.
Returns:
The SwtEvent for the given name.

getEvents

public java.util.Map<java.lang.String,SwtEvent> getEvents()
Returns a map of events that this widget supports.

Specified by:
getEvents in interface SwtEventSource
Returns:
Map of events that this widget supports.

setElementID

protected void setElementID()
Set Element ID for this widget.

Overrides:
setElementID in class AbstractSwtWidget

setWidth

public void setWidth(int width)
Sets the width of the widget.

Parameters:
width - width of the widget

onInitialPortalDataLoaded

public void onInitialPortalDataLoaded(InitialPortalDataLoadEvent event)
Fired when initial portal-related data has been loaded.

Specified by:
onInitialPortalDataLoaded in interface InitialPortalDataLoadHandler
Parameters:
event - A InitialPortalDataLoadEvent object which contains the initial data to be shared by various portal-related widgets and contains the portal-related datasources those widgets can use to load further data that's specific to each widget.

setInstanceContext

public void setInstanceContext(InstanceContext context)
Sets the instance context where this widget resides.

Specified by:
setInstanceContext in interface SwtWidget
Overrides:
setInstanceContext in class AbstractSwtWidget
Parameters:
context - The instance context where the widget will reside.

setUserID

public void setUserID(java.lang.String userID)
Sets the user ID of the user whose shortcuts should be shown in the thumbnail dock.

Parameters:
userID - The user ID of the user whose shortcuts should be shown in the thumbnail dock.

setCompanyID

public void setCompanyID(java.lang.String companyID)
Sets the company ID of the company whose shortcuts should be shown in the thumbnail dock.

Parameters:
companyID - The company ID of the company whose shortcuts should be shown in the thumbnail dock.

addPreserveAddHandler

public com.google.gwt.event.shared.HandlerRegistration addPreserveAddHandler(PreserveAddHandler handler)
Adds a PreserveAddEvent handler.

Specified by:
addPreserveAddHandler in interface HasPreserveAddHandlers
Parameters:
handler - the handler
Returns:
the handler registration

addPreserveDeleteHandler

public com.google.gwt.event.shared.HandlerRegistration addPreserveDeleteHandler(PreserveDeleteHandler handler)
Adds a PreserveDeleteEvent handler.

Specified by:
addPreserveDeleteHandler in interface HasPreserveDeleteHandlers
Parameters:
handler - the handler
Returns:
the handler registration

addPreserveReorderHandler

public com.google.gwt.event.shared.HandlerRegistration addPreserveReorderHandler(PreserveReorderHandler handler)
Adds a PreserveReorderEvent handler.

Specified by:
addPreserveReorderHandler in interface HasPreserveReorderHandlers
Parameters:
handler - the handler
Returns:
the handler registration

onPortletsAndCategoriesDataReady

public void onPortletsAndCategoriesDataReady(PortletsAndCategoriesDataReadyEvent event)
Fired when the portlets and categories data are ready.

Specified by:
onPortletsAndCategoriesDataReady in interface PortletsAndCategoriesDataReadyHandler
Parameters:
event - the event

onPortletsAndCategoriesDataError

public void onPortletsAndCategoriesDataError(PortletsAndCategoriesDataErrorEvent event)
Notifies that there was an error when downloading the portlets or categories data.

Specified by:
onPortletsAndCategoriesDataError in interface PortletsAndCategoriesDataErrorHandler
Parameters:
event - the event

onPortletLinkClicked

public void onPortletLinkClicked(PortletLinkClickEvent event)
Description copied from interface: PortletLinkClickHandler
Fired when a link to a portlet has been clicked.

Specified by:
onPortletLinkClicked in interface PortletLinkClickHandler
Parameters:
event - the event


Copyright © 2011 Sage Software, Inc. All rights reserved.