com.sas.swing.visuals.remotefileselector
Class BaseRemoteFileSelectorPanel

com.sas.swing.visuals.remotefileselector.BaseRemoteFileSelectorPanel
All Implemented Interfaces:
ActionProviderViewInterface, SwingActionProviderViewInterface, com.sas.collection.ContentsChangedListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
IFileServiceSelectorPanel, InformationServicesSelectorPanel, RemoteFileSearchPanel

public class BaseRemoteFileSelectorPanel
implements SwingActionProviderViewInterface, com.sas.collection.ContentsChangedListener

BaseRemoteFileCompositePanel defines the basic class that displays a UI/view of the files served by the model.

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

Examples for this class may be found on the Examples Site.

Since:
3.0
See Also:
Serialized Form

Field Summary
 RemoteFileButtonPanel buttonPanel
          Represents the panel where the toolbar is displayed.
protected static boolean cancelled
          Tracks the status of the dialog window.
protected  java.lang.String[] columnNames
          Specifies the column headers being displayed.
protected  RemoteFileComponentInterface component
          Represents the main display table component of the view.
static int DRILL_DOWN_FILTER
          Specifies the Action Provider Framework filter for the drilldown function.
protected  ActionSupportFilter drillDownFilter
          Action Provider Framework filter for the table data for opening folders actions.
 RemoteFileNamePanel filePanel
          Represents the panel where the file name and type are shown.
protected  java.util.LinkedHashMap fileTypes
           
static int FILTER_TYPE_FILTER
          Specifies the Action Provider Framework filter for the file type filter area.
protected  ActionSupportFilter filterTypeFilter
          Action Provider Framework filter for the file type combobox area.
protected  RemoteFileServerModelInterface model
          Specifies the model that is connected to the table display.
protected  RemoteFileServiceModelInterface serviceModel
          Specifies the model used to connect to the file system.
 RemoteFileShortcutPanel shortcutPanel
          Represents the panel where the shortcuts are displayed.
 java.lang.String supportType
          Denotes the Action Provider Framework support class being used.
static int TABLE_DATA_FILTER
          Specifies the Action Provider Framework filter for the table data area.
static int TABLE_HEADER_FILTER
          Specifies the Action Provider Framework filter for the table header area.
protected  ActionSupportFilter tableColumnHeaderFilter
          Action Provider Framework filter for the table column header area.
protected  ActionSupportFilter tableDataCellFilter
          Action Provider Framework filter for the table data area.
static int TOOLBAR_FILTER
          Specifies the Action Provider Framework filter for the toolbar area.
protected  ActionSupportFilter toolbarFilter
          Action Provider Framework filter for the toolbar area.
protected  com.sas.util.transforms.TransformInterface[] transforms
          Specifies the transforms used with the columns being displayed.
protected  SwingViewerSupport viewerSupport
          Action Provider Framework support class instance.
 RemoteFileComponentPanel viewPanel
          The panel where the main table is displayed;
 
Constructor Summary
BaseRemoteFileSelectorPanel()
          Creates a basic panel instance.
BaseRemoteFileSelectorPanel(boolean showDirectoriesOnly)
          Creates a panel instance with the showDirectoriesOnly attribute specified.
BaseRemoteFileSelectorPanel(java.lang.String initialPath, com.sas.util.transforms.TransformInterface[] transforms, java.lang.String[] columnNames, RemoteFileServiceModelInterface serviceModel, java.util.Map filterTypes, boolean showDirectoriesOnly, RemoteFileSearchPanel searchPanel)
          Creates a panel with all of the necessary information to show a file system structure.
 
Method Summary
 void contentsChanged(com.sas.collection.ContentsChangedEvent event)
          Listens for ContentsChangedEvent for path and view type.
 SwingActionProvider getActionProvider()
          Returns the ActionProvider object
 ActionSupportFilter getActionSupportFilter(int filter)
          Returns the appropriate filter object based on the desired area.
 java.lang.String getActionSupportType()
          Return the key that associated with a particular support class in the ActionProvider framework.
 java.util.List getReturnedInformation(boolean returnSelectedItems)
          Returns the currently selected files or directories.
 java.lang.Object getUniqueId()
          Returns the Viewer's uniqueId
 RemoteFileComponentInterface getViewComponent()
          Returns the component currently being used to view the file data.
 void initialize(java.lang.String initialPath, com.sas.util.transforms.TransformInterface[] transforms, java.lang.String[] columnNames, java.lang.Object[] columnRenderers, RemoteFileServiceModelInterface serviceModel, java.lang.String supportType, java.util.Map filterTypes, RemoteFileSearchPanel searchPanel)
          Creates a panel with all of the necessary information to show a file system structure and files.
 void initialize(java.lang.String initialPath, com.sas.util.transforms.TransformInterface[] transforms, java.lang.String[] columnNames, RemoteFileServiceModelInterface serviceModel, java.lang.String supportType, java.util.Map filterTypes, RemoteFileSearchPanel searchPanel)
          Creates a panel with all of the necessary information to show a file system structure and files.
 boolean isActionVisible(java.lang.String actionType, java.lang.String areaType)
          Returns a boolean indicating if the action type is visible everywhere in the specified areaType.
 boolean isCancelled()
          Sets the status of the panel to cancelled.
 boolean isShowDirectoriesOnly()
          Returns whether only directories/folders are to be shown in the view.
 java.util.Collection listActionTypes(java.lang.String areaType)
          Returns a Collection of String keys that define the valid actionTypes for the specified area of the action support class designated the actionSupportType attribute.
 java.util.Collection listAreaTypes()
          Returns a Collection of String keys that define the valid areaTypes for the action support class designated by the actionSupportType attribute.
 void setActionProvider(SwingActionProvider actionProvider)
          Sets the ActionProvider object
 void setActionSupportType(java.lang.String actionSupportType)
          Set the key that is associated with a particular support class in the ActionProvider framework.
 void setActionVisible(java.lang.String actionType, java.lang.String areaType, boolean visible)
          Sets the visible status of the specified actionType for the specified area.
 void setCancelled(boolean value)
          Sets the status of the panel to cancelled.
 void setColumnLabels(java.lang.String[] columnLabels)
          Sets the column labels in the table display.
 void setDialogType(int typeOfDialog)
          Specifies whether this dialog functions as a Save, Open, or OK window.
 void setServiceModel(RemoteFileServiceModelInterface serviceModel)
          Sets the file system service model to be used by the selector.
 void setShowButtonPanel(boolean show)
          Specifies whether the panel should show the toolbar and directory dropdown combobox.
 void setShowDirectoriesOnly(boolean showDirectoriesOnly)
          Specifies that the view should only show directory/folder items.
 void setShowFileNamePanel(boolean show)
          Specifies whether the panel should show the filename/filetype fields and the dialog window buttons.
 void setShowShortcutPanel(boolean show)
          Specifies whether the panel should show a shortcut panel.
 void setTransforms(com.sas.util.transforms.TransformInterface[] transforms)
          Sets the transforms used to read the data returned from the file system.
 void setUniqueId(java.lang.Object uniqueId)
          Returns the Viewer's uniqueId
static java.util.List showDialog(java.awt.Frame parent, java.lang.String titleOfDialog, boolean modal, int typeOfDialog, java.lang.String initialPath, com.sas.util.transforms.TransformInterface[] transforms, java.lang.String[] columnNames, RemoteFileServiceModelInterface serviceModel, boolean returnSelectedItems, boolean showDirectoriesOnly, RemoteFileSearchPanel searchPanel)
          Displays the default dialog window of the component.
 

Field Detail

fileTypes

protected java.util.LinkedHashMap fileTypes

TOOLBAR_FILTER

public static int TOOLBAR_FILTER
Specifies the Action Provider Framework filter for the toolbar area.


TABLE_DATA_FILTER

public static int TABLE_DATA_FILTER
Specifies the Action Provider Framework filter for the table data area.


TABLE_HEADER_FILTER

public static int TABLE_HEADER_FILTER
Specifies the Action Provider Framework filter for the table header area.


DRILL_DOWN_FILTER

public static int DRILL_DOWN_FILTER
Specifies the Action Provider Framework filter for the drilldown function.


FILTER_TYPE_FILTER

public static int FILTER_TYPE_FILTER
Specifies the Action Provider Framework filter for the file type filter area.


cancelled

protected static boolean cancelled
Tracks the status of the dialog window.


component

protected RemoteFileComponentInterface component
Represents the main display table component of the view.


filePanel

public RemoteFileNamePanel filePanel
Represents the panel where the file name and type are shown.


buttonPanel

public RemoteFileButtonPanel buttonPanel
Represents the panel where the toolbar is displayed.


shortcutPanel

public RemoteFileShortcutPanel shortcutPanel
Represents the panel where the shortcuts are displayed.


viewPanel

public RemoteFileComponentPanel viewPanel
The panel where the main table is displayed;


supportType

public java.lang.String supportType
Denotes the Action Provider Framework support class being used.


transforms

protected com.sas.util.transforms.TransformInterface[] transforms
Specifies the transforms used with the columns being displayed.


columnNames

protected java.lang.String[] columnNames
Specifies the column headers being displayed.


serviceModel

protected RemoteFileServiceModelInterface serviceModel
Specifies the model used to connect to the file system.


model

protected RemoteFileServerModelInterface model
Specifies the model that is connected to the table display.


tableDataCellFilter

protected ActionSupportFilter tableDataCellFilter
Action Provider Framework filter for the table data area.


tableColumnHeaderFilter

protected ActionSupportFilter tableColumnHeaderFilter
Action Provider Framework filter for the table column header area.


toolbarFilter

protected ActionSupportFilter toolbarFilter
Action Provider Framework filter for the toolbar area.


drillDownFilter

protected ActionSupportFilter drillDownFilter
Action Provider Framework filter for the table data for opening folders actions.


filterTypeFilter

protected ActionSupportFilter filterTypeFilter
Action Provider Framework filter for the file type combobox area.


viewerSupport

protected SwingViewerSupport viewerSupport
Action Provider Framework support class instance.

Constructor Detail

BaseRemoteFileSelectorPanel

public BaseRemoteFileSelectorPanel()
Creates a basic panel instance.


BaseRemoteFileSelectorPanel

public BaseRemoteFileSelectorPanel(boolean showDirectoriesOnly)
Creates a panel instance with the showDirectoriesOnly attribute specified.

Parameters:
showDirectoriesOnly -

BaseRemoteFileSelectorPanel

public BaseRemoteFileSelectorPanel(java.lang.String initialPath,
                                   com.sas.util.transforms.TransformInterface[] transforms,
                                   java.lang.String[] columnNames,
                                   RemoteFileServiceModelInterface serviceModel,
                                   java.util.Map filterTypes,
                                   boolean showDirectoriesOnly,
                                   RemoteFileSearchPanel searchPanel)
Creates a panel with all of the necessary information to show a file system structure.

Parameters:
initialPath - the initial file system path to be displayed
transforms - the transforms used to retrieve the column data
columnNames - the names used for the column headers
serviceModel - a model used to communicate to the file system
filterTypes - allows specification of a Map of display values and filter values for restricting the types of files being viewed
showDirectoriesOnly - specifies whether to show the directory structure only (true) or show the structure and the files (false)
searchPanel - allows specification of panel to be used for file system searching
Method Detail

showDialog

public static java.util.List showDialog(java.awt.Frame parent,
                                        java.lang.String titleOfDialog,
                                        boolean modal,
                                        int typeOfDialog,
                                        java.lang.String initialPath,
                                        com.sas.util.transforms.TransformInterface[] transforms,
                                        java.lang.String[] columnNames,
                                        RemoteFileServiceModelInterface serviceModel,
                                        boolean returnSelectedItems,
                                        boolean showDirectoriesOnly,
                                        RemoteFileSearchPanel searchPanel)
Displays the default dialog window of the component.

Parameters:
parent - the parent window of the dialog
titleOfDialog - the title of the dialog window
modal - specfies whether the dialog is to be modal
typeOfDialog - specifies whether this dialog functions as a Save, Open, or OK window. Specify OK = 0, Save = 1, Open = 2
initialPath - the initial file system path to be displayed
transforms - the transforms used to retrieve the column data
columnNames - the names used for the column headers
serviceModel - a model used to communicate to the file system
returnSelectedItems - determines whether to return information about the file selections when the window is closed
showDirectoriesOnly - specifies whether to show the directory structure only (true) or show the structure and the files (false)
searchPanel - allows specification of panel to be used for file system searching
Returns:
A list containing Strings representing the file selections made in the window

initialize

public void initialize(java.lang.String initialPath,
                       com.sas.util.transforms.TransformInterface[] transforms,
                       java.lang.String[] columnNames,
                       RemoteFileServiceModelInterface serviceModel,
                       java.lang.String supportType,
                       java.util.Map filterTypes,
                       RemoteFileSearchPanel searchPanel)
Creates a panel with all of the necessary information to show a file system structure and files.

Parameters:
initialPath - the initial file system path to be displayed
transforms - the transforms used to retrieve the column data
columnNames - the names used for the column headers
serviceModel - a model used to communicate to the file system
supportType - the name of the Action Provider Framework support class being used
filterTypes - allows specification of a Map of display values and filter values for restricting the types of files being viewed
searchPanel - allows specification of panel to be used for file system searching

initialize

public void initialize(java.lang.String initialPath,
                       com.sas.util.transforms.TransformInterface[] transforms,
                       java.lang.String[] columnNames,
                       java.lang.Object[] columnRenderers,
                       RemoteFileServiceModelInterface serviceModel,
                       java.lang.String supportType,
                       java.util.Map filterTypes,
                       RemoteFileSearchPanel searchPanel)
Creates a panel with all of the necessary information to show a file system structure and files.

Parameters:
initialPath - the initial file system path to be displayed
transforms - the transforms used to retrieve the column data
columnNames - the names used for the column headers
serviceModel - a model used to communicate to the file system
supportType - the name of the Action Provider Framework support class being used
filterTypes - allows specification of a Map of display values and filter values for restricting the types of files being viewed
searchPanel - allows specification of panel to be used for file system searching

setCancelled

public void setCancelled(boolean value)
Sets the status of the panel to cancelled.

Parameters:
value - set to true for cancelled state

isCancelled

public boolean isCancelled()
Sets the status of the panel to cancelled.

Parameters:
value - set to true for cancelled state

setShowDirectoriesOnly

public void setShowDirectoriesOnly(boolean showDirectoriesOnly)
Specifies that the view should only show directory/folder items. It will also treat them as being selectable for returning them to the calling frame.

Parameters:
showDirectoriesOnly - - if true, only the folders are shown
See Also:
isShowDirectoriesOnly()

isShowDirectoriesOnly

public boolean isShowDirectoriesOnly()
Returns whether only directories/folders are to be shown in the view.

Returns:
true if only folders will be shown
See Also:
setShowDirectoriesOnly(boolean)

setShowButtonPanel

public void setShowButtonPanel(boolean show)
Specifies whether the panel should show the toolbar and directory dropdown combobox.

Parameters:
show - - if true, then the toolbar and combobox are shown

setShowFileNamePanel

public void setShowFileNamePanel(boolean show)
Specifies whether the panel should show the filename/filetype fields and the dialog window buttons.

Parameters:
show - - if true, the filename/filetype and dialog window buttons are shown

setShowShortcutPanel

public void setShowShortcutPanel(boolean show)
Specifies whether the panel should show a shortcut panel.

Parameters:
show - - if true, the shortcut panel is shown

getViewComponent

public RemoteFileComponentInterface getViewComponent()
Returns the component currently being used to view the file data.

Returns:
the current view component

setDialogType

public void setDialogType(int typeOfDialog)
Specifies whether this dialog functions as a Save, Open, or OK window. Specify OK = 0, Save = 1, Open = 2

Parameters:
typeOfDialog - Specify OK = 0, Save = 1, Open = 2

getReturnedInformation

public java.util.List getReturnedInformation(boolean returnSelectedItems)
Returns the currently selected files or directories.

Parameters:
returnSelectedItems - specifies whether to return selected items
Returns:
the selected information a list of Strings containing the selected files and their file system paths

setServiceModel

public void setServiceModel(RemoteFileServiceModelInterface serviceModel)
Sets the file system service model to be used by the selector.

Parameters:
serviceModel - the model used to communicate to the file system

setTransforms

public void setTransforms(com.sas.util.transforms.TransformInterface[] transforms)
Sets the transforms used to read the data returned from the file system.

Parameters:
transforms - the array of transform classes

setColumnLabels

public void setColumnLabels(java.lang.String[] columnLabels)
Sets the column labels in the table display.

Parameters:
columnLabels - the array of column label strings

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
Listens for ContentsChangedEvent for path and view type. An event source of "path" will trigger a view refresh of the data. An event source of "viewType" will change the component view to the type selected (e.g. from a list to details).

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Parameters:
event - the event triggering this method

getActionSupportFilter

public ActionSupportFilter getActionSupportFilter(int filter)
Returns the appropriate filter object based on the desired area.

Parameters:
filter - the desired filter area
Returns:
the support filter class

setActionProvider

public void setActionProvider(SwingActionProvider actionProvider)
Sets the ActionProvider object

Specified by:
setActionProvider in interface SwingActionProviderViewInterface
Parameters:
ActionProvider - object
See Also:
SwingActionProviderViewInterface.getActionProvider()

getActionProvider

public SwingActionProvider getActionProvider()
Returns the ActionProvider object

Specified by:
getActionProvider in interface SwingActionProviderViewInterface
Returns:
ActionProvider object
See Also:
SwingActionProviderViewInterface.setActionProvider(com.sas.actionprovider.SwingActionProvider)

setActionVisible

public void setActionVisible(java.lang.String actionType,
                             java.lang.String areaType,
                             boolean visible)
Sets the visible status of the specified actionType for the specified area. The actionType must be non-null. The actionType and areaType must be valid in the support class that is associated with this classes current actionSupportType attribute.

Specified by:
setActionVisible in interface ActionProviderViewInterface
Parameters:
actionType - The key that identifies the type of action.
areaType - The area affected by the change in visibility fort the actionType. If null, then the method call applies to all the known areaTypes.
visible - The boolean indicating whether the actionType should be hidden or unhidden.
See Also:
ActionProviderViewInterface.isActionVisible(java.lang.String, java.lang.String), ActionProviderSupportTypes

isActionVisible

public boolean isActionVisible(java.lang.String actionType,
                               java.lang.String areaType)
Returns a boolean indicating if the action type is visible everywhere in the specified areaType. If the actionType is not visible anywhere anywhere in the areaType, then false is returned.

Specified by:
isActionVisible in interface ActionProviderViewInterface
Parameters:
actionType - The key that identifies the type of action as defined by the support class.
areaType - The key that identifies the type of area as defined by the support class.
Returns:
a boolean indicating if the action type is visible everywhere in the specified areaType.
See Also:
ActionProviderViewInterface.setActionVisible(java.lang.String, java.lang.String, boolean), ActionProviderSupportTypes

getUniqueId

public java.lang.Object getUniqueId()
Returns the Viewer's uniqueId

Specified by:
getUniqueId in interface ActionProviderViewInterface
Returns:
the Viewer's uniqueId
See Also:
ActionProviderViewInterface.setUniqueId(java.lang.Object)

setUniqueId

public void setUniqueId(java.lang.Object uniqueId)
Returns the Viewer's uniqueId

Specified by:
setUniqueId in interface ActionProviderViewInterface
See Also:
ActionProviderViewInterface.getUniqueId()

listAreaTypes

public java.util.Collection listAreaTypes()
Returns a Collection of String keys that define the valid areaTypes for the action support class designated by the actionSupportType attribute.

Specified by:
listAreaTypes in interface ActionProviderViewInterface
Returns:
a Collection of String keys that define the valid areaTypes for the specified support class.
See Also:
ActionProviderViewInterface.listActionTypes(java.lang.String), ActionProviderViewInterface.setActionSupportType(java.lang.String)

listActionTypes

public java.util.Collection listActionTypes(java.lang.String areaType)
Returns a Collection of String keys that define the valid actionTypes for the specified area of the action support class designated the actionSupportType attribute.

Specified by:
listActionTypes in interface ActionProviderViewInterface
Parameters:
areaType - The key associated with a defined areaType.
Returns:
a Collection of String keys that define the valid actionTypes for the specified area of the specified support class.
See Also:
ActionProviderViewInterface.listAreaTypes(), ActionProviderViewInterface.setActionSupportType(java.lang.String)

setActionSupportType

public void setActionSupportType(java.lang.String actionSupportType)
Set the key that is associated with a particular support class in the ActionProvider framework.

Specified by:
setActionSupportType in interface ActionProviderViewInterface
Parameters:
actionSupportType - The key that is associated with a particular support class.
See Also:
ActionProviderViewInterface.getActionSupportType(), ActionProviderSupportTypes

getActionSupportType

public java.lang.String getActionSupportType()
Return the key that associated with a particular support class in the ActionProvider framework.

Specified by:
getActionSupportType in interface ActionProviderViewInterface
Returns:
the key that associated with a particular support class.
See Also:
ActionProviderViewInterface.setActionSupportType(java.lang.String), ActionProviderSupportTypes



Copyright © 2009 SAS Institute Inc. All Rights Reserved.