com.usefullittlethings.saw.ui
Class CommandLineSearchUI

java.lang.Object
  |
  +--com.usefullittlethings.saw.ui.CommandLineSearchUI
All Implemented Interfaces:
SearchUIIfc, StartupUIIfc

public class CommandLineSearchUI
extends java.lang.Object
implements SearchUIIfc, StartupUIIfc

Basic implementation of the SearchUIIfc and StartupUIIfcM interfaces for use on a command-line. many features are not fully implemented such as show and dispose.

See Also:
SearchUIIfc, StartupUIIfc

Constructor Summary
CommandLineSearchUI()
           
 
Method Summary
 void addActionUI(int index, java.awt.Component c, java.lang.String title)
          Adds the action's ui to the user interface.
 void addFilterUI(int index, java.awt.Component c, java.lang.String title)
          Adds the filter's ui to the user interface.
 void disableForSearch()
          Tells the user interface to stop accepting user input for the duration of a search operation.
 void dispose()
          Disposes of this ui component, only to be used when application is exiting.
 void done(java.lang.String msg)
          Disposes of this ui component, only to be used when application is completely loaded and splash screen will no longer be used.
 void enableAfterSearch()
          Tells the user interface to start accepting user input at the completion of a search operation.
 void fatal(java.lang.String msg)
          Displays a fatal error for the user.
 java.io.File getOpenFromLocation()
          Displays an open dialog and returns the selection.
 java.io.File getSaveToLocation()
          Displays a save dialog and returns the selection.
 StartupUIIfc getStartupUI()
           
 void message(java.lang.String msg)
          Displays the specified message in the startup window/splash screen.
 void removeActionUI(java.awt.Component c)
          Removes the ui of the filter specified by the index from the user interface.
 void removeFilterUI(java.awt.Component c)
          Removes the ui of the filter specified by the index from the user interface.
 void setActionsModel(PluginCollection model)
          Used to set a reference to the actions model within the ui.
 void setActionSummary(java.lang.String summary)
          Sets a summary of the actions' configuration in the ui.
 void setAppTitle(java.lang.String title)
          Sets the application title to the specified value.
 void setController(AppControllerIfc controller)
          Registers the application-level controller with the user interface to receive application-level events, such as exit requests, etc.
 void setFiltersModel(PluginCollection model)
          Used to set a reference to the filters model within the ui.
 void setFilterSummary(java.lang.String summary)
          Sets a summary of the filters' configuration in the ui.
 void setSearchRootUI(SearchRootUIIfc root)
          Installs the "panel" responsible for handling selection of the root location for the search to be performed.
 void show()
          Displays the ui.
 boolean showConfirmInterrupt()
          Shows the user a confirmation prompt to determine if the currently executing search should be stopped.
 void showLoadError()
          Display an error for the user indicating that the load process failed.
 void showNoCommonSupportError()
          Displays the an error indicating that there is no single search pattern supported by both the search plug-in and the selected filter/action plug-ins.
 void showStatusMessage(java.lang.String message)
          Displays feedback to the user, such as in the status bar of a window.
 void updateUI()
          Updates the user interface to reflect any changes that may have occurred in the model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineSearchUI

public CommandLineSearchUI()
Method Detail

getStartupUI

public StartupUIIfc getStartupUI()
Specified by:
getStartupUI in interface SearchUIIfc

setController

public void setController(AppControllerIfc controller)
Description copied from interface: SearchUIIfc
Registers the application-level controller with the user interface to receive application-level events, such as exit requests, etc.

Specified by:
setController in interface SearchUIIfc

showNoCommonSupportError

public void showNoCommonSupportError()
Description copied from interface: SearchUIIfc
Displays the an error indicating that there is no single search pattern supported by both the search plug-in and the selected filter/action plug-ins.

Specified by:
showNoCommonSupportError in interface SearchUIIfc

showStatusMessage

public void showStatusMessage(java.lang.String message)
Description copied from interface: SearchUIIfc
Displays feedback to the user, such as in the status bar of a window.

Specified by:
showStatusMessage in interface SearchUIIfc

getSaveToLocation

public java.io.File getSaveToLocation()
Description copied from interface: SearchUIIfc
Displays a save dialog and returns the selection.

Specified by:
getSaveToLocation in interface SearchUIIfc

getOpenFromLocation

public java.io.File getOpenFromLocation()
Description copied from interface: SearchUIIfc
Displays an open dialog and returns the selection.

Specified by:
getOpenFromLocation in interface SearchUIIfc

showLoadError

public void showLoadError()
Description copied from interface: SearchUIIfc
Display an error for the user indicating that the load process failed.

Specified by:
showLoadError in interface SearchUIIfc

message

public void message(java.lang.String msg)
Description copied from interface: StartupUIIfc
Displays the specified message in the startup window/splash screen.

Specified by:
message in interface StartupUIIfc
Parameters:
msg - A text message to display for the user

fatal

public void fatal(java.lang.String msg)
Description copied from interface: StartupUIIfc
Displays a fatal error for the user. If there is a ui component running on the event dispatch thread, it will have to arrange to close itself, possibly by an OK button.

Specified by:
fatal in interface StartupUIIfc
Parameters:
msg - A text message describing the error condition that aborted the application's load process

done

public void done(java.lang.String msg)
Description copied from interface: StartupUIIfc
Disposes of this ui component, only to be used when application is completely loaded and splash screen will no longer be used.

Specified by:
done in interface StartupUIIfc

show

public void show()
Description copied from interface: SearchUIIfc
Displays the ui.

Specified by:
show in interface SearchUIIfc

dispose

public void dispose()
Description copied from interface: SearchUIIfc
Disposes of this ui component, only to be used when application is exiting.

Specified by:
dispose in interface SearchUIIfc

updateUI

public void updateUI()
Description copied from interface: SearchUIIfc
Updates the user interface to reflect any changes that may have occurred in the model.

Specified by:
updateUI in interface SearchUIIfc

setAppTitle

public void setAppTitle(java.lang.String title)
Description copied from interface: SearchUIIfc
Sets the application title to the specified value.

Specified by:
setAppTitle in interface SearchUIIfc

setSearchRootUI

public void setSearchRootUI(SearchRootUIIfc root)
Description copied from interface: SearchUIIfc
Installs the "panel" responsible for handling selection of the root location for the search to be performed.

Specified by:
setSearchRootUI in interface SearchUIIfc

disableForSearch

public void disableForSearch()
Description copied from interface: SearchUIIfc
Tells the user interface to stop accepting user input for the duration of a search operation.

Specified by:
disableForSearch in interface SearchUIIfc

enableAfterSearch

public void enableAfterSearch()
Description copied from interface: SearchUIIfc
Tells the user interface to start accepting user input at the completion of a search operation.

Specified by:
enableAfterSearch in interface SearchUIIfc

setFiltersModel

public void setFiltersModel(PluginCollection model)
Description copied from interface: SearchUIIfc
Used to set a reference to the filters model within the ui.

Specified by:
setFiltersModel in interface SearchUIIfc

setActionsModel

public void setActionsModel(PluginCollection model)
Description copied from interface: SearchUIIfc
Used to set a reference to the actions model within the ui.

Specified by:
setActionsModel in interface SearchUIIfc

setFilterSummary

public void setFilterSummary(java.lang.String summary)
Description copied from interface: SearchUIIfc
Sets a summary of the filters' configuration in the ui.

Specified by:
setFilterSummary in interface SearchUIIfc

setActionSummary

public void setActionSummary(java.lang.String summary)
Description copied from interface: SearchUIIfc
Sets a summary of the actions' configuration in the ui.

Specified by:
setActionSummary in interface SearchUIIfc

addFilterUI

public void addFilterUI(int index,
                        java.awt.Component c,
                        java.lang.String title)
Description copied from interface: SearchUIIfc
Adds the filter's ui to the user interface.

Specified by:
addFilterUI in interface SearchUIIfc

addActionUI

public void addActionUI(int index,
                        java.awt.Component c,
                        java.lang.String title)
Description copied from interface: SearchUIIfc
Adds the action's ui to the user interface.

Specified by:
addActionUI in interface SearchUIIfc

removeFilterUI

public void removeFilterUI(java.awt.Component c)
Description copied from interface: SearchUIIfc
Removes the ui of the filter specified by the index from the user interface.

Specified by:
removeFilterUI in interface SearchUIIfc

removeActionUI

public void removeActionUI(java.awt.Component c)
Description copied from interface: SearchUIIfc
Removes the ui of the filter specified by the index from the user interface.

Specified by:
removeActionUI in interface SearchUIIfc

showConfirmInterrupt

public boolean showConfirmInterrupt()
Description copied from interface: SearchUIIfc
Shows the user a confirmation prompt to determine if the currently executing search should be stopped.

Specified by:
showConfirmInterrupt in interface SearchUIIfc