View Javadoc
1 // re/mind - Remote Reminder Software 2 // Copyright (C) 2002 Moritz Petersen 3 // 4 // This program is free software; you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation; either version 2 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 // 18 // $Id: HandlersFactory.java,v 1.1.1.1 2002/09/29 17:26:01 powerpete Exp $ 19 package de.jface.mrj; 20 21 /*** 22 * HandlersFactory.java 23 * 24 * @author Moritz Petersen 25 * @version $Revision: 1.1.1.1 $ 26 */ 27 public class HandlersFactory 28 { 29 /*** 30 * This method creates a new MRJHandler instance, by dynamically 31 * instantiating it using the given class name. 32 * The controller will be set to the instance. 33 * 34 * @param mrjHandlersClassName the name of the mrj handlers class. 35 * @param controller the controller of this application. 36 * @throws ClassCastException if the given class name is not of type 37 * Handlers. 38 * @throws ClassNotFoundException if the class of the given name 39 * could not be found. 40 * @throws IllegalAccessException if the class could not be accessed. 41 * @throws InstantiationException if the class could not be instantiated. 42 */ 43 public static void registerMRJHandlers(String mrjHandlersClassName, 44 Object controller) 45 throws ClassCastException, ClassNotFoundException, 46 IllegalAccessException, InstantiationException 47 { 48 if (SystemInfo.IS_MACINTOSH) 49 { 50 Handlers handlers = 51 (Handlers) Class.forName(mrjHandlersClassName) 52 .newInstance(); 53 54 handlers.setController(controller); 55 } 56 } 57 }

This page was automatically generated by Maven