001package csheets.ext.share;
002
003import java.io.IOException;
004import java.util.logging.*;
005
006import csheets.ext.Extension;
007import csheets.ext.share.ui.UISharingExtension;
008import csheets.ui.ctrl.UIController;
009import csheets.ui.ext.UIExtension;
010
011/**
012 * An extension that will share cells throw network.
013 * 
014 * @see Extension
015 * @author Andre
016 * 
017 */
018public class SharingExtension extends Extension {
019
020        /** The name of the extension */
021        public static final String NAME = "Sharing";
022
023        /** The log file size = 1MB */
024        public static final int LOGGER_SIZE = 1024 * 1024;
025
026        /**
027         * Creates a new Sharing extension
028         */
029        public SharingExtension() {
030                super(NAME);
031                try {
032                        Handler fh = new FileHandler("sharingExtension.log", LOGGER_SIZE,
033                                        1, true);
034                        Logger.getLogger("csheets.ext.share").setUseParentHandlers(false);
035                        Logger.getLogger("csheets.ext.share").addHandler(fh);
036                } catch (SecurityException e) {
037                } catch (IOException e) {
038                }
039        }
040
041        @Override
042        public UIExtension getUIExtension(UIController uiController) {
043                return new UISharingExtension(this, uiController);
044        }
045}