adams.gui.tools.spreadsheetviewer
Class AbstractDataPlugin

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.gui.tools.spreadsheetviewer.AbstractDataPlugin
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, ShallowCopySupporter<AbstractDataPlugin>, SizeOfHandler, Serializable

public abstract class AbstractDataPlugin
extends AbstractOptionHandler
implements ShallowCopySupporter<AbstractDataPlugin>

Ancestor for "processing" plugins in the spreadsheet viewer.

Version:
$Revision: 6187 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractDataPlugin()
           
 
Method Summary
protected  String check(SpreadSheet sheet)
          Checks the spreadsheet.
protected abstract  SpreadSheet doProcess(SpreadSheet sheet)
          Performs the actual processing of the spreadsheet.
abstract  String getMenuIcon()
          Returns the file name of the icon.
abstract  String getMenuText()
          Returns the text of the menu item.
static String[] getPlugins()
          Returns a list with classnames of plugins.
abstract  boolean isInPlace()
          Returns whether the processed sheet should rather get placed ("in-place") in the same tab rather than in a new one.
 SpreadSheet process(SpreadSheet sheet)
          Processes the spreadsheet.
 AbstractDataPlugin shallowCopy()
          Returns a shallow copy of itself, i.e., based on the commandline options.
 AbstractDataPlugin shallowCopy(boolean expand)
          Returns a shallow copy of itself, i.e., based on the commandline options.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDataPlugin

public AbstractDataPlugin()
Method Detail

getMenuText

public abstract String getMenuText()
Returns the text of the menu item.

Returns:
the text

getMenuIcon

public abstract String getMenuIcon()
Returns the file name of the icon.

Returns:
the filename or null if no icon available

isInPlace

public abstract boolean isInPlace()
Returns whether the processed sheet should rather get placed ("in-place") in the same tab rather than in a new one.

Returns:
true if to replace current sheet with processed one

check

protected String check(SpreadSheet sheet)
Checks the spreadsheet.

Default implementation only checks whether data was provided.

Parameters:
sheet - the spreadsheet to check
Returns:
null if check passed, otherwise error message

doProcess

protected abstract SpreadSheet doProcess(SpreadSheet sheet)
Performs the actual processing of the spreadsheet.

Parameters:
sheet - the sheet to process
Returns:
the processed sheet

process

public SpreadSheet process(SpreadSheet sheet)
Processes the spreadsheet.

Parameters:
sheet - the sheet to process
Returns:
the processed sheet
Throws:
IllegalArgumentException - if the check failed
See Also:
check(SpreadSheet)

shallowCopy

public AbstractDataPlugin shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.

Specified by:
shallowCopy in interface ShallowCopySupporter<AbstractDataPlugin>
Returns:
the shallow copy

shallowCopy

public AbstractDataPlugin shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.

Specified by:
shallowCopy in interface ShallowCopySupporter<AbstractDataPlugin>
Parameters:
expand - whether to expand variables to their current values
Returns:
the shallow copy

getPlugins

public static String[] getPlugins()
Returns a list with classnames of plugins.

Returns:
the plugin classnames


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.