diff options
Diffstat (limited to 'plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java')
-rwxr-xr-x | plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java new file mode 100755 index 00000000000..56ebeb5a228 --- /dev/null +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java @@ -0,0 +1,32 @@ +/***************************************************************************** + * Copyright (c) 2013 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: + * Laurent Wouters (CEA LIST) laurent.wouters@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.nattable.modelexplorer.queries; + +import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage; +import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.infra.nattable.model.nattable.Table; +import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView; +import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype; +import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery; + +/** Return the path to the icon of the corresponding table */ +public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaQuery2<Table, IImage> { + + public IImage evaluate(Table source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { + ViewPrototype prototype = ViewPrototype.get((PapyrusView) source.getPrototype()); + return ImageUtils.wrap(prototype.getIconURI()); + } +} |