001package csheets.ext.simple.ui;
002
003import javax.swing.*;
004
005import csheets.ext.Extension;
006import csheets.ui.ctrl.UIController;
007import csheets.ui.ext.*;
008
009/**
010 * This class implements the UI interface extension for the simple extension. A
011 * UI interface extension must extend the UIExtension abstract class.
012 * 
013 * @see UIExtension
014 * @author Alexandre Braganca
015 */
016public class UIExtensionExample extends UIExtension {
017
018    /** The icon to display with the extension's name */
019    private Icon icon;
020
021    /** The menu of the extension */
022    private ExampleMenu menu;
023
024    public UIExtensionExample(Extension extension, UIController uiController) {
025        super(extension, uiController);
026    }
027
028    /**
029     * Returns an icon to display with the extension's name.
030     * 
031     * @return an icon with style
032     */
033    @Override
034    public Icon getIcon() {
035        return null;
036    }
037
038    /**
039     * Returns an instance of a class that implements JMenu. In this simple case
040     * this class only supplies one menu option.
041     * 
042     * @see ExampleMenu
043     * @return a JMenu component
044     */
045    @Override
046    public JMenu getMenu() {
047        if (menu == null)
048            menu = new ExampleMenu(uiController);
049        return menu;
050    }
051
052    /**
053     * Returns a cell decorator that visualizes the data added by the extension.
054     * 
055     * @return a cell decorator, or null if the extension does not provide one
056     */
057    @Override
058    public CellDecorator getCellDecorator() {
059        return null;
060    }
061
062    /**
063     * Returns a table decorator that visualizes the data added by the
064     * extension.
065     * 
066     * @return a table decorator, or null if the extension does not provide one
067     */
068    @Override
069    public TableDecorator getTableDecorator() {
070        return null;
071    }
072
073    /**
074     * Returns a toolbar that gives access to extension-specific functionality.
075     * 
076     * @return a JToolBar component, or null if the extension does not provide
077     *         one
078     */
079    @Override
080    public JToolBar getToolBar() {
081        return null;
082    }
083
084    /**
085     * Returns a side bar that gives access to extension-specific functionality.
086     * 
087     * @return a component, or null if the extension does not provide one
088     */
089    @Override
090    public JComponent getSideBar() {
091        return null;
092    }
093}