001    /*
002     * Copyright (c) 2005 Peter Palotas, Fredrik Johansson, Einar Pehrson,
003     * Sebastian Kekkonen, Lars Magnus Lång, Malin Johansson and Sofia Nilsson
004     *
005     * This file is part of
006     * CleanSheets Extension for Assertions
007     *
008     * CleanSheets Extension for Assertions is free software; you can
009     * redistribute it and/or modify it under the terms of the GNU General Public
010     * License as published by the Free Software Foundation; either version 2 of
011     * the License, or (at your option) any later version.
012     *
013     * CleanSheets Extension for Assertions is distributed in the hope that
014     * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
015     * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016     * See the GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with CleanSheets Extension for Assertions; if not, write to the
020     * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
021     * Boston, MA  02111-1307  USA
022     */
023    package csheets.ext.assertion;
024    
025    import csheets.core.Cell;
026    import csheets.ext.Extension;
027    import csheets.ext.assertion.ui.AssertionUIExtension;
028    import csheets.ui.ctrl.UIController;
029    import csheets.ui.ext.UIExtension;
030    
031    /**
032     * The extension for assertions.
033     * @author Einar Pehrson
034     */
035    public class AssertionExtension extends Extension {
036    
037            /** The name of the extension */
038            public static final String NAME = "Assertions";
039    
040            /**
041             * Creates a new assertion extension.
042             */
043            public AssertionExtension() {
044                    super(NAME);
045            }
046    
047            /**
048             * Makes the given cell assertable.
049             * @param cell the cell to extend
050             * @return an assertable cell
051             */
052            public AssertableCell extend(Cell cell) {
053                    return new AssertableCell(cell);
054            }
055    
056            /**
057             * Returns a user interface extension for assertions.
058             * @param uiController the user interface controller
059             * @return a user interface extension for assertions
060             */
061            public UIExtension getUIExtension(UIController uiController) {
062                    return new AssertionUIExtension(this, uiController);
063            }
064    }