Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 393554
Collapse All | Expand All

(-)plugin.xml (+16 lines)
Lines 288-293 Link Here
288
         point="org.eclipse.ui.decorators">
288
         point="org.eclipse.ui.decorators">
289
      <decorator
289
      <decorator
290
            adaptable="true"
290
            adaptable="true"
291
            class="org.eclipse.emf.ecp.emfstore.internal.ui.decorator.EMFStoreUnsharedDecorator"
292
            id="org.eclipse.emf.ecp.emfstore.ui.decorators.EMFStoreUnsharedDecorator"
293
            label="EMFStoreUnshared Decorator"
294
            lightweight="true"
295
            state="true">
296
         <enablement>
297
            <objectClass
298
                  name="org.eclipse.emf.ecp.core.ECPProject">
299
            </objectClass>
300
         </enablement>
301
         <description>
302
            If the project is not shared.
303
         </description>
304
      </decorator>
305
      <decorator
306
            adaptable="true"
291
            class="org.eclipse.emf.ecp.emfstore.internal.ui.decorator.EMFStoreDirtyDecorator"
307
            class="org.eclipse.emf.ecp.emfstore.internal.ui.decorator.EMFStoreDirtyDecorator"
292
            id="org.eclipse.emf.ecp.emfstore.ui.decorators.EMFStoreDirtyDecorator"
308
            id="org.eclipse.emf.ecp.emfstore.ui.decorators.EMFStoreDirtyDecorator"
293
            label="EMFStoreDirty Decorator"
309
            label="EMFStoreDirty Decorator"
(-)src/org/eclipse/emf/ecp/emfstore/internal/ui/decorator/EMFStoreUnsharedDecorator.java (+80 lines)
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
}

Return to bug 393554