diff options
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java b/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java index d058a520729..c89cc88d5e6 100644 --- a/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java +++ b/plugins/developer/org.eclipse.papyrus.dev.types/src/org/eclipse/papyrus/dev/types/providers/ElementTypesLabelProvider.java @@ -1,45 +1,45 @@ -/*****************************************************************************
- * Copyright (c) 2014 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:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.dev.types.providers;
-
-import java.io.IOException;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class ElementTypesLabelProvider extends org.eclipse.jface.viewers.LabelProvider {
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof IElementType) {
- if (((IElementType) element).getIconURL() != null) {
- try {
- return new Image(Display.getCurrent(), ((IElementType) element).getIconURL().openStream());
- } catch (IOException ex) {
- ex.printStackTrace();
- }
- }
- }
- return null;
- }
-
- @Override
- public String getText(Object element) {
- String result = "";
- if (element instanceof IElementType) {
- result += ((IElementType) element).getId();
- }
- return result;
- }
-}
+/***************************************************************************** + * Copyright (c) 2014 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.dev.types.providers; + +import java.io.IOException; + +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; + +public class ElementTypesLabelProvider extends org.eclipse.jface.viewers.LabelProvider { + + @Override + public Image getImage(Object element) { + if (element instanceof IElementType) { + if (((IElementType) element).getIconURL() != null) { + try { + return new Image(Display.getCurrent(), ((IElementType) element).getIconURL().openStream()); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + return null; + } + + @Override + public String getText(Object element) { + String result = ""; + if (element instanceof IElementType) { + result += ((IElementType) element).getId(); + } + return result; + } +} |