Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/IconProvider.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/IconProvider.xpt39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/IconProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/IconProvider.xpt
new file mode 100644
index 000000000..43493d77e
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/IconProvider.xpt
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+
+«DEFINE IconProvider FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::copyright FOR editorGen-»
+package «providersPackageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «iconProviderClassName» extends org.eclipse.gmf.runtime.common.core.service.AbstractProvider
+ implements org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider {
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public org.eclipse.swt.graphics.Image getIcon(org.eclipse.core.runtime.IAdaptable hint, int flags) {
+ return «getElementTypesQualifiedClassName()».getImage(hint);
+ }
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public boolean provides(org.eclipse.gmf.runtime.common.core.service.IOperation operation) {
+ if (operation instanceof org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation) {
+ return ((org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation) operation).execute(this) != null;
+ }
+ return false;
+ }
+ «EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenDiagram-»«ENDDEFINE»

Back to the top