Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-07 08:27:55 +0000
committervlorenzo2012-08-07 08:27:55 +0000
commita45ecb26f56f3e0fb501d9a7af64953a855c7f8e (patch)
tree67100251bf9c57c0cd138837863bf03798f209ad /incoming
parentb4a42019ecd6ad92c26c93413938a15ef7e02eca (diff)
downloadorg.eclipse.papyrus-a45ecb26f56f3e0fb501d9a7af64953a855c7f8e.tar.gz
org.eclipse.papyrus-a45ecb26f56f3e0fb501d9a7af64953a855c7f8e.tar.xz
org.eclipse.papyrus-a45ecb26f56f3e0fb501d9a7af64953a855c7f8e.zip
A save of my work on the new tables
change property view
Diffstat (limited to 'incoming')
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/ui/SinglePapyrusTable.xwt18
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java22
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ClassLabelProvider.java51
-rw-r--r--incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ContextFeatureContentProvider.java129
4 files changed, 212 insertions, 8 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/ui/SinglePapyrusTable.xwt b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/ui/SinglePapyrusTable.xwt
index 61665bf91b3..0ec0a430e5b 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/ui/SinglePapyrusTable.xwt
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/propertyView/papyrustable/ui/SinglePapyrusTable.xwt
@@ -11,7 +11,8 @@
<ppel:PropertiesLayout></ppel:PropertiesLayout>
</Composite.layout>
<ppe:StringLabel input="{Binding}"
- property="papyrustable:PapyrusTable:table.context"></ppe:StringLabel>
+ property="papyrustable:PapyrusTable:table.context"
+ customLabel="Context"></ppe:StringLabel>
</Composite>
<Composite>
<Composite.layout>
@@ -27,7 +28,8 @@
<ppel:PropertiesLayout></ppel:PropertiesLayout>
</Composite.layout>
<ppe:StringMultiline input="{Binding}"
- property="papyrustable:PapyrusTable:table.description"></ppe:StringMultiline>
+ property="papyrustable:PapyrusTable:table.description"
+ customLabel="Description"></ppe:StringMultiline>
</Composite>
<Composite>
<Composite.layout>
@@ -55,14 +57,16 @@
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:StringEditor input="{Binding}"
- property="papyrustable:PapyrusTable:table.parameter" readOnly="true"></ppe:StringEditor>
+ property="papyrustable:PapyrusTable:table.parameter" readOnly="true"
+ customLabel="Parameter"></ppe:StringEditor>
</Composite>
<Composite>
<Composite.layout>
<ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:BooleanRadio input="{Binding}"
- property="papyrustable:PapyrusTable:table.hideEmptyColumns" readOnly="true"></ppe:BooleanRadio>
+ property="papyrustable:PapyrusTable:table.hideEmptyColumns" readOnly="true"
+ customLabel="Hide empty columns"></ppe:BooleanRadio>
<ppe:BooleanRadio input="{Binding}"
property="papyrustable:PapyrusTable:table.onlyShowCommonColumns" readOnly="true"
customLabel="Only common columns"></ppe:BooleanRadio>
@@ -80,8 +84,10 @@
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:MultiReference input="{Binding}"
- property="papyrustable:PapyrusTable:table.customizations" readOnly="true"></ppe:MultiReference>
+ property="papyrustable:PapyrusTable:table.customizations" readOnly="true"
+ customLabel="Customizations"></ppe:MultiReference>
<ppe:MultiReference input="{Binding}"
- property="papyrustable:PapyrusTable:table.facetSets" readOnly="true"></ppe:MultiReference>
+ property="papyrustable:PapyrusTable:table.facetSets" readOnly="true"
+ customLabel="Facets"></ppe:MultiReference>
</Composite>
</Composite> \ No newline at end of file
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java
index b79b2e8e65b..a80ac8fd72c 100644
--- a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/modelelement/TableModelElement.java
@@ -12,18 +12,36 @@
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 PapyrusTable sourceTable;
+ private final PapyrusTable sourceTable;
- public TableModelElement(PapyrusTable source, EditingDomain domain) {
+ 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);
+ }
}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ClassLabelProvider.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ClassLabelProvider.java
new file mode 100644
index 00000000000..430f02601fe
--- /dev/null
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ClassLabelProvider.java
@@ -0,0 +1,51 @@
+/**
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.infra.table.efacet.properties.providers;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+
+
+public class ClassLabelProvider implements ILabelProvider {
+
+ public void addListener(final ILabelProviderListener listener) {
+ //nothing to do
+
+ }
+
+ public void dispose() {
+ //nothing to do
+ }
+
+ public boolean isLabelProperty(final Object element, final String property) {
+ //nothing to do
+ return false;
+ }
+
+ public void removeListener(final ILabelProviderListener listener) {
+ //nothing to do
+
+ }
+
+ public Image getImage(final Object element) {
+ //nothing to do
+ return null;
+ }
+
+ public String getText(final Object element) {
+ //nothing to do
+ return "";
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ContextFeatureContentProvider.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ContextFeatureContentProvider.java
new file mode 100644
index 00000000000..4ff01a0a8b6
--- /dev/null
+++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.properties/src/org/eclipse/papyrus/infra/table/efacet/properties/providers/ContextFeatureContentProvider.java
@@ -0,0 +1,129 @@
+/**
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.infra.table.efacet.properties.providers;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+
+/**
+ *
+ * Context provider for the table edition
+ *
+ */
+public class ContextFeatureContentProvider implements IHierarchicContentProvider, IStaticContentProvider {
+
+ /**
+ * the edited table
+ */
+ private final PapyrusTable table;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param table
+ * the edited table
+ */
+ public ContextFeatureContentProvider(final PapyrusTable table) {
+ this.table = table;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider#getElements()
+ *
+ * @return
+ */
+ public Object[] getElements() {
+ return new Object[0];
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+ *
+ * @param inputElement
+ * @return
+ */
+ public Object[] getElements(final Object inputElement) {
+ return this.table.getTable().getContext().eClass().getEAllReferences().toArray();
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ *
+ * @param parentElement
+ * @return
+ */
+ public Object[] getChildren(final Object parentElement) {
+ return new Object[0];
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ public Object getParent(final Object element) {
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ public boolean hasChildren(final Object element) {
+ return getChildren(element).length != 0;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ *
+ */
+ public void dispose() {
+ //nothing to do
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ *
+ * @param viewer
+ * @param oldInput
+ * @param newInput
+ */
+ public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
+ //nothing to do
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ public boolean isValidValue(final Object element) {
+ return true;
+ }
+
+}

Back to the top