Skip to content

Package: ImageRegistryService

ImageRegistryService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.util.swt;
15:
16: import java.net.URL;
17:
18: import org.eclipse.swt.graphics.Image;
19: import org.osgi.framework.Bundle;
20:
21: /**
22: * The {@link ImageRegistryService} allows to retrieve Images based on a Bundle and a path within or an URL. The images
23: * are loaded only once.
24: *
25: * @author Eugen Neufeld
26: *
27: */
28: public interface ImageRegistryService {
29:         /**
30:          * Retrieve an {@link Image} based on a Bundle and a path within.
31:          *
32:          * @param bundle the Bundle to get the image from
33:          * @param path the path to the image within the bundle
34:          * @return the loaded {@link Image}
35:          */
36:         Image getImage(Bundle bundle, String path);
37:
38:         /**
39:          * Retrieve an {@link Image} based on an {@link URL}.
40:          *
41:          * @param url the {@link URL} to load the image from
42:          * @return the loaded {@link Image}
43:          */
44:         Image getImage(URL url);
45: }