com.guiseframework.component
Class ResourceCollectControl

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.model.ui.AbstractPresentationModel
              extended by com.guiseframework.component.AbstractComponent
                  extended by com.guiseframework.component.AbstractControl
                      extended by com.guiseframework.component.ResourceCollectControl
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Component, Control, InputFocusableComponent, Displayable, Enableable, InfoModel, LabelModel, Model, PresentationModel, DepictedObject

public class ResourceCollectControl
extends AbstractControl

Control that allows resources to be collected and received at a given path. The destination path should reference a registered ResourceWriteDestination of the application.

Author:
Garret Wilson

Nested Class Summary
static interface ResourceCollectControl.Depictor<C extends ResourceCollectControl>
          The custom depictor type for web collect controls.
 
Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component>
 
Nested classes/interfaces inherited from interface com.guiseframework.component.Control
Control.Status
 
Nested classes/interfaces inherited from interface com.guiseframework.component.Component
Component.FlyoverStrategy<S extends Component>
 
Field Summary
static java.lang.String RESOURCE_PATHS_PROPERTY
          The bound property of the paths of the collected resources.
static java.lang.String STATE_PROPERTY
          The bound property of the state of receiving collected resources.
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Fields inherited from interface com.guiseframework.component.Control
STATUS_PROPERTY
 
Fields inherited from interface com.guiseframework.component.Component
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY
 
Fields inherited from interface com.guiseframework.model.ui.PresentationModel
BACKGROUND_COLOR_PROPERTY, BORDER_LINE_FAR_COLOR_PROPERTY, BORDER_LINE_FAR_EXTENT_PROPERTY, BORDER_LINE_FAR_STYLE_PROPERTY, BORDER_LINE_NEAR_COLOR_PROPERTY, BORDER_LINE_NEAR_EXTENT_PROPERTY, BORDER_LINE_NEAR_STYLE_PROPERTY, BORDER_PAGE_FAR_COLOR_PROPERTY, BORDER_PAGE_FAR_EXTENT_PROPERTY, BORDER_PAGE_FAR_STYLE_PROPERTY, BORDER_PAGE_NEAR_COLOR_PROPERTY, BORDER_PAGE_NEAR_EXTENT_PROPERTY, BORDER_PAGE_NEAR_STYLE_PROPERTY, CORNER_LINE_FAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_FAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CURSOR_PROPERTY, FONT_FAMILIES_PROPERTY, FONT_SIZE_PROPERTY, FONT_STYLE_PROPERTY, FONT_WEIGHT_BOLD, FONT_WEIGHT_NORMAL, FONT_WEIGHT_PROPERTY, LABEL_FONT_FAMILIES_PROPERTY, LABEL_FONT_SIZE_PROPERTY, LABEL_FONT_STYLE_PROPERTY, LABEL_FONT_WEIGHT_PROPERTY, LABEL_TEXT_COLOR_PROPERTY, LINE_EXTENT_PROPERTY, MARGIN_LINE_FAR_EXTENT_PROPERTY, MARGIN_LINE_NEAR_EXTENT_PROPERTY, MARGIN_PAGE_FAR_EXTENT_PROPERTY, MARGIN_PAGE_NEAR_EXTENT_PROPERTY, OPACITY_PROPERTY, PADDING_LINE_FAR_EXTENT_PROPERTY, PADDING_LINE_NEAR_EXTENT_PROPERTY, PADDING_PAGE_FAR_EXTENT_PROPERTY, PADDING_PAGE_NEAR_EXTENT_PROPERTY, PAGE_EXTENT_PROPERTY, ROUNDED_CORNER_ARC_SIZE, STYLE_ID_PROPERTY, TEXT_COLOR_PROPERTY, TOOLTIP_ENABLED_PROPERTY, VISIBLE_PROPERTY
 
Fields inherited from interface com.guiseframework.model.Displayable
DISPLAYED_PROPERTY
 
Fields inherited from interface com.guiseframework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
 
Fields inherited from interface com.guiseframework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
 
Fields inherited from interface com.guiseframework.model.Model
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE
 
Fields inherited from interface com.guiseframework.model.Enableable
ENABLED_PROPERTY
 
Constructor Summary
ResourceCollectControl()
          Default constructor with a default models.
ResourceCollectControl(InfoModel infoModel, Enableable enableable)
          Info model and enableable object constructor.
 
Method Summary
 void addProgressListener(ProgressListener progressListener)
          Adds a progress listener.
 void addResourcePath(java.lang.String resourcePath)
          Adds a new resource path.
 void cancelReceive()
          Cancels any currently occurring resource transfers.
 void clearResourcePaths()
          Clears all resource paths.
protected  void fireProgressed(ProgressEvent progressEvent)
          Fires a given progress event to all registered progress listeners.
 void fireProgressed(java.lang.String task, com.globalmentor.model.TaskState taskState, long value, long maximumValue)
          Fires a progress event to all registered progress listeners.
 ResourceCollectControl.Depictor<? extends ResourceCollectControl> getDepictor()
           
 Bookmark getDestinationBookmark()
           
 java.lang.String getDestinationPath()
          Indicates the destination path relative to the application context path.
 java.util.List<java.lang.String> getResourcePaths()
          Returns the paths of the currently collected resources.
 com.globalmentor.model.TaskState getState()
           
 void receiveResources(java.lang.String destinationPath)
          Receives collected resources at the given destination path with no bookmark.
 void receiveResources(java.lang.String destinationPath, Bookmark destinationBookmark)
          Receives collected resources at the given destination path using the given bookmark.
 void removeProgressListener(ProgressListener progressListener)
          Removes an progress listener.
 void removeResourcePath(java.lang.String resourcePath)
          Removes a resource path.
 void setState(com.globalmentor.model.TaskState newSendState)
          Sets the state of receiving resources.
 
Methods inherited from class com.guiseframework.component.AbstractControl
determineStatus, getEnableable, getStatus, isEnabled, reset, setEnabled, setNotification, setStatus, updateStatus, updateValid
 
Methods inherited from class com.guiseframework.component.AbstractComponent
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, depict, determineValid, dispatchInputEvent, equals, exportTransfer, fireInputEvent, fireNotified, fireNotified, getAncestor, getCommandListeners, getComponentByID, getComponentByName, getComponentOrientation, getConstraints, getDepictID, getDescription, getDescriptionContentType, getDirtyComponents, getDirtyComponents, getEventListenerManager, getFlyoverStrategy, getGlyphURI, getInfo, getInfoContentType, getInfoModel, getInputStrategy, getKeyListeners, getLabel, getLabelContentType, getMouseListeners, getName, getNotification, getNotifications, getNotifications, getOrientation, getParent, getPreferenceProperties, getRootComponent, getTheme, hasAncestor, hasCommandListeners, hashCode, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, loadPreferences, notify, processEvent, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, resetTheme, savePreferences, setConstraints, setDepicted, setDescription, setDescriptionContentType, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setGlyphURI, setInfo, setInfoContentType, setInputStrategy, setLabel, setLabelContentType, setName, setOrientation, setParent, setThemeApplied, setValid, toString, update, updateTheme, validate
 
Methods inherited from class com.guiseframework.model.ui.AbstractPresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
 
Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject
getSession
 
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.guiseframework.component.Component
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, dispatchInputEvent, exportTransfer, fireInputEvent, getAncestor, getComponentOrientation, getConstraints, getFlyoverStrategy, getInputStrategy, getName, getNotification, getOrientation, getParent, getPreferenceProperties, getTheme, hasCommandListeners, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, loadPreferences, notify, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, resetTheme, savePreferences, setConstraints, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setInputStrategy, setName, setOrientation, setParent, setThemeApplied, updateTheme, validate
 
Methods inherited from interface com.guiseframework.platform.DepictedObject
depict, getDepictID, getSession, processEvent
 
Methods inherited from interface com.guiseframework.model.ui.PresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getSession, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
 
Methods inherited from interface com.guiseframework.model.InfoModel
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType
 
Methods inherited from interface com.guiseframework.model.LabelModel
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType
 
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface com.globalmentor.beans.PropertyConstrainable
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
 

Field Detail

RESOURCE_PATHS_PROPERTY

public static final java.lang.String RESOURCE_PATHS_PROPERTY
The bound property of the paths of the collected resources.


STATE_PROPERTY

public static final java.lang.String STATE_PROPERTY
The bound property of the state of receiving collected resources.

Constructor Detail

ResourceCollectControl

public ResourceCollectControl()
Default constructor with a default models.


ResourceCollectControl

public ResourceCollectControl(InfoModel infoModel,
                              Enableable enableable)
Info model and enableable object constructor.

Parameters:
infoModel - The component info model.
enableable - The enableable object in which to store enabled status.
Throws:
java.lang.NullPointerException - if the given info model and/or enableable object is null.
Method Detail

getDepictor

public ResourceCollectControl.Depictor<? extends ResourceCollectControl> getDepictor()
Specified by:
getDepictor in interface Component
Specified by:
getDepictor in interface DepictedObject
Overrides:
getDepictor in class AbstractComponent
Returns:
The depictor for this object.

getState

public com.globalmentor.model.TaskState getState()
Returns:
The state of receiving resources, or null if receiving has not been initiated.

setState

public void setState(com.globalmentor.model.TaskState newSendState)
Sets the state of receiving resources. This method is called by the associated depictor and should normally not be called directly by applications. This is a bound property.

Parameters:
newSendState - The new state of receiving resources, or null if receiving has not been initiated.
See Also:
STATE_PROPERTY

getResourcePaths

public java.util.List<java.lang.String> getResourcePaths()
Returns the paths of the currently collected resources. These paths are for identification only, and are not guaranteed to represent any location accessible from the application.

Returns:
The the paths of the currently collected resources.

addResourcePath

public void addResourcePath(java.lang.String resourcePath)
Adds a new resource path. This method changes a bound property of type List holding type String. This method is called by the framework and normally this should not be called directly from applications. Manually adding a new resource path, depending on the platform, may not actually result in another resource being collected absent user intervention.

Parameters:
resourcePath - The resource path to add.
Throws:
java.lang.NullPointerException - if the given resource path is null.
See Also:
RESOURCE_PATHS_PROPERTY

removeResourcePath

public void removeResourcePath(java.lang.String resourcePath)
Removes a resource path. This method changes a bound property of type List holding type String. This method is called by the framework and normally this should not be called directly from applications. //TODO fix to actually tell the browser control that the path has changed Manually adding a new resource path, depending on the platform, may not actually result in another resource being collected absent user intervention.

Parameters:
resourcePath - The resource path to remove.
Throws:
java.lang.NullPointerException - if the given resource path is null.
See Also:
RESOURCE_PATHS_PROPERTY

clearResourcePaths

public void clearResourcePaths()
Clears all resource paths. This method changes a bound property of type List holding type String. This method is called by the framework and normally this should not be called directly from applications. //TODO fix to actually tell the browser control that the path has changed Manually adding a new resource path, depending on the platform, may not actually result in another resource being collected absent user intervention.

See Also:
RESOURCE_PATHS_PROPERTY

getDestinationPath

public java.lang.String getDestinationPath()
Indicates the destination path relative to the application context path.

Returns:
The path representing the destination of the collected resources, or null if no resources are currently being sent.

getDestinationBookmark

public Bookmark getDestinationBookmark()
Returns:
The bookmark being used in receiving the resources at the destination path, or null if there is no bookmark specified and/or no resources are currently being sent.

receiveResources

public void receiveResources(java.lang.String destinationPath)
Receives collected resources at the given destination path with no bookmark.

Parameters:
destinationPath - The path representing the destination of the collected resources, relative to the application.
Throws:
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority.

receiveResources

public void receiveResources(java.lang.String destinationPath,
                             Bookmark destinationBookmark)
Receives collected resources at the given destination path using the given bookmark. If the resources are currently started to be received or already being received, no action occurs.

Parameters:
destinationPath - The path representing the destination of the collected resources, relative to the application.
destinationBookmark - The bookmark to be used in receiving the resources at the destination path, or null if no bookmark should be used.
Throws:
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority.
java.lang.IllegalArgumentException - if the provided path is absolute.

cancelReceive

public void cancelReceive()
Cancels any currently occurring resource transfers. If the resources are not currently being transferred, no action occurs.


addProgressListener

public void addProgressListener(ProgressListener progressListener)
Adds a progress listener.

Parameters:
progressListener - The progress listener to add.

removeProgressListener

public void removeProgressListener(ProgressListener progressListener)
Removes an progress listener.

Parameters:
progressListener - The progress listener to remove.

fireProgressed

public void fireProgressed(java.lang.String task,
                           com.globalmentor.model.TaskState taskState,
                           long value,
                           long maximumValue)
Fires a progress event to all registered progress listeners. This method delegates to #fireProgessed(ProgressEvent).

Parameters:
task - The task being performed, or null if not indicated.
taskState - The state of the task.
value - The current progress, or -1 if not known.
maximumValue - The goal, or -1 if not known.
Throws:
java.lang.NullPointerException - if the given task state is null.
See Also:
ProgressListener, ProgressEvent

fireProgressed

protected void fireProgressed(ProgressEvent progressEvent)
Fires a given progress event to all registered progress listeners.

Parameters:
progressEvent - The progress event to fire.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.