blob: 30da0a0d76a9926160224cb25f0171eaddbf06e2 [file] [log] [blame]
/**
* Copyright (c) 2013 Obeo.
* 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:
* Obeo - initial API and implementation
*/
package org.eclipse.emf.compare.diagram.internal.extensions.provider.spec;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
import org.eclipse.emf.compare.provider.utils.IStyledString.Style;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
/**
* Item provider for show changes.
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
public class ShowItemProviderSpec extends ForwardingDiagramDiffItemProvider {
/**
* Constructor.
*
* @param delegate
* The origin item provider adapter.
*/
public ShowItemProviderSpec(ItemProviderAdapter delegate) {
super(delegate);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.diagram.internal.extensions.provider.spec.ForwardingDiagramDiffItemProvider#getReferenceText(org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff)
*/
@Override
protected String getReferenceText(DiagramDiff diagramDiff) {
return "visibility"; //$NON-NLS-1$
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.diagram.internal.extensions.provider.spec.ForwardingDiagramDiffItemProvider#buildStyledText(org.eclipse.emf.compare.DifferenceKind,
* org.eclipse.emf.compare.provider.utils.ComposedStyledString)
*/
@Override
protected void buildStyledText(DifferenceKind kind, ComposedStyledString ret) {
if (kind == DifferenceKind.CHANGE) {
ret.append(" reveal", Style.DECORATIONS_STYLER); //$NON-NLS-1$
} else {
super.buildStyledText(kind, ret);
}
}
}