01: /*
02: * Copyright 2006 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: *
13: * Created May 22, 2006
14: * @author wseyler
15: */
16:
17: package org.pentaho.ui.component;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.commons.logging.LogFactory;
21: import org.pentaho.core.system.PentahoSystem;
22: import org.pentaho.messages.Messages;
23:
24: public class NavigationComponentFactory {
25: private static final Log logger = LogFactory
26: .getLog(NavigationComponentFactory.class);
27:
28: public static INavigationComponent getNavigationComponent() {
29:
30: INavigationComponent navComponent = null;
31: String className = null;
32: try {
33: className = PentahoSystem.getSystemSetting(
34: "objects/INavigationComponent", null); //$NON-NLS-1$
35: if (className == null) { // Nothing defined so we default to
36: return new NavigationComponent();
37: }
38: Class componentClass = Class.forName(className);
39: navComponent = (INavigationComponent) componentClass
40: .newInstance();
41: } catch (Exception e) {
42: logger
43: .error(Messages
44: .getString(
45: "XMLComponentFactory.ERROR_0001_Unable_To_Create_Class", className)); //$NON-NLS-1$
46: }
47:
48: return navComponent;
49: }
50: }
|