carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.templates/xpt/providers/IconProvider.xpt
author cawthron
Fri, 04 Dec 2009 11:06:59 -0600
changeset 422 033392511bf7
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
422
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     1
/*
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2007 Borland Software Corporation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     3
 * 
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     4
 * All rights reserved. This program and the accompanying materials
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     5
 * are made available under the terms of the Eclipse Public License v1.0
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     6
 * which accompanies this distribution, and is available at
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     7
 * http://www.eclipse.org/legal/epl-v10.html
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     8
 *
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
     9
 * Contributors:
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    10
 *    Dmitry Stadnik (Borland) - initial API and implementation
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    11
 */
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    12
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    13
«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    14
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    15
«DEFINE IconProvider FOR gmfgen::GenDiagram-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    16
«EXPAND xpt::Common::copyright FOR editorGen-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    17
package «providersPackageName»;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    18
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    19
«EXPAND xpt::Common::generatedClassComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    20
public class «iconProviderClassName» extends org.eclipse.gmf.runtime.common.core.service.AbstractProvider
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    21
		implements org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    22
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    23
	«EXPAND xpt::Common::generatedMemberComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    24
	public org.eclipse.swt.graphics.Image getIcon(org.eclipse.core.runtime.IAdaptable hint, int flags) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    25
		return «getElementTypesQualifiedClassName()».getImage(hint);
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    26
	}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    27
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    28
	«EXPAND xpt::Common::generatedMemberComment»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    29
	public boolean provides(org.eclipse.gmf.runtime.common.core.service.IOperation operation) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    30
		if (operation instanceof org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation) {
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    31
			return ((org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation) operation).execute(this) != null;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    32
		}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    33
		return false;
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    34
	}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    35
	«EXPAND additions-»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    36
}
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    37
«ENDDEFINE»
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    38
033392511bf7 add files for RCL_2_2
cawthron
parents:
diff changeset
    39
«DEFINE additions FOR gmfgen::GenDiagram-»«ENDDEFINE»