blob: a80ac8fd72c365690899a535d290bbd5d74caf29 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
* 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.infra.table.efacet.properties.modelelement;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage;
import org.eclipse.papyrus.infra.table.efacet.properties.providers.ContextFeatureContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
public class TableModelElement extends EMFModelElement {
private final PapyrusTable sourceTable;
public TableModelElement(final PapyrusTable source, final EditingDomain domain) {
super(source, domain);
this.sourceTable = source;
}
@Override
public IStaticContentProvider getContentProvider(final String propertyPath) {
if(PapyrustablePackage.eINSTANCE.getPapyrusTable_ContextFeature().getName().equals(propertyPath)) {//TODO change this string by the string owned by the table model if it exists
return new ContextFeatureContentProvider(this.sourceTable);
}
return super.getContentProvider(propertyPath);
}
@Override
public ILabelProvider getLabelProvider(final String propertyPath) {
if("table.context".equals(propertyPath)) { //$NON-NLS-1$
//TODO when the label provider service will exisit ()warning to stereotyped element! (SysML != UML!!)
}
return super.getLabelProvider(propertyPath);
}
}
|