/******************************************************************************* * <copyright> * * Copyright (c) 2012, 2012 SAP AG. * 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: * SAP AG - initial API, implementation and documentation * pjpaulin - Bug 352120 - Now uses IDiagramContainerUI interface * * </copyright> * *******************************************************************************/ package org.eclipse.graphiti.examples.tutorial.property; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.graphiti.mm.pictograms.PictogramElement; import org.eclipse.graphiti.services.Graphiti; import org.eclipse.graphiti.ui.editor.IDiagramContainerUI; import org.eclipse.graphiti.ui.platform.AbstractPropertySectionFilter; /** * Filters out all other object than {@link EReference}s that get selected in * the {@link IDiagramContainerUI} for displaying properties. */ public class TutorialEReferenceFilter extends AbstractPropertySectionFilter { @Override protected boolean accept(PictogramElement pe) { EObject bo = Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe); if (bo instanceof EReference) { return true; } return false; } }