|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2011-2012 EclipseSource Muenchen GmbH. |
| 3 |
* |
| 4 |
* All rights reserved. This program and the accompanying materials |
| 5 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 6 |
* which accompanies this distribution, and is available at |
| 7 |
* http://www.eclipse.org/legal/epl-v10.html |
| 8 |
* |
| 9 |
* Contributors: |
| 10 |
******************************************************************************/ |
| 11 |
package org.eclipse.emf.ecp.emfstore.internal.ui.decorator; |
| 12 |
|
| 13 |
import org.eclipse.emf.ecp.core.ECPProject; |
| 14 |
import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider; |
| 15 |
import org.eclipse.emf.ecp.emfstore.internal.ui.Activator; |
| 16 |
import org.eclipse.emf.ecp.spi.core.InternalProject; |
| 17 |
|
| 18 |
import org.eclipse.jface.viewers.IDecoration; |
| 19 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
| 20 |
import org.eclipse.jface.viewers.ILightweightLabelDecorator; |
| 21 |
|
| 22 |
/** |
| 23 |
* @author Tobias Verhoeven |
| 24 |
*/ |
| 25 |
public class EMFStoreUnsharedDecorator implements ILightweightLabelDecorator { |
| 26 |
|
| 27 |
private String imagePath = "icons/unshared.png"; |
| 28 |
|
| 29 |
/** |
| 30 |
* {@inheritDoc} |
| 31 |
* |
| 32 |
* @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang .Object, |
| 33 |
* org.eclipse.jface.viewers.IDecoration) |
| 34 |
* @param element |
| 35 |
* element |
| 36 |
* @param decoration |
| 37 |
* decoration |
| 38 |
*/ |
| 39 |
public void decorate(Object element, IDecoration decoration) { |
| 40 |
if (element instanceof ECPProject) { |
| 41 |
if (!EMFStoreProvider.INSTANCE.getProjectSpace((InternalProject) element).isShared()) { |
| 42 |
decoration.addOverlay(Activator.getImageDescriptor(imagePath), IDecoration.BOTTOM_LEFT); |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* {@inheritDoc} |
| 49 |
* |
| 50 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse. jface.viewers.ILabelProviderListener) |
| 51 |
*/ |
| 52 |
public void addListener(ILabelProviderListener listener) { |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* {@inheritDoc} |
| 57 |
* |
| 58 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() |
| 59 |
*/ |
| 60 |
public void dispose() { |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* . {@inheritDoc} |
| 65 |
* |
| 66 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang .Object, java.lang.String) |
| 67 |
*/ |
| 68 |
public boolean isLabelProperty(Object element, String property) { |
| 69 |
return false; |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* . {@inheritDoc} |
| 74 |
* |
| 75 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse |
| 76 |
* .jface.viewers.ILabelProviderListener) |
| 77 |
*/ |
| 78 |
public void removeListener(ILabelProviderListener listener) { |
| 79 |
} |
| 80 |
} |