|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
|||||
|
||||||
001 /************************************************************************* 002 * 003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 004 * 005 * Copyright 2008 by Sun Microsystems, Inc. 006 * 007 * OpenOffice.org - a multi-platform office productivity suite 008 * 009 * $RCSfile: InstallerFactory.java,v $ 010 * $Revision: 1.3 $ 011 * 012 * This file is part of OpenOffice.org. 013 * 014 * OpenOffice.org is free software: you can redistribute it and/or modify 015 * it under the terms of the GNU Lesser General Public License version 3 016 * only, as published by the Free Software Foundation. 017 * 018 * OpenOffice.org is distributed in the hope that it will be useful, 019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 021 * GNU Lesser General Public License version 3 for more details 022 * (a copy is included in the LICENSE file that accompanied this code). 023 * 024 * You should have received a copy of the GNU Lesser General Public License 025 * version 3 along with OpenOffice.org. If not, see 026 * <http://www.openoffice.org/license.html> 027 * for a copy of the LGPLv3 License. 028 * 029 ************************************************************************/ 030 031 package org.openoffice.setup.Installer; 032 033 import org.openoffice.setup.InstallData; 034 import org.openoffice.setup.ResourceManager; 035 import org.openoffice.setup.Util.Informer; 036 037 public class InstallerFactory 038 { 039 private static Installer instance = null; 040 041 private InstallerFactory() { 042 } 043 044 public static Installer getInstance() 045 { 046 if (instance == null) { 047 instance = createInstaller(); 048 } 049 return instance; 050 } 051 052 private static Installer createInstaller() { 053 054 InstallData data = InstallData.getInstance(); 055 if ( data.getOSType().equalsIgnoreCase("Linux")) { 056 instance = new LinuxInstaller(); 057 } else if ( data.getOSType().equalsIgnoreCase("SunOS")) { 058 instance = new SolarisInstaller(); 059 } else { 060 System.err.println("Error: No installer for this OS defined!"); 061 String message = ResourceManager.getString("String_InstallerFactory_Os_Not_Supported"); 062 String title = ResourceManager.getString("String_Error"); 063 Informer.showErrorMessage(message, title); 064 System.exit(1); 065 } 066 067 return instance; 068 } 069 070 }
| [ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |
| This page was automatically generated by the LXR engine. The LXR team |
|