Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-02-22 22:01:15 +0000
committeratikhomirov2006-02-22 22:01:15 +0000
commit5d8b7580c8f1ef27d721a366ddeee6270c0833f1 (patch)
tree139b52017c1995621ad8ff1408f8c743904a9c40 /plugins/org.eclipse.gmf.codegen.ui
parent1562c1b0e727cc29fed4d303fa4db189968f8a26 (diff)
downloadorg.eclipse.gmf-tooling-5d8b7580c8f1ef27d721a366ddeee6270c0833f1.tar.gz
org.eclipse.gmf-tooling-5d8b7580c8f1ef27d721a366ddeee6270c0833f1.tar.xz
org.eclipse.gmf-tooling-5d8b7580c8f1ef27d721a366ddeee6270c0833f1.zip
#129047 get rid of explicit edit/label features, use generic and feature-rich LabelMapping instead.
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen.ui')
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/EntriesPage.java15
-rw-r--r--plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/WizardInput.java13
2 files changed, 8 insertions, 20 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/EntriesPage.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/EntriesPage.java
index 8c1211f77..176e65d32 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/EntriesPage.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/EntriesPage.java
@@ -104,8 +104,6 @@ public class EntriesPage extends WizardPage {
private Group groupConstaints = null;
private Label specLabel = null;
private Label initLabel = null;
- private Label editFeatureLabel = null;
- private Label displayFeatureLabel = null;
private Label diagramElementLabel = null;
private Label metaElementLabel;
private Label containmentLabel;
@@ -308,14 +306,6 @@ public class EntriesPage extends WizardPage {
groupEdit.setText("Edit");
groupEdit.setLayout(newDetailGroupLayout());
groupEdit.setLayoutData(newDetailGroupConstraint());
- Label l = new Label(groupEdit, SWT.NONE);
- l.setText("In-place edit:");
- editFeatureLabel = new Label(groupEdit, SWT.NONE);
- editFeatureLabel.setLayoutData(newDetailLabelConstraint());
- l = new Label(groupEdit, SWT.NONE);
- l.setText("Display feature:");
- displayFeatureLabel = new Label(groupEdit, SWT.NONE);
- displayFeatureLabel.setLayoutData(newDetailLabelConstraint());
}
private void createVisualGroup() {
@@ -363,7 +353,6 @@ public class EntriesPage extends WizardPage {
nm.setDomainInitializer(selectedEntry.getDomainInitializer());
nm.setDomainSpecialization(selectedEntry.getDomainSpecialization());
final LinkMapping linkMapping = (LinkMapping) selectedEntry;
- nm.setEditFeature(linkMapping.getLabelEditFeature());
nm.setTool(linkMapping.getTool());
nm.setContextMenu(linkMapping.getContextMenu());
nm.setAppearanceStyle(linkMapping.getAppearanceStyle());
@@ -386,7 +375,6 @@ public class EntriesPage extends WizardPage {
lm.setDomainInitializer(selectedEntry.getDomainInitializer());
lm.setDomainSpecialization(selectedEntry.getDomainSpecialization());
final NodeMapping nodeMapping = (NodeMapping) selectedEntry;
- lm.setLabelEditFeature(nodeMapping.getEditFeature());
lm.setTool(nodeMapping.getTool());
lm.setContextMenu(nodeMapping.getContextMenu());
lm.setAppearanceStyle(nodeMapping.getAppearanceStyle());
@@ -551,7 +539,6 @@ public class EntriesPage extends WizardPage {
} else {
diagramElementLabel.setText("");
}
- affix(editFeatureLabel, m.getEditFeature());
linkMetaFeatureLabel.setText("");
}
@@ -563,8 +550,6 @@ public class EntriesPage extends WizardPage {
} else {
diagramElementLabel.setText("");
}
- affix(editFeatureLabel, l.getLabelEditFeature());
- affix(displayFeatureLabel, l.getLabelDisplayFeature());
affix(linkMetaFeatureLabel, l.getLinkMetaFeature());
}
diff --git a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/WizardInput.java b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/WizardInput.java
index dbb95eaf9..da0273b9c 100644
--- a/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/WizardInput.java
+++ b/plugins/org.eclipse.gmf.codegen.ui/src/org/eclipse/gmf/internal/codegen/wizards/pages/WizardInput.java
@@ -45,8 +45,10 @@ import org.eclipse.gmf.gmfgraph.Node;
import org.eclipse.gmf.gmfgraph.provider.GMFGraphItemProviderAdapterFactory;
import org.eclipse.gmf.mappings.CanvasMapping;
import org.eclipse.gmf.mappings.GMFMapFactory;
+import org.eclipse.gmf.mappings.LabelMapping;
import org.eclipse.gmf.mappings.LinkMapping;
import org.eclipse.gmf.mappings.Mapping;
+import org.eclipse.gmf.mappings.MappingEntry;
import org.eclipse.gmf.mappings.NodeMapping;
import org.eclipse.gmf.mappings.provider.GMFMapItemProviderAdapterFactory;
import org.eclipse.gmf.tooldef.AbstractTool;
@@ -216,7 +218,7 @@ public class WizardInput {
nm.setDomainMetaElement(eClass);
nm.setContainmentFeature(getHierarchy().backRef(eClass));
nm.setDiagramNode(findSuitableNode(nm));
- nm.setEditFeature(findEditFeature(eClass));
+ addEditFeature(nm, eClass);
nm.setTool(findTool(nm));
rv.add(nm);
}
@@ -232,7 +234,7 @@ public class WizardInput {
EClass eClass = (EClass) next;
lm.setDomainMetaElement(eClass);
lm.setContainmentFeature(getHierarchy().backRef(eClass));
- lm.setLabelEditFeature(findEditFeature(eClass));
+ addEditFeature(lm, eClass);
lm.setLinkMetaFeature(getHierarchy().getLinkFeature(eClass));
} else {
lm.setLinkMetaFeature((EReference) next);
@@ -290,14 +292,15 @@ public class WizardInput {
return null;
}
- private EAttribute findEditFeature(EClass class1) {
+ private void addEditFeature(MappingEntry me, EClass class1) {
for (Iterator it = class1.getEAllAttributes().iterator(); it.hasNext();) {
EAttribute n = (EAttribute) it.next();
if (EcorePackage.eINSTANCE.getEString().equals(n.getEType())) {
- return n;
+ LabelMapping lm = GMFMapFactory.eINSTANCE.createLabelMapping();
+ lm.getFeatures().add(n);
+ return;
}
}
- return null;
}
private static class Hierarchy {

Back to the top