Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/customization/org.eclipse.papyrus.customization.properties.generation')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java7
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto18
6 files changed, 37 insertions, 8 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
index e6ffe34c71d..e00c48898c4 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
@@ -148,6 +148,10 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
listeners.add(listener);
}
+ public void removeListener(Listener listener) {
+ listeners.remove(listener);
+ }
+
public void handleEvent(Event event) {
for(Listener listener : listeners) {
listener.handleEvent(event);
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
index 20110320915..a4ecb7aa90a 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
@@ -84,4 +84,9 @@ public class EditContextGenerator implements IGenerator {
throw new UnsupportedOperationException();
}
+ public void removeListener(Listener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
index 97261d3bad5..c9cdab8dc61 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
@@ -121,4 +121,11 @@ public interface IGenerator {
* @param listener
*/
public void addListener(Listener listener);
+
+ /**
+ * Removes a Change Listener from this generator.
+ *
+ * @param listener
+ */
+ public void removeListener(Listener listener);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
index ae09e47f834..0ef5be7dd28 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
@@ -70,6 +70,11 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
}
@Override
+ public void dispose() {
+ this.generator.removeListener(this);
+ }
+
+ @Override
public boolean isPageComplete() {
return targetFileChooser.getFilePath() != null && (generator != null && generator.isReady());
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
index 24c4e61cf10..abd8fcd7887 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
@@ -80,6 +80,9 @@ public class FileChooser extends Composite implements SelectionListener, Listene
* @return the selected file path
*/
public String getFilePath() {
+ if(text.isDisposed()) {
+ return null;
+ }
String path = text.getText();
if(path.trim().equals("")) { //$NON-NLS-1$
return null;
@@ -118,8 +121,9 @@ public class FileChooser extends Composite implements SelectionListener, Listene
if(newFile) {
IFile file = WorkspaceResourceDialog.openNewFile(getShell(), null, null, null, filters);
- if(file != null)
+ if(file != null) {
result = new IFile[]{ file };
+ }
} else {
result = WorkspaceResourceDialog.openFileSelection(getShell(), null, null, false, new Object[]{ currentFile }, filters);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
index 1969025a9e4..87fc19a10b3 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/transforms/profile2datacontext.qvto
@@ -46,9 +46,14 @@ mapping Package::toDCPackage() : DataContextPackage disjuncts
abstract mapping Package::toAbstractDCPackage() : DataContextPackage {
name := self.name;
- elements := self.getClassifiers().map toDCElement().element->union(
- self.packagedElement->select(e | e.oclIsKindOf(Package)).oclAsType(Package)->map toDataContextPackage()
- );
+
+ var mappedElements := self.getClassifiers().map toDCElement();
+
+ elements := mappedElements.element
+ ->union(
+ self.packagedElement->select(e | e.oclIsKindOf(Package)).oclAsType(Package)->map toDataContextPackage()
+ )
+ ;
}
mapping Package::toDataContextPackage() : DataContextPackage inherits Package::toAbstractDCPackage when {
@@ -148,10 +153,7 @@ query UML::Property::isAttribute(stereo : Stereotype) : Boolean{
mapping UML::Property::toProperty() : PropertyContext::Property {
name := self.name;
type := self.type.getType();
-
- if self.type.isView() then
- self.type.oclAsType(Classifier).map toDCElement()
- endif;
+ multiplicity := if self.upperBound() > 1 or self.upperBound() = -1 then -1 else 1 endif;
description := profile.objectsOfType(UML::Comment)->select(comment | comment.annotatedElement->includes(self))->any(comment | true).body
}
@@ -166,7 +168,9 @@ query UML::Type::getType() : PropertyEnvironment::Type {
case (self.name = "String") type := PropertyEnvironment::Type::String;
case (self.name = "Integer") type := PropertyEnvironment::Type::Integer;
case (self.name = "Boolean") type := PropertyEnvironment::Type::Boolean;
+ case (self.name = "Real") type := PropertyEnvironment::Type::String;
};
+ case (self.oclIsTypeOf(DataType)) type := PropertyEnvironment::Type::Reference;
};
return type;
}

Back to the top