diff options
Diffstat (limited to 'plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java')
-rw-r--r-- | plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java index 1e5b0e6701c..567048653e8 100644 --- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java +++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/utils/PapyrusImageUtils.java @@ -1,67 +1,67 @@ -/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * 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:
- * Tristan Faure (ATOS ORIGIN INTEGRATION) tristan.faure@atosorigin.com - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.core.utils;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.papyrus.infra.core.Activator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Services to access to Papyrus images
- *
- * @author tristan faure
- *
- */
-public class PapyrusImageUtils {
-
- private static final String default_icon_32 = "/icons/papyrus/32x32/Papyrus_32x32_t.gif";
-
- private static final String default_icon = "/icons/papyrus/Papyrus.gif";
-
- /**
- * get the default icon for Papyrus the image does not have to be disposed
- * as it is registered in an ImageRegistry
- *
- * @return the Image
- */
- public static Image getDefaultIcon() {
- return getIcon(default_icon);
- }
-
- /**
- * get the default icon 32x32 for Papyrus the image does not have to be
- * disposed as it is registered in an ImageRegistry
- *
- * @return the Image
- */
- public static Image getDefaultIcon32() {
- return getIcon(default_icon_32);
- }
-
- private static Image getIcon(String path) {
- String key = Activator.PLUGIN_ID + path;
- Image result = JFaceResources.getImageRegistry().get(key);
- if(result == null) {
- URL url = Activator.getDefault().getBundle().getEntry(path);
- try {
- result = new Image(Display.getDefault(), url.openStream());
- JFaceResources.getImageRegistry().put(key, result);
- } catch (IOException e) {
- }
- }
- return result;
- }
-}
+/***************************************************************************** + * Copyright (c) 2010 CEA LIST. + * + * 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: + * Tristan Faure (ATOS ORIGIN INTEGRATION) tristan.faure@atosorigin.com - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.core.utils; + +import java.io.IOException; +import java.net.URL; + +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +/** + * Services to access to Papyrus images + * + * @author tristan faure + * + */ +public class PapyrusImageUtils { + + private static final String default_icon_32 = "/icons/papyrus/32x32/Papyrus_32x32_t.gif"; //$NON-NLS-1$ + + private static final String default_icon = "/icons/papyrus/Papyrus.gif"; //$NON-NLS-1$ + + /** + * get the default icon for Papyrus the image does not have to be disposed + * as it is registered in an ImageRegistry + * + * @return the Image + */ + public static Image getDefaultIcon() { + return getIcon(default_icon); + } + + /** + * get the default icon 32x32 for Papyrus the image does not have to be + * disposed as it is registered in an ImageRegistry + * + * @return the Image + */ + public static Image getDefaultIcon32() { + return getIcon(default_icon_32); + } + + private static Image getIcon(String path) { + String key = Activator.PLUGIN_ID + path; + Image result = JFaceResources.getImageRegistry().get(key); + if(result == null) { + URL url = Activator.getDefault().getBundle().getEntry(path); + try { + result = new Image(Display.getDefault(), url.openStream()); + JFaceResources.getImageRegistry().put(key, result); + } catch (IOException e) { + } + } + return result; + } +} |