blob: daf614ab20a023caa70d408c83bf2c11e9bd76dd [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2013 Ericsson
*
* 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
*
* Description:
*
* Contributors:
* Miles Parker, Tasktop Technologies - Initial API and Implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.reviews.r4e.connector.ui;
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.jface.resource.ImageDescriptor;
/**
* @author Miles Parker
*/
public class R4EImages {
private static final URL baseURL = R4EUiPlugin.getDefault().getBundle().getEntry("/icons/"); //$NON-NLS-1$
public static final ImageDescriptor OVERLAY_REVIEW = create("eview16/overlay-review.png"); //$NON-NLS-1$
public static final ImageDescriptor R4E_REVIEW_GROUP = create("obj16/revgrp.png"); //$NON-NLS-1$
private static ImageDescriptor create(String path) {
try {
return ImageDescriptor.createFromURL(makeIconFileURL(path));
} catch (MalformedURLException e) {
return ImageDescriptor.getMissingImageDescriptor();
}
}
private static URL makeIconFileURL(String path) throws MalformedURLException {
if (baseURL == null) {
throw new MalformedURLException();
}
return new URL(baseURL, path);
}
}