blob: 9e667cbcf87d33c8622889be444eeef805a310c1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2005 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 API and implementation
*******************************************************************************/
package org.eclipse.wst.jsdt.astview;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class ASTViewPlugin extends AbstractUIPlugin {
private static ASTViewPlugin fgDefault;
public ASTViewPlugin() {
fgDefault= this;
}
public static String getPluginId() {
return "org.eclipse.wst.jsdt.astview"; //$NON-NLS-1$
}
/**
* @return the shared instance
*/
public static ASTViewPlugin getDefault() {
return fgDefault;
}
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
public static void logErrorMessage(String message) {
log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, message, null));
}
public static void logErrorStatus(String message, IStatus status) {
if (status == null) {
logErrorMessage(message);
return;
}
MultiStatus multi= new MultiStatus(getPluginId(), IStatus.ERROR, message, null);
multi.add(status);
log(multi);
}
public static void log(String message, Throwable e) {
log(new Status(IStatus.ERROR, getPluginId(), IStatus.ERROR, message, e));
}
}