/** * <copyright> * * Copyright (c) 2016 Thales Global Services S.A.S. * 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: * Thales Global Services S.A.S. - initial API and implementation * * </copyright> */ package org.eclipse.emf.diffmerge.ui.viewers.categories; import org.eclipse.emf.diffmerge.api.diff.IDifference; import org.eclipse.emf.diffmerge.ui.EMFDiffMergeUIPlugin; import org.eclipse.emf.diffmerge.ui.Messages; import org.eclipse.emf.diffmerge.ui.EMFDiffMergeUIPlugin.ImageID; import org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode; import org.eclipse.swt.graphics.Image; /** * A difference category that covers moves. * @author Olivier Constant */ public class MoveCategory extends AbstractDifferenceCategory { /** The ID of this category */ public static final String ID = "Technical.Moved"; //$NON-NLS-1$ /** * Constructor */ public MoveCategory() { super(); } /** * @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#covers(org.eclipse.emf.diffmerge.api.diff.IDifference, org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) */ public boolean covers(IDifference difference_p, EMFDiffNode node_p) { return node_p.getCategoryManager().isMove(difference_p); } /** * @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategoryItem#getDescription(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) */ @Override public String getDescription(EMFDiffNode node_p) { return Messages.MoveCategory_Description; } /** * @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#getID() */ public String getID() { return ID; } /** * @see org.eclipse.emf.diffmerge.ui.viewers.categories.AbstractDifferenceCategory#getImage(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) */ @Override public Image getImage(EMFDiffNode node_p) { return EMFDiffMergeUIPlugin.getDefault().getImage(ImageID.TREE); } /** * @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#getText(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) */ public String getText(EMFDiffNode node_p) { return Messages.MoveCategory_Text; } }