001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    
005    package graphlab.plugins.main;
006    
007    import graphlab.platform.core.BlackBoard;
008    import graphlab.platform.plugin.PluginHandlerInterface;
009    import graphlab.ui.UI;
010    import org.xml.sax.SAXException;
011    
012    import java.io.IOException;
013    
014    public class HandlerInit implements PluginHandlerInterface {
015    
016    
017        /**
018         * Load config xml in UI.
019         *
020         * @see graphlab.platform.plugin.PluginHandlerInterface#init(String,graphlab.platform.core.BlackBoard)
021         */
022        public void init(String path, BlackBoard blackboard) {
023            UI ui = blackboard.getData(UI.name);
024            try {
025                System.err.println(path);
026                ui.addXML(path, getClass());
027            } catch (IOException e) {
028                e.printStackTrace();
029                System.err.println("xml file was not found , or IO error");
030            } catch (SAXException e) {
031                e.printStackTrace();
032            }
033        }
034    
035    }