csheets.ext
Class Extension

java.lang.Object
  extended by csheets.ext.Extension
All Implemented Interfaces:
Comparable<Extension>
Direct Known Subclasses:
AssertionExtension, DependencyTreeExtension, StyleExtension, TestExtension

public abstract class Extension
extends Object
implements Comparable<Extension>

An interface for extensions to the CleanSheets application.

Author:
Einar Pehrson

Constructor Summary
Extension(String name)
          Creates a new extension.
 
Method Summary
 int compareTo(Extension extension)
          Compares this extension with the given extension for order.
 CellExtension extend(Cell cell)
          Returns an extension of the given cell.
 SpreadsheetExtension extend(Spreadsheet spreadsheet)
          Returns an extension of the given spreadsheet.
 String getName()
          Returns the name of the extension.
 String getPropertyKey()
          Returns the base key to use for properties of the UI extension.
 UIExtension getUIExtension(UIController uiController)
          Returns the user interface extension of this extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extension

public Extension(String name)
Creates a new extension.

Parameters:
name - the name of the extension
Method Detail

getName

public final String getName()
Returns the name of the extension.

Returns:
the name of the extension

getPropertyKey

public final String getPropertyKey()
Returns the base key to use for properties of the UI extension.

Returns:
the base key to use for properties of the UI extension

compareTo

public final int compareTo(Extension extension)
Compares this extension with the given extension for order. Ordering is done by the extensions' names.

Specified by:
compareTo in interface Comparable<Extension>
Parameters:
extension - the extension to compared to
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

extend

public SpreadsheetExtension extend(Spreadsheet spreadsheet)
Returns an extension of the given spreadsheet.

Parameters:
spreadsheet - the spreadsheet to extend
Returns:
a spreadsheet extension, or null if none is provided

extend

public CellExtension extend(Cell cell)
Returns an extension of the given cell.

Parameters:
cell - the cell to extend
Returns:
a cell extension, or null if none is provided

getUIExtension

public UIExtension getUIExtension(UIController uiController)
Returns the user interface extension of this extension.

Parameters:
uiController - the user interface controller
Returns:
a user interface extension, or null if none is provided