blob: 83c9fdd92387a1d8296f5e688845945111f1af45 [file] [log] [blame]
//------------------------------------------------------------------------------
// Copyright (c) 2005, 2006 IBM Corporation and others.
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// Contributors:
// IBM Corporation - initial implementation
//------------------------------------------------------------------------------
package org.eclipse.epf.authoring.ui;
import org.eclipse.epf.authoring.ui.internal.ImageDescriptorRegistry;
import org.eclipse.epf.authoring.ui.internal.ProblemMarkerManager;
import org.eclipse.epf.common.plugin.AbstractPlugin;
import org.osgi.framework.BundleContext;
/**
* The Authoring UI plug-in class.
*
* @author Kelvin Low
* @author Phong Nguyen Le
* @since 1.0
*/
public class AuthoringUIPlugin extends AbstractPlugin {
// The shared plug-in instance.
private static AuthoringUIPlugin plugin;
private ProblemMarkerManager fProblemMarkerManager;
private ImageDescriptorRegistry fImageDescriptorRegistry;
/**
* Creates a new instance.
*/
public AuthoringUIPlugin() {
super();
plugin = this;
}
/**
* @see org.eclipse.epf.common.plugin.AbstractPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
// Initialize the Authoring UI service.
AuthoringUIService.getInstance().start();
}
/**
* @see org.eclipse.epf.common.plugin.AbstractPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared plug-in instance.
*/
public static AuthoringUIPlugin getDefault() {
return plugin;
}
public synchronized ProblemMarkerManager getProblemMarkerManager() {
if (fProblemMarkerManager == null)
fProblemMarkerManager= new ProblemMarkerManager();
return fProblemMarkerManager;
}
public static ImageDescriptorRegistry getImageDescriptorRegistry() {
return getDefault().internalGetImageDescriptorRegistry();
}
private synchronized ImageDescriptorRegistry internalGetImageDescriptorRegistry() {
if (fImageDescriptorRegistry == null)
fImageDescriptorRegistry= new ImageDescriptorRegistry();
return fImageDescriptorRegistry;
}
public static void log(Throwable t) {
getDefault().getLogger().logError(t);
}
}