blob: d47a0fb202e1068e869b3cf47a9b2082ec181309 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 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.jst.j2ee.internal.project;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.eclipse.jst.j2ee.project.ISingleRootStatus;
public class SingleRootStatus extends Status implements ISingleRootStatus {
IPath path;
IContainer container;
public SingleRootStatus(int type, int code, IPath resourcePath, IContainer containerPath, String message, Throwable exception) {
super(type, J2EEPlugin.PLUGIN_ID, code, message, exception);
path = resourcePath;
container = containerPath;
}
public SingleRootStatus(int code, IPath resourcePath, IContainer containerPath) {
this(getSeverity(code), code, resourcePath, containerPath, null, null);
}
public IPath getPath() {
return path;
}
public IContainer getSingleRoot() {
return container;
}
protected static int getSeverity(int code) {
return code == 0 ? 0 : 1 << (code / 33);
}
}