Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglefur2009-07-31 14:12:53 +0000
committerglefur2009-07-31 14:12:53 +0000
commitd9f35f2c48399cc72a38824def5276ca0c8010b0 (patch)
tree0cc02d30211fe9b4bee1dda62800635ce6ff6ed7 /plugins/org.eclipse.emf.eef.components.edit
parent3792cfc57b535ebb0f3e0c5b6ac21bdad245d78f (diff)
downloadorg.eclipse.eef-d9f35f2c48399cc72a38824def5276ca0c8010b0.tar.gz
org.eclipse.eef-d9f35f2c48399cc72a38824def5276ca0c8010b0.tar.xz
org.eclipse.eef-d9f35f2c48399cc72a38824def5276ca0c8010b0.zip
Synchronized code for new generation
Diffstat (limited to 'plugins/org.eclipse.emf.eef.components.edit')
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/components_properties.plugin.xml16
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentBasePropertiesEditionComponent.java89
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentPropertiesEditionComponent.java10
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextBasePropertiesEditionComponent.java44
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextPropertiesEditionComponent.java10
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementBasePropertiesEditionComponent.java94
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementPropertiesEditionComponent.java10
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementBasePropertiesEditionComponent.java91
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementPropertiesEditionComponent.java10
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/ComponentsViewsRepository.java52
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/DocumentationPropertiesEditionPart.java4
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionComponentPropertiesEditionPart.java18
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionContextPropertiesEditionPart.java11
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionElementPropertiesEditionPart.java18
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesMultiEditionElementPropertiesEditionPart.java18
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/DocumentationPropertiesEditionPartForm.java33
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionComponentPropertiesEditionPartForm.java102
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionContextPropertiesEditionPartForm.java46
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionElementPropertiesEditionPartForm.java94
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesMultiEditionElementPropertiesEditionPartForm.java98
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/DocumentationPropertiesEditionPartImpl.java28
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionComponentPropertiesEditionPartImpl.java83
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionContextPropertiesEditionPartImpl.java41
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionElementPropertiesEditionPartImpl.java79
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesMultiEditionElementPropertiesEditionPartImpl.java82
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsMessages.java3
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionPolicyProvider.java4
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionProvider.java2
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPropertiesEditionPartProvider.java2
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionComponentPropertiesEditionProvider.java11
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionContextPropertiesEditionProvider.java11
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionElementPropertiesEditionProvider.java11
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesMultiEditionElementPropertiesEditionProvider.java11
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages.properties58
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages_fr.properties69
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/components/DocumentedElementPropertiesEditionComponent.java42
-rw-r--r--plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/providers/DocumentedElementPropertiesEditionProvider.java9
37 files changed, 1026 insertions, 388 deletions
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/components_properties.plugin.xml b/plugins/org.eclipse.emf.eef.components.edit/src-gen/components_properties.plugin.xml
index 9c30e1a26..7e4da1cce 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/components_properties.plugin.xml
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/components_properties.plugin.xml
@@ -58,7 +58,7 @@
<propertySections
contributorId="org.eclipse.emf.eef.components.properties">
<propertySection
- tab="Documentation"
+ tab="Base"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionContext">
<input
@@ -66,7 +66,7 @@
</input>
</propertySection>
<propertySection
- tab="Base"
+ tab="Documentation"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionContext">
<input
@@ -74,7 +74,7 @@
</input>
</propertySection>
<propertySection
- tab="Base"
+ tab="Documentation"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionComponent">
<input
@@ -82,7 +82,7 @@
</input>
</propertySection>
<propertySection
- tab="Documentation"
+ tab="Base"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionComponent">
<input
@@ -90,7 +90,7 @@
</input>
</propertySection>
<propertySection
- tab="Documentation"
+ tab="Base"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionElement">
<input
@@ -98,7 +98,7 @@
</input>
</propertySection>
<propertySection
- tab="Base"
+ tab="Documentation"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesEditionElement">
<input
@@ -106,7 +106,7 @@
</input>
</propertySection>
<propertySection
- tab="Documentation"
+ tab="Base"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesMultiEditionElement">
<input
@@ -114,7 +114,7 @@
</input>
</propertySection>
<propertySection
- tab="Base"
+ tab="Documentation"
class="org.eclipse.emf.eef.runtime.ui.properties.sections.PropertiesEditionSection"
id="org.eclipse.emf.eef.components.section.PropertiesMultiEditionElement">
<input
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentBasePropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentBasePropertiesEditionComponent.java
index bb27ac614..eb93a1e15 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentBasePropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentBasePropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentBasePropertiesEditionComponent.java,v 1.7 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionComponentBasePropertiesEditionComponent.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -26,6 +26,7 @@ import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EContentAdapter;
@@ -40,6 +41,7 @@ import org.eclipse.emf.eef.components.PropertiesEditionComponent;
import org.eclipse.emf.eef.components.parts.ComponentsViewsRepository;
import org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart;
import org.eclipse.emf.eef.mapping.MappingPackage;
+import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
@@ -49,12 +51,14 @@ import org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesContextService;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPartProviderService;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.views.ViewsPackage;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -186,13 +190,15 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
if (basePart != null && key == ComponentsViewsRepository.PropertiesEditionComponent.class) {
((IPropertiesEditionPart)basePart).setContext(elt, allResource);
- PropertiesEditionComponent propertiesEditionComponent = (PropertiesEditionComponent)elt;
+ final PropertiesEditionComponent propertiesEditionComponent = (PropertiesEditionComponent)elt;
// init values
if (propertiesEditionComponent.getName() != null)
basePart.setName(propertiesEditionComponent.getName());
basePart.initViews(propertiesEditionComponent, null, MappingPackage.eINSTANCE.getAbstractElementBinding_Views());
basePart.initModel(allResource, propertiesEditionComponent.getModel());
+ // set the button mode
+ basePart.setModelButtonMode(ButtonsModeEnum.BROWSE);
if (propertiesEditionComponent.getHelpID() != null)
basePart.setHelpID(propertiesEditionComponent.getHelpID());
@@ -210,8 +216,8 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof EObject)
- return (!basePart.getViewsTable().contains(element));
- return false;
+ return (!basePart.isContainedInViewsTable((EObject)element));
+ return element instanceof Resource;
}
});
@@ -228,6 +234,7 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof EClassifier);
+
}
});
@@ -245,6 +252,12 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
+
+
+
+
+
+
/**
* {@inheritDoc}
*
@@ -256,18 +269,20 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
if (propertiesEditionComponent != null) {
cc.append(SetCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getAbstractElementBinding_Name(), basePart.getName()));
- List viewsToAdd = basePart.getViewsToAdd();
- for (Iterator iter = viewsToAdd.iterator(); iter.hasNext();)
+ List viewsToAddFromViews = basePart.getViewsToAdd();
+ for (Iterator iter = viewsToAddFromViews.iterator(); iter.hasNext();)
cc.append(AddCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getAbstractElementBinding_Views(), iter.next()));
- List viewsToRemove = basePart.getViewsToRemove();
- for (Iterator iter = viewsToRemove.iterator(); iter.hasNext();)
+ List viewsToRemoveFromViews = basePart.getViewsToRemove();
+ for (Iterator iter = viewsToRemoveFromViews.iterator(); iter.hasNext();)
cc.append(RemoveCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getAbstractElementBinding_Views(), iter.next()));
- //List viewsToMove = basePart.getViewsToMove();
- //for (Iterator iter = viewsToMove.iterator(); iter.hasNext();){
+ //List viewsToMoveFromViews = basePart.getViewsToMove();
+ //for (Iterator iter = viewsToMoveFromViews.iterator(); iter.hasNext();){
// org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement moveElement = (org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement)iter.next();
// cc.append(MoveCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getView(), moveElement.getElement(), moveElement.getIndex()));
//}
- cc.append(SetCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getEMFElementBinding_Model(), basePart.getModel()));
+ if (propertiesEditionComponent.eGet(MappingPackage.eINSTANCE.getEMFElementBinding_Model()) == null || !propertiesEditionComponent.eGet(MappingPackage.eINSTANCE.getEMFElementBinding_Model()).equals(basePart.getModel())) {
+ cc.append(SetCommand.create(editingDomain, propertiesEditionComponent, MappingPackage.eINSTANCE.getEMFElementBinding_Model(), basePart.getModel()));
+ }
cc.append(SetCommand.create(editingDomain, propertiesEditionComponent, ComponentsPackage.eINSTANCE.getEEFElement_HelpID(), basePart.getHelpID()));
cc.append(SetCommand.create(editingDomain, propertiesEditionComponent, ComponentsPackage.eINSTANCE.getPropertiesEditionComponent_Explicit(), basePart.getExplicit()));
@@ -335,7 +350,11 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
- liveEditingDomain.getCommandStack().execute(command);
+ if (!command.isEmpty() && !command.canExecute()) {
+ EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
+ } else {
+ liveEditingDomain.getCommandStack().execute(command);
+ }
} else if (PropertiesEditionEvent.CHANGE == event.getState()) {
Diagnostic diag = this.validateValue(event);
if (diag != null && diag.getSeverity() != Diagnostic.OK) {
@@ -396,24 +415,26 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
*/
public Diagnostic validateValue(PropertiesEditionEvent event) {
- String newStringValue = event.getNewValue().toString();
Diagnostic ret = null;
- try {
- if (ComponentsViewsRepository.PropertiesEditionComponent.name == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractElementBinding_Name().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractElementBinding_Name().getEAttributeType(), newValue);
- }
- if (ComponentsViewsRepository.PropertiesEditionComponent.helpID == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
- }
- if (ComponentsViewsRepository.PropertiesEditionComponent.explicit == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getPropertiesEditionComponent_Explicit().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getPropertiesEditionComponent_Explicit().getEAttributeType(), newValue);
- }
+ if (event.getNewValue() != null) {
+ String newStringValue = event.getNewValue().toString();
+ try {
+ if (ComponentsViewsRepository.PropertiesEditionComponent.name == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractElementBinding_Name().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractElementBinding_Name().getEAttributeType(), newValue);
+ }
+ if (ComponentsViewsRepository.PropertiesEditionComponent.helpID == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
+ }
+ if (ComponentsViewsRepository.PropertiesEditionComponent.explicit == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getPropertiesEditionComponent_Explicit().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getPropertiesEditionComponent_Explicit().getEAttributeType(), newValue);
+ }
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
+ } catch (IllegalArgumentException iae) {
+ ret = BasicDiagnostic.toDiagnostic(iae);
+ }
}
return ret;
}
@@ -424,15 +445,19 @@ public class PropertiesEditionComponentBasePropertiesEditionComponent extends St
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
*/
public Diagnostic validate() {
+ Diagnostic validate = null;
if (IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- return Diagnostician.INSTANCE.validate(copy);
+ validate = Diagnostician.INSTANCE.validate(copy);
}
else if (IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- return Diagnostician.INSTANCE.validate(propertiesEditionComponent);
- else
- return null;
+ validate = Diagnostician.INSTANCE.validate(propertiesEditionComponent);
+ // Start of user code for custom validation check
+
+ // End of user code
+
+ return validate;
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentPropertiesEditionComponent.java
index ee8d86458..ce4be8410 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentPropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionComponentPropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentPropertiesEditionComponent.java,v 1.6 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionComponentPropertiesEditionComponent.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -25,6 +25,7 @@ import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -55,7 +56,7 @@ public class PropertiesEditionComponentPropertiesEditionComponent extends Compos
if (propertiesEditionComponent instanceof PropertiesEditionComponent) {
propertiesEditionComponentBasePropertiesEditionComponent = new PropertiesEditionComponentBasePropertiesEditionComponent(propertiesEditionComponent, editing_mode);
addSubComponent(propertiesEditionComponentBasePropertiesEditionComponent);
- documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionComponent, editing_mode);
+ documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionComponent, editing_mode);
addSubComponent(documentedElementPropertiesEditionComponent);
}
}
@@ -94,6 +95,11 @@ public class PropertiesEditionComponentPropertiesEditionComponent extends Compos
if (key == ComponentsViewsRepository.PropertiesEditionComponent.class) {
super.initPart(key, kind, element, allResource);
}
+ if (key == ComponentsViewsRepository.Documentation.class) {
+ super.initPart(key, kind, element, allResource);
+
+
+ }
}
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextBasePropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextBasePropertiesEditionComponent.java
index 5b5aa6e50..ee289e535 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextBasePropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextBasePropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextBasePropertiesEditionComponent.java,v 1.7 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionContextBasePropertiesEditionComponent.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -33,6 +33,7 @@ import org.eclipse.emf.eef.components.ComponentsPackage;
import org.eclipse.emf.eef.components.PropertiesEditionContext;
import org.eclipse.emf.eef.components.parts.ComponentsViewsRepository;
import org.eclipse.emf.eef.components.parts.PropertiesEditionContextPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
@@ -41,10 +42,12 @@ import org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComp
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesContextService;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPartProviderService;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -165,9 +168,11 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
if (basePart != null && key == ComponentsViewsRepository.PropertiesEditionContext.class) {
((IPropertiesEditionPart)basePart).setContext(elt, allResource);
- PropertiesEditionContext propertiesEditionContext = (PropertiesEditionContext)elt;
+ final PropertiesEditionContext propertiesEditionContext = (PropertiesEditionContext)elt;
// init values
basePart.initModel(allResource, propertiesEditionContext.getModel());
+ // set the button mode
+ basePart.setModelButtonMode(ButtonsModeEnum.BROWSE);
// init filters
basePart.addFilterToModel(new ViewerFilter() {
@@ -179,6 +184,7 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof GenPackage);
+
}
});
@@ -194,6 +200,8 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
+
+
/**
* {@inheritDoc}
*
@@ -203,7 +211,9 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
public CompoundCommand getPropertiesEditionCommand(EditingDomain editingDomain) {
CompoundCommand cc = new CompoundCommand();
if (propertiesEditionContext != null) {
- cc.append(SetCommand.create(editingDomain, propertiesEditionContext, ComponentsPackage.eINSTANCE.getPropertiesEditionContext_Model(), basePart.getModel()));
+ if (propertiesEditionContext.eGet(ComponentsPackage.eINSTANCE.getPropertiesEditionContext_Model()) == null || !propertiesEditionContext.eGet(ComponentsPackage.eINSTANCE.getPropertiesEditionContext_Model()).equals(basePart.getModel())) {
+ cc.append(SetCommand.create(editingDomain, propertiesEditionContext, ComponentsPackage.eINSTANCE.getPropertiesEditionContext_Model(), basePart.getModel()));
+ }
}
@@ -243,7 +253,11 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
command.append(SetCommand.create(liveEditingDomain, propertiesEditionContext, ComponentsPackage.eINSTANCE.getPropertiesEditionContext_Model(), event.getNewValue()));
- liveEditingDomain.getCommandStack().execute(command);
+ if (!command.isEmpty() && !command.canExecute()) {
+ EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
+ } else {
+ liveEditingDomain.getCommandStack().execute(command);
+ }
} else if (PropertiesEditionEvent.CHANGE == event.getState()) {
Diagnostic diag = this.validateValue(event);
if (diag != null && diag.getSeverity() != Diagnostic.OK) {
@@ -284,12 +298,14 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
*/
public Diagnostic validateValue(PropertiesEditionEvent event) {
- String newStringValue = event.getNewValue().toString();
Diagnostic ret = null;
- try {
+ if (event.getNewValue() != null) {
+ String newStringValue = event.getNewValue().toString();
+ try {
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
+ } catch (IllegalArgumentException iae) {
+ ret = BasicDiagnostic.toDiagnostic(iae);
+ }
}
return ret;
}
@@ -300,15 +316,19 @@ public class PropertiesEditionContextBasePropertiesEditionComponent extends Stan
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
*/
public Diagnostic validate() {
+ Diagnostic validate = null;
if (IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- return Diagnostician.INSTANCE.validate(copy);
+ validate = Diagnostician.INSTANCE.validate(copy);
}
else if (IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- return Diagnostician.INSTANCE.validate(propertiesEditionContext);
- else
- return null;
+ validate = Diagnostician.INSTANCE.validate(propertiesEditionContext);
+ // Start of user code for custom validation check
+
+ // End of user code
+
+ return validate;
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextPropertiesEditionComponent.java
index 1d8e2015d..ce5e481ee 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextPropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionContextPropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextPropertiesEditionComponent.java,v 1.6 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionContextPropertiesEditionComponent.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -25,6 +25,7 @@ import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -55,7 +56,7 @@ public class PropertiesEditionContextPropertiesEditionComponent extends Composed
if (propertiesEditionContext instanceof PropertiesEditionContext) {
propertiesEditionContextBasePropertiesEditionComponent = new PropertiesEditionContextBasePropertiesEditionComponent(propertiesEditionContext, editing_mode);
addSubComponent(propertiesEditionContextBasePropertiesEditionComponent);
- documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionContext, editing_mode);
+ documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionContext, editing_mode);
addSubComponent(documentedElementPropertiesEditionComponent);
}
}
@@ -94,6 +95,11 @@ public class PropertiesEditionContextPropertiesEditionComponent extends Composed
if (key == ComponentsViewsRepository.PropertiesEditionContext.class) {
super.initPart(key, kind, element, allResource);
}
+ if (key == ComponentsViewsRepository.Documentation.class) {
+ super.initPart(key, kind, element, allResource);
+
+
+ }
}
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementBasePropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementBasePropertiesEditionComponent.java
index de2bc98ad..3192f69b7 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementBasePropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementBasePropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementBasePropertiesEditionComponent.java,v 1.7 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionElementBasePropertiesEditionComponent.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -27,6 +27,7 @@ import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EContentAdapter;
@@ -41,21 +42,25 @@ import org.eclipse.emf.eef.components.PropertiesEditionElement;
import org.eclipse.emf.eef.components.parts.ComponentsViewsRepository;
import org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart;
import org.eclipse.emf.eef.mapping.MappingPackage;
+import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPartProvider;
import org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesContextService;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPartProviderService;
import org.eclipse.emf.eef.runtime.impl.utils.EEFUtils;
-import org.eclipse.emf.eef.views.ElementEditor;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
+import org.eclipse.emf.eef.views.ViewsPackage;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -184,13 +189,15 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
if (basePart != null && key == ComponentsViewsRepository.PropertiesEditionElement.class) {
((IPropertiesEditionPart)basePart).setContext(elt, allResource);
- PropertiesEditionElement propertiesEditionElement = (PropertiesEditionElement)elt;
+ final PropertiesEditionElement propertiesEditionElement = (PropertiesEditionElement)elt;
// init values
if (propertiesEditionElement.getName() != null)
basePart.setName(propertiesEditionElement.getName());
basePart.initViews(propertiesEditionElement, null, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views());
basePart.initModel(allResource, propertiesEditionElement.getModel());
+ // set the button mode
+ basePart.setModelButtonMode(ButtonsModeEnum.BROWSE);
if (propertiesEditionElement.getHelpID() != null)
basePart.setHelpID(propertiesEditionElement.getHelpID());
@@ -205,10 +212,13 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
- return element instanceof ElementEditor && !basePart.getViewsTable().contains(element);
+ if (element instanceof EObject)
+ return (!basePart.isContainedInViewsTable((EObject)element));
+ return element instanceof Resource;
}
});
+ basePart.addFilterToViews(new EObjectFilter(ViewsPackage.eINSTANCE.getElementEditor()));
basePart.addFilterToViews(new ViewerFilter() {
/*
@@ -217,13 +227,13 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
- Object result = EEFUtils.choiceOfValues(PropertiesEditionElementBasePropertiesEditionComponent.this.propertiesEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views(), (ResourceSet)parentElement);
- if (result instanceof Collection){
+ Object result = EEFUtils.choiceOfValues(PropertiesEditionElementBasePropertiesEditionComponent.this.propertiesEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views());
+ if (result instanceof Collection) {
return ((Collection)result).contains(element);
- }else if (result instanceof ResourceSet){
- return element instanceof EObject && ((EObject)element).eResource() !=null && ((EObject)element).eResource().getResourceSet() != null && ((EObject)element).eResource().getResourceSet().equals(result);
+ } else if (result instanceof ResourceSet && element instanceof EObject) {
+ return ((EObject)element).eResource() != null && ((EObject)element).eResource().getResourceSet() != null && ((EObject)element).eResource().getResourceSet().equals(result);
}
- return false;
+ return element instanceof Resource;
}
});
// Start of user code for additional businessfilters for views
@@ -238,6 +248,7 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof EStructuralFeature);
+
}
});
@@ -254,6 +265,11 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
+
+
+
+
+
/**
* {@inheritDoc}
*
@@ -265,18 +281,20 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
if (propertiesEditionElement != null) {
cc.append(SetCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name(), basePart.getName()));
- List viewsToAdd = basePart.getViewsToAdd();
- for (Iterator iter = viewsToAdd.iterator(); iter.hasNext();)
+ List viewsToAddFromViews = basePart.getViewsToAdd();
+ for (Iterator iter = viewsToAddFromViews.iterator(); iter.hasNext();)
cc.append(AddCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views(), iter.next()));
- List viewsToRemove = basePart.getViewsToRemove();
- for (Iterator iter = viewsToRemove.iterator(); iter.hasNext();)
+ List viewsToRemoveFromViews = basePart.getViewsToRemove();
+ for (Iterator iter = viewsToRemoveFromViews.iterator(); iter.hasNext();)
cc.append(RemoveCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views(), iter.next()));
- //List viewsToMove = basePart.getViewsToMove();
- //for (Iterator iter = viewsToMove.iterator(); iter.hasNext();){
+ //List viewsToMoveFromViews = basePart.getViewsToMove();
+ //for (Iterator iter = viewsToMoveFromViews.iterator(); iter.hasNext();){
// org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement moveElement = (org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement)iter.next();
// cc.append(MoveCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getElementEditor(), moveElement.getElement(), moveElement.getIndex()));
//}
- cc.append(SetCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getEMFPropertyBinding_Model(), basePart.getModel()));
+ if (propertiesEditionElement.eGet(MappingPackage.eINSTANCE.getEMFPropertyBinding_Model()) == null || !propertiesEditionElement.eGet(MappingPackage.eINSTANCE.getEMFPropertyBinding_Model()).equals(basePart.getModel())) {
+ cc.append(SetCommand.create(editingDomain, propertiesEditionElement, MappingPackage.eINSTANCE.getEMFPropertyBinding_Model(), basePart.getModel()));
+ }
cc.append(SetCommand.create(editingDomain, propertiesEditionElement, ComponentsPackage.eINSTANCE.getEEFElement_HelpID(), basePart.getHelpID()));
@@ -337,7 +355,11 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
- liveEditingDomain.getCommandStack().execute(command);
+ if (!command.isEmpty() && !command.canExecute()) {
+ EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
+ } else {
+ liveEditingDomain.getCommandStack().execute(command);
+ }
} else if (PropertiesEditionEvent.CHANGE == event.getState()) {
Diagnostic diag = this.validateValue(event);
if (diag != null && diag.getSeverity() != Diagnostic.OK) {
@@ -394,20 +416,22 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
*/
public Diagnostic validateValue(PropertiesEditionEvent event) {
- String newStringValue = event.getNewValue().toString();
Diagnostic ret = null;
- try {
- if (ComponentsViewsRepository.PropertiesEditionElement.name == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newValue);
- }
- if (ComponentsViewsRepository.PropertiesEditionElement.helpID == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
- }
+ if (event.getNewValue() != null) {
+ String newStringValue = event.getNewValue().toString();
+ try {
+ if (ComponentsViewsRepository.PropertiesEditionElement.name == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newValue);
+ }
+ if (ComponentsViewsRepository.PropertiesEditionElement.helpID == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
+ }
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
+ } catch (IllegalArgumentException iae) {
+ ret = BasicDiagnostic.toDiagnostic(iae);
+ }
}
return ret;
}
@@ -418,15 +442,19 @@ public class PropertiesEditionElementBasePropertiesEditionComponent extends Stan
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
*/
public Diagnostic validate() {
+ Diagnostic validate = null;
if (IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- return Diagnostician.INSTANCE.validate(copy);
+ validate = Diagnostician.INSTANCE.validate(copy);
}
else if (IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- return Diagnostician.INSTANCE.validate(propertiesEditionElement);
- else
- return null;
+ validate = Diagnostician.INSTANCE.validate(propertiesEditionElement);
+ // Start of user code for custom validation check
+
+ // End of user code
+
+ return validate;
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementPropertiesEditionComponent.java
index d4951bca3..81bea10b1 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementPropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesEditionElementPropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementPropertiesEditionComponent.java,v 1.6 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesEditionElementPropertiesEditionComponent.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -25,6 +25,7 @@ import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -55,7 +56,7 @@ public class PropertiesEditionElementPropertiesEditionComponent extends Composed
if (propertiesEditionElement instanceof PropertiesEditionElement) {
propertiesEditionElementBasePropertiesEditionComponent = new PropertiesEditionElementBasePropertiesEditionComponent(propertiesEditionElement, editing_mode);
addSubComponent(propertiesEditionElementBasePropertiesEditionComponent);
- documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionElement, editing_mode);
+ documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesEditionElement, editing_mode);
addSubComponent(documentedElementPropertiesEditionComponent);
}
}
@@ -94,6 +95,11 @@ public class PropertiesEditionElementPropertiesEditionComponent extends Composed
if (key == ComponentsViewsRepository.PropertiesEditionElement.class) {
super.initPart(key, kind, element, allResource);
}
+ if (key == ComponentsViewsRepository.Documentation.class) {
+ super.initPart(key, kind, element, allResource);
+
+
+ }
}
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementBasePropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementBasePropertiesEditionComponent.java
index 501b690cf..b18b8995f 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementBasePropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementBasePropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementBasePropertiesEditionComponent.java,v 1.7 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementBasePropertiesEditionComponent.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -25,7 +25,8 @@ import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EContentAdapter;
@@ -40,6 +41,7 @@ import org.eclipse.emf.eef.components.PropertiesMultiEditionElement;
import org.eclipse.emf.eef.components.parts.ComponentsViewsRepository;
import org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart;
import org.eclipse.emf.eef.mapping.MappingPackage;
+import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
@@ -55,6 +57,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -183,7 +186,7 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
if (basePart != null && key == ComponentsViewsRepository.PropertiesMultiEditionElement.class) {
((IPropertiesEditionPart)basePart).setContext(elt, allResource);
- PropertiesMultiEditionElement propertiesMultiEditionElement = (PropertiesMultiEditionElement)elt;
+ final PropertiesMultiEditionElement propertiesMultiEditionElement = (PropertiesMultiEditionElement)elt;
// init values
if (propertiesMultiEditionElement.getName() != null)
basePart.setName(propertiesMultiEditionElement.getName());
@@ -205,8 +208,8 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof EObject)
- return (!basePart.getViewsTable().contains(element));
- return false;
+ return (!basePart.isContainedInViewsTable((EObject)element));
+ return element instanceof Resource;
}
});
@@ -222,10 +225,13 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
- return element instanceof EStructuralFeature && !basePart.getModelTable().contains(element);
+ if (element instanceof EObject)
+ return (!basePart.isContainedInModelTable((EObject)element));
+ return element instanceof Resource;
}
});
+ basePart.addFilterToModel(new EObjectFilter(EcorePackage.eINSTANCE.getEStructuralFeature()));
// Start of user code for additional businessfilters for model
// End of user code
@@ -239,6 +245,11 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
+
+
+
+
+
/**
* {@inheritDoc}
*
@@ -250,25 +261,25 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
if (propertiesMultiEditionElement != null) {
cc.append(SetCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name(), basePart.getName()));
- List viewsToAdd = basePart.getViewsToAdd();
- for (Iterator iter = viewsToAdd.iterator(); iter.hasNext();)
+ List viewsToAddFromViews = basePart.getViewsToAdd();
+ for (Iterator iter = viewsToAddFromViews.iterator(); iter.hasNext();)
cc.append(AddCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views(), iter.next()));
- List viewsToRemove = basePart.getViewsToRemove();
- for (Iterator iter = viewsToRemove.iterator(); iter.hasNext();)
+ List viewsToRemoveFromViews = basePart.getViewsToRemove();
+ for (Iterator iter = viewsToRemoveFromViews.iterator(); iter.hasNext();)
cc.append(RemoveCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getAbstractPropertyBinding_Views(), iter.next()));
- //List viewsToMove = basePart.getViewsToMove();
- //for (Iterator iter = viewsToMove.iterator(); iter.hasNext();){
+ //List viewsToMoveFromViews = basePart.getViewsToMove();
+ //for (Iterator iter = viewsToMoveFromViews.iterator(); iter.hasNext();){
// org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement moveElement = (org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement)iter.next();
// cc.append(MoveCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getElementEditor(), moveElement.getElement(), moveElement.getIndex()));
//}
- List modelToAdd = basePart.getModelToAdd();
- for (Iterator iter = modelToAdd.iterator(); iter.hasNext();)
+ List modelToAddFromModel = basePart.getModelToAdd();
+ for (Iterator iter = modelToAddFromModel.iterator(); iter.hasNext();)
cc.append(AddCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getEMFMultiPropertiesBinding_Model(), iter.next()));
- List modelToRemove = basePart.getModelToRemove();
- for (Iterator iter = modelToRemove.iterator(); iter.hasNext();)
+ List modelToRemoveFromModel = basePart.getModelToRemove();
+ for (Iterator iter = modelToRemoveFromModel.iterator(); iter.hasNext();)
cc.append(RemoveCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getEMFMultiPropertiesBinding_Model(), iter.next()));
- //List modelToMove = basePart.getModelToMove();
- //for (Iterator iter = modelToMove.iterator(); iter.hasNext();){
+ //List modelToMoveFromModel = basePart.getModelToMove();
+ //for (Iterator iter = modelToMoveFromModel.iterator(); iter.hasNext();){
// org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement moveElement = (org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil.MoveElement)iter.next();
// cc.append(MoveCommand.create(editingDomain, propertiesMultiEditionElement, MappingPackage.eINSTANCE.getEStructuralFeature(), moveElement.getElement(), moveElement.getIndex()));
//}
@@ -338,7 +349,11 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
- liveEditingDomain.getCommandStack().execute(command);
+ if (!command.isEmpty() && !command.canExecute()) {
+ EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
+ } else {
+ liveEditingDomain.getCommandStack().execute(command);
+ }
} else if (PropertiesEditionEvent.CHANGE == event.getState()) {
Diagnostic diag = this.validateValue(event);
if (diag != null && diag.getSeverity() != Diagnostic.OK) {
@@ -395,20 +410,22 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
*/
public Diagnostic validateValue(PropertiesEditionEvent event) {
- String newStringValue = event.getNewValue().toString();
Diagnostic ret = null;
- try {
- if (ComponentsViewsRepository.PropertiesMultiEditionElement.name == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newValue);
- }
- if (ComponentsViewsRepository.PropertiesMultiEditionElement.helpID == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
- }
+ if (event.getNewValue() != null) {
+ String newStringValue = event.getNewValue().toString();
+ try {
+ if (ComponentsViewsRepository.PropertiesMultiEditionElement.name == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getAbstractPropertyBinding_Name().getEAttributeType(), newValue);
+ }
+ if (ComponentsViewsRepository.PropertiesMultiEditionElement.helpID == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(ComponentsPackage.eINSTANCE.getEEFElement_HelpID().getEAttributeType(), newValue);
+ }
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
+ } catch (IllegalArgumentException iae) {
+ ret = BasicDiagnostic.toDiagnostic(iae);
+ }
}
return ret;
}
@@ -419,15 +436,19 @@ public class PropertiesMultiEditionElementBasePropertiesEditionComponent extends
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
*/
public Diagnostic validate() {
+ Diagnostic validate = null;
if (IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- return Diagnostician.INSTANCE.validate(copy);
+ validate = Diagnostician.INSTANCE.validate(copy);
}
else if (IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- return Diagnostician.INSTANCE.validate(propertiesMultiEditionElement);
- else
- return null;
+ validate = Diagnostician.INSTANCE.validate(propertiesMultiEditionElement);
+ // Start of user code for custom validation check
+
+ // End of user code
+
+ return validate;
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementPropertiesEditionComponent.java
index c034367ea..c88a5dce7 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementPropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/components/PropertiesMultiEditionElementPropertiesEditionComponent.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementPropertiesEditionComponent.java,v 1.6 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementPropertiesEditionComponent.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.components;
@@ -25,6 +25,7 @@ import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -55,7 +56,7 @@ public class PropertiesMultiEditionElementPropertiesEditionComponent extends Com
if (propertiesMultiEditionElement instanceof PropertiesMultiEditionElement) {
propertiesMultiEditionElementBasePropertiesEditionComponent = new PropertiesMultiEditionElementBasePropertiesEditionComponent(propertiesMultiEditionElement, editing_mode);
addSubComponent(propertiesMultiEditionElementBasePropertiesEditionComponent);
- documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesMultiEditionElement, editing_mode);
+ documentedElementPropertiesEditionComponent = new DocumentedElementPropertiesEditionComponent(propertiesMultiEditionElement, editing_mode);
addSubComponent(documentedElementPropertiesEditionComponent);
}
}
@@ -94,6 +95,11 @@ public class PropertiesMultiEditionElementPropertiesEditionComponent extends Com
if (key == ComponentsViewsRepository.PropertiesMultiEditionElement.class) {
super.initPart(key, kind, element, allResource);
}
+ if (key == ComponentsViewsRepository.Documentation.class) {
+ super.initPart(key, kind, element, allResource);
+
+
+ }
}
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/ComponentsViewsRepository.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/ComponentsViewsRepository.java
index 5931b2ff6..ee4ab934e 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/ComponentsViewsRepository.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/ComponentsViewsRepository.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: ComponentsViewsRepository.java,v 1.6 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: ComponentsViewsRepository.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -27,9 +27,7 @@ public class ComponentsViewsRepository {
* Documentation view descriptor
*/
public static class Documentation {
-
- public static String documentation = "components::Documentation::documentation";
-
+ public static String documentation = "components::Documentation::documentation";
}
@@ -38,9 +36,7 @@ public class ComponentsViewsRepository {
* PropertiesEditionContext view descriptor
*/
public static class PropertiesEditionContext {
-
- public static String model = "components::PropertiesEditionContext::model";
-
+ public static String model = "components::PropertiesEditionContext::model";
}
@@ -49,22 +45,16 @@ public class ComponentsViewsRepository {
* PropertiesEditionComponent view descriptor
*/
public static class PropertiesEditionComponent {
+ public static String name = "components::PropertiesEditionComponent::name";
- public static String name = "components::PropertiesEditionComponent::name";
-
-
- public static String helpID = "components::PropertiesEditionComponent::helpID";
-
-
- public static String explicit = "components::PropertiesEditionComponent::explicit";
-
-
+ public static String helpID = "components::PropertiesEditionComponent::helpID";
- public static String model = "components::PropertiesEditionComponent::model";
+ public static String explicit = "components::PropertiesEditionComponent::explicit";
- public static String views = "components::PropertiesEditionComponent::views";
+ public static String model = "components::PropertiesEditionComponent::model";
+ public static String views = "components::PropertiesEditionComponent::views";
}
@@ -73,19 +63,14 @@ public class ComponentsViewsRepository {
* PropertiesEditionElement view descriptor
*/
public static class PropertiesEditionElement {
+ public static String name = "components::PropertiesEditionElement::name";
- public static String name = "components::PropertiesEditionElement::name";
+ public static String helpID = "components::PropertiesEditionElement::helpID";
- public static String helpID = "components::PropertiesEditionElement::helpID";
-
-
-
- public static String model = "components::PropertiesEditionElement::model";
-
-
- public static String views = "components::PropertiesEditionElement::views";
+ public static String model = "components::PropertiesEditionElement::model";
+ public static String views = "components::PropertiesEditionElement::views";
}
@@ -94,19 +79,14 @@ public class ComponentsViewsRepository {
* PropertiesMultiEditionElement view descriptor
*/
public static class PropertiesMultiEditionElement {
+ public static String name = "components::PropertiesMultiEditionElement::name";
- public static String name = "components::PropertiesMultiEditionElement::name";
-
-
- public static String helpID = "components::PropertiesMultiEditionElement::helpID";
-
-
-
- public static String model = "components::PropertiesMultiEditionElement::model";
+ public static String helpID = "components::PropertiesMultiEditionElement::helpID";
- public static String views = "components::PropertiesMultiEditionElement::views";
+ public static String model = "components::PropertiesMultiEditionElement::model";
+ public static String views = "components::PropertiesMultiEditionElement::views";
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/DocumentationPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/DocumentationPropertiesEditionPart.java
index 545a2c13a..7dbc9b495 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/DocumentationPropertiesEditionPart.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/DocumentationPropertiesEditionPart.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: DocumentationPropertiesEditionPart.java,v 1.6 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: DocumentationPropertiesEditionPart.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -19,6 +19,7 @@ package org.eclipse.emf.eef.components.parts;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -47,5 +48,6 @@ public interface DocumentationPropertiesEditionPart {
// Start of user code for additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionComponentPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionComponentPropertiesEditionPart.java
index 2023c4056..2aa2835e1 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionComponentPropertiesEditionPart.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionComponentPropertiesEditionPart.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentPropertiesEditionPart.java,v 1.7 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionComponentPropertiesEditionPart.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -20,10 +20,12 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -93,6 +95,12 @@ public interface PropertiesEditionComponentPropertiesEditionPart {
public void setModel(EObject newValue);
/**
+ * Defines the button mode
+ * @param newValue the new mode to set
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue);
+
+ /**
* Adds the given filter to the model edition editor.
*
* @param filter
@@ -125,7 +133,7 @@ public interface PropertiesEditionComponentPropertiesEditionPart {
public List getViewsToRemove();
/**
- * @return the current views
+ * @return the current views table
*/
public List getViewsTable();
@@ -161,6 +169,11 @@ public interface PropertiesEditionComponentPropertiesEditionPart {
*/
public void addBusinessFilterToViews(ViewerFilter filter);
+ /**
+ * @return true if the given element is contained inside the views table
+ */
+ public boolean isContainedInViewsTable(EObject element);
+
@@ -173,5 +186,6 @@ public interface PropertiesEditionComponentPropertiesEditionPart {
// Start of user code for additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionContextPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionContextPropertiesEditionPart.java
index a6c2a88b3..7addd049a 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionContextPropertiesEditionPart.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionContextPropertiesEditionPart.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextPropertiesEditionPart.java,v 1.7 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionContextPropertiesEditionPart.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -17,10 +17,12 @@ package org.eclipse.emf.eef.components.parts;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -45,6 +47,12 @@ public interface PropertiesEditionContextPropertiesEditionPart {
public void setModel(EObject newValue);
/**
+ * Defines the button mode
+ * @param newValue the new mode to set
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue);
+
+ /**
* Adds the given filter to the model edition editor.
*
* @param filter
@@ -74,5 +82,6 @@ public interface PropertiesEditionContextPropertiesEditionPart {
// Start of user code for additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionElementPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionElementPropertiesEditionPart.java
index 563435179..2b7d88f7e 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionElementPropertiesEditionPart.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesEditionElementPropertiesEditionPart.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementPropertiesEditionPart.java,v 1.7 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionElementPropertiesEditionPart.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -20,10 +20,12 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -78,6 +80,12 @@ public interface PropertiesEditionElementPropertiesEditionPart {
public void setModel(EObject newValue);
/**
+ * Defines the button mode
+ * @param newValue the new mode to set
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue);
+
+ /**
* Adds the given filter to the model edition editor.
*
* @param filter
@@ -110,7 +118,7 @@ public interface PropertiesEditionElementPropertiesEditionPart {
public List getViewsToRemove();
/**
- * @return the current views
+ * @return the current views table
*/
public List getViewsTable();
@@ -146,6 +154,11 @@ public interface PropertiesEditionElementPropertiesEditionPart {
*/
public void addBusinessFilterToViews(ViewerFilter filter);
+ /**
+ * @return true if the given element is contained inside the views table
+ */
+ public boolean isContainedInViewsTable(EObject element);
+
@@ -158,5 +171,6 @@ public interface PropertiesEditionElementPropertiesEditionPart {
// Start of user code for additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesMultiEditionElementPropertiesEditionPart.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesMultiEditionElementPropertiesEditionPart.java
index 61fdfafb6..cd9711810 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesMultiEditionElementPropertiesEditionPart.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/PropertiesMultiEditionElementPropertiesEditionPart.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementPropertiesEditionPart.java,v 1.7 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementPropertiesEditionPart.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts;
@@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.ViewerFilter;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -69,7 +70,7 @@ public interface PropertiesMultiEditionElementPropertiesEditionPart {
public List getModelToRemove();
/**
- * @return the current model
+ * @return the current model table
*/
public List getModelTable();
@@ -105,6 +106,11 @@ public interface PropertiesMultiEditionElementPropertiesEditionPart {
*/
public void addBusinessFilterToModel(ViewerFilter filter);
+ /**
+ * @return true if the given element is contained inside the model table
+ */
+ public boolean isContainedInModelTable(EObject element);
+
@@ -120,7 +126,7 @@ public interface PropertiesMultiEditionElementPropertiesEditionPart {
public List getViewsToRemove();
/**
- * @return the current views
+ * @return the current views table
*/
public List getViewsTable();
@@ -156,6 +162,11 @@ public interface PropertiesMultiEditionElementPropertiesEditionPart {
*/
public void addBusinessFilterToViews(ViewerFilter filter);
+ /**
+ * @return true if the given element is contained inside the views table
+ */
+ public boolean isContainedInViewsTable(EObject element);
+
@@ -168,5 +179,6 @@ public interface PropertiesMultiEditionElementPropertiesEditionPart {
// Start of user code for additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/DocumentationPropertiesEditionPartForm.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/DocumentationPropertiesEditionPartForm.java
index f859395c6..8ffd46d19 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/DocumentationPropertiesEditionPartForm.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/DocumentationPropertiesEditionPartForm.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: DocumentationPropertiesEditionPartForm.java,v 1.5 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: DocumentationPropertiesEditionPartForm.java,v 1.6 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.forms;
@@ -41,21 +41,31 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class DocumentationPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, DocumentationPropertiesEditionPart {
- private Text documentation;
+ protected Text documentation;
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public DocumentationPropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
@@ -67,12 +77,18 @@ public class DocumentationPropertiesEditionPartForm extends CompositePropertiesE
return scrolledForm;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
this.messageManager = messageManager;
createDocumentationGroup(widgetFactory, view);
// Start of user code for additional ui definition
- // End of user code
+ // End of user code
+
}
protected void createDocumentationGroup(FormToolkit widgetFactory, final Composite view) {
@@ -127,14 +143,14 @@ public class DocumentationPropertiesEditionPartForm extends CompositePropertiesE
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.Documentation.documentation, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
public void firePropertiesChanged(PropertiesEditionEvent event) {
// Start of user code for tab synchronization
- // End of user code
+ // End of user code
+
}
/**
@@ -152,7 +168,11 @@ public class DocumentationPropertiesEditionPartForm extends CompositePropertiesE
* @see org.eclipse.emf.eef.mapping.parts.DocumentationPropertiesEditionPart#setDocumentation(String newValue)
*/
public void setDocumentation(String newValue) {
- documentation.setText(newValue);
+ if (newValue != null) {
+ documentation.setText(newValue);
+ } else {
+ documentation.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForDocumentation(String msg, int msgLevel) {
@@ -173,4 +193,5 @@ public class DocumentationPropertiesEditionPartForm extends CompositePropertiesE
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionComponentPropertiesEditionPartForm.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionComponentPropertiesEditionPartForm.java
index 8c8cdc5e7..f2379f67c 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionComponentPropertiesEditionPartForm.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionComponentPropertiesEditionPartForm.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentPropertiesEditionPartForm.java,v 1.8 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionComponentPropertiesEditionPartForm.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.forms;
@@ -36,6 +36,7 @@ import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.policies.EObjectPropertiesEditionContext;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPolicyProviderService;
import org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
@@ -72,17 +73,18 @@ import org.eclipse.ui.forms.widgets.Section;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesEditionComponentPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, PropertiesEditionComponentPropertiesEditionPart {
- private Text name;
- private Text helpID;
- private Button explicit;
+ protected Text name;
+ protected Text helpID;
+ protected Button explicit;
protected EObjectFlatComboViewer model;
private EMFListEditUtil viewsEditUtil;
- private ReferencesTable<?> views;
+ protected ReferencesTable<? extends EObject> views;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -90,10 +92,19 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionComponentPropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
@@ -105,13 +116,19 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
return scrolledForm;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
this.messageManager = messageManager;
createPropertiesGroup(widgetFactory, view);
createBindingGroup(widgetFactory, view);
// Start of user code for additional ui definition
- // End of user code
+ // End of user code
+
}
protected void createPropertiesGroup(FormToolkit widgetFactory, final Composite view) {
@@ -147,7 +164,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.name, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, name.getText()));
}
-
+
});
name.addFocusListener(new FocusAdapter() {
@@ -175,10 +192,9 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesEditionComponent.name, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createHelpIDText(FormToolkit widgetFactory, Composite parent) {
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_HelpIDLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionComponent.helpID, ComponentsViewsRepository.FORM_KIND));
@@ -198,7 +214,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.helpID, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, helpID.getText()));
}
-
+
});
helpID.addFocusListener(new FocusAdapter() {
@@ -226,10 +242,9 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.helpID, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, helpID.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesEditionComponent.helpID, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createExplicitCheckbox(FormToolkit widgetFactory, Composite parent) {
explicit = widgetFactory.createButton(parent, ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_ExplicitLabel, SWT.CHECK);
@@ -244,7 +259,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.explicit, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(explicit.getSelection())));
}
-
+
});
GridData explicitData = new GridData(GridData.FILL_HORIZONTAL);
explicitData.horizontalSpan = 2;
@@ -269,11 +284,9 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
-
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionComponent.model, ComponentsViewsRepository.FORM_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
-
GridData modelData = new GridData(GridData.FILL_HORIZONTAL);
model.setLayoutData(modelData);
model.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -291,11 +304,11 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesEditionComponent.model, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
}
- protected void createViewsReferencesTable(FormToolkit widgetFactory, Composite parent) {
+ protected void createViewsReferencesTable(FormToolkit widgetFactory, Composite parent) {
this.views = new ReferencesTable<View>(ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_ViewsLabel, new ReferencesTableListener<View>() {
public void handleAdd() {
TabElementTreeSelectionDialog<View> dialog = new TabElementTreeSelectionDialog<View>(resourceSet, viewsFilters, viewsBusinessFilters,
- "View", ViewsPackage.eINSTANCE.getView()) {
+ "View", ViewsPackage.eINSTANCE.getView(), current.eResource()) {
@Override
public void process(IStructuredSelection selection) {
for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
@@ -322,7 +335,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
this.views.setLayoutData(viewsData);
this.views.disableMove();
}
-
+
/**
*
*/
@@ -332,12 +345,11 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
views.refresh();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex));
}
-
+
/**
*
*/
protected void removeFromViews(View element) {
-
// Start of user code for the removeFromViews() method body
EObject editedElement = viewsEditUtil.foundCorrespondingEObject(element);
@@ -346,13 +358,13 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionComponent.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement));
// End of user code
+
}
/**
*
*/
protected void editViews(View element) {
-
// Start of user code editViews() method body
EObject editedElement = viewsEditUtil.foundCorrespondingEObject(element);
@@ -368,13 +380,15 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
}
// End of user code
+
}
public void firePropertiesChanged(PropertiesEditionEvent event) {
// Start of user code for tab synchronization
- // End of user code
+ // End of user code
+
}
/**
@@ -392,7 +406,11 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -418,7 +436,11 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -476,8 +498,9 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -486,10 +509,20 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -541,6 +574,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -562,7 +596,7 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -586,6 +620,15 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
@@ -600,4 +643,5 @@ public class PropertiesEditionComponentPropertiesEditionPartForm extends Composi
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionContextPropertiesEditionPartForm.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionContextPropertiesEditionPartForm.java
index ea4515149..4f6778ada 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionContextPropertiesEditionPartForm.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionContextPropertiesEditionPartForm.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextPropertiesEditionPartForm.java,v 1.8 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionContextPropertiesEditionPartForm.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.forms;
@@ -26,6 +26,7 @@ import org.eclipse.emf.eef.runtime.api.parts.EEFMessageManager;
import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -46,6 +47,7 @@ import org.eclipse.ui.forms.widgets.Section;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -57,10 +59,19 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionContextPropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
@@ -72,12 +83,18 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
return scrolledForm;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
this.messageManager = messageManager;
createBindingGroup(widgetFactory, view);
// Start of user code for additional ui definition
- // End of user code
+ // End of user code
+
}
protected void createBindingGroup(FormToolkit widgetFactory, final Composite view) {
@@ -97,11 +114,9 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
-
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesEditionContextPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionContext.model, ComponentsViewsRepository.FORM_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
-
GridData modelData = new GridData(GridData.FILL_HORIZONTAL);
model.setLayoutData(modelData);
model.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -125,7 +140,8 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
// Start of user code for tab synchronization
// Nothing to do
- // End of user code
+ // End of user code
+
}
/**
@@ -149,8 +165,9 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -159,10 +176,20 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionContextPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionContextPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -197,4 +224,5 @@ public class PropertiesEditionContextPropertiesEditionPartForm extends Composite
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionElementPropertiesEditionPartForm.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionElementPropertiesEditionPartForm.java
index 6e5e7f7a0..0a73fe28f 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionElementPropertiesEditionPartForm.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesEditionElementPropertiesEditionPartForm.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementPropertiesEditionPartForm.java,v 1.9 2009/06/09 15:47:31 sbouchet Exp $
+ * $Id: PropertiesEditionElementPropertiesEditionPartForm.java,v 1.10 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.forms;
@@ -34,6 +34,7 @@ import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EMFModelViewerDialog;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
@@ -72,18 +73,19 @@ import org.eclipse.ui.forms.widgets.Section;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesEditionElementPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, PropertiesEditionElementPropertiesEditionPart {
- private Text name;
- private Text helpID;
+ protected Text name;
+ protected Text helpID;
protected EObjectFlatComboViewer model;
protected EMFListEditUtil viewsEditUtil;
protected TableViewer views;
- private Button addViews;
- private Button removeViews;
+ protected Button addViews;
+ protected Button removeViews;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -91,10 +93,19 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionElementPropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
@@ -106,6 +117,11 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
return scrolledForm;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
this.messageManager = messageManager;
createPropertiesGroup(widgetFactory, view);
@@ -122,7 +138,8 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
}
});
- // End of user code
+ // End of user code
+
}
protected void createPropertiesGroup(FormToolkit widgetFactory, final Composite view) {
@@ -157,7 +174,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionElement.name, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, name.getText()));
}
-
+
});
name.addFocusListener(new FocusAdapter() {
@@ -185,10 +202,9 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionElement.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesEditionElement.name, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createHelpIDText(FormToolkit widgetFactory, Composite parent) {
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesEditionElementPropertiesEditionPart_HelpIDLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionElement.helpID, ComponentsViewsRepository.FORM_KIND));
@@ -208,7 +224,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionElement.helpID, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, helpID.getText()));
}
-
+
});
helpID.addFocusListener(new FocusAdapter() {
@@ -236,10 +252,9 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesEditionElement.helpID, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, helpID.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesEditionElement.helpID, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createBindingGroup(FormToolkit widgetFactory, final Composite view) {
Section bindingSection = widgetFactory.createSection(view, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
@@ -259,11 +274,9 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
-
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesEditionElementPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionElement.model, ComponentsViewsRepository.FORM_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
-
GridData modelData = new GridData(GridData.FILL_HORIZONTAL);
model.setLayoutData(modelData);
model.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -310,7 +323,8 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
TableColumn name = new TableColumn(table, SWT.NONE);
name.setWidth(80);
name.setText("Views"); //$NON-NLS-1$
- // End of user code
+ // End of user code
+
TableViewer result = new TableViewer(table);
result.setContentProvider(new ArrayContentProvider());
result.setLabelProvider(new ITableLabelProvider() {
@@ -328,6 +342,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
return ""; //$NON-NLS-1$
}
// End of user code
+
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
@@ -406,7 +421,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
}
}
}
-
+
};
dialog.open();
}
@@ -427,7 +442,8 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
// Start of user code for tab synchronization
// Nothing to do
- // End of user code
+ // End of user code
+
}
/**
@@ -445,7 +461,11 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -471,7 +491,11 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -503,8 +527,9 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -513,10 +538,20 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -568,6 +603,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -589,7 +625,7 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -613,6 +649,15 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
@@ -627,4 +672,5 @@ public class PropertiesEditionElementPropertiesEditionPartForm extends Composite
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesMultiEditionElementPropertiesEditionPartForm.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesMultiEditionElementPropertiesEditionPartForm.java
index 7e20d449c..c15a5851e 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesMultiEditionElementPropertiesEditionPartForm.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/forms/PropertiesMultiEditionElementPropertiesEditionPartForm.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementPropertiesEditionPartForm.java,v 1.9 2009/06/09 15:47:31 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementPropertiesEditionPartForm.java,v 1.10 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.forms;
@@ -75,21 +75,22 @@ import org.eclipse.ui.forms.widgets.Section;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesMultiEditionElementPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, PropertiesMultiEditionElementPropertiesEditionPart {
- private Text name;
- private Text helpID;
+ protected Text name;
+ protected Text helpID;
protected EMFListEditUtil modelEditUtil;
protected TableViewer model;
- private Button addModel;
- private Button removeModel;
+ protected Button addModel;
+ protected Button removeModel;
protected List<ViewerFilter> modelBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> modelFilters = new ArrayList<ViewerFilter>();
private EMFListEditUtil viewsEditUtil;
- private ReferencesTable<?> views;
+ protected ReferencesTable<? extends EObject> views;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -97,10 +98,19 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesMultiEditionElementPropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
@@ -112,13 +122,19 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
return scrolledForm;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
+ * createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
this.messageManager = messageManager;
createPropertiesGroup(widgetFactory, view);
createBindingGroup(widgetFactory, view);
// Start of user code for additional ui definition
- // End of user code
+ // End of user code
+
}
protected void createPropertiesGroup(FormToolkit widgetFactory, final Composite view) {
@@ -153,7 +169,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.name, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, name.getText()));
}
-
+
});
name.addFocusListener(new FocusAdapter() {
@@ -181,10 +197,9 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesMultiEditionElement.name, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createHelpIDText(FormToolkit widgetFactory, Composite parent) {
FormUtils.createPartLabel(widgetFactory, parent, ComponentsMessages.PropertiesMultiEditionElementPropertiesEditionPart_HelpIDLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesMultiEditionElement.helpID, ComponentsViewsRepository.FORM_KIND));
@@ -204,7 +219,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.helpID, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, helpID.getText()));
}
-
+
});
helpID.addFocusListener(new FocusAdapter() {
@@ -232,10 +247,9 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.helpID, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, helpID.getText()));
}
}
-
+
});
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ComponentsViewsRepository.PropertiesMultiEditionElement.helpID, ComponentsViewsRepository.FORM_KIND), null); //$NON-NLS-1$
-
}
protected void createBindingGroup(FormToolkit widgetFactory, final Composite view) {
Section bindingSection = widgetFactory.createSection(view, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
@@ -280,7 +294,8 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
TableColumn name = new TableColumn(table, SWT.NONE);
name.setWidth(80);
name.setText("Label"); //$NON-NLS-1$
- // End of user code
+ // End of user code
+
TableViewer result = new TableViewer(table);
result.setContentProvider(new ArrayContentProvider());
result.setLabelProvider(new ITableLabelProvider() {
@@ -298,6 +313,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
return ""; //$NON-NLS-1$
}
// End of user code
+
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
@@ -376,7 +392,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
}
}
}
-
+
};
dialog.open();
}
@@ -391,11 +407,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.model, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, modelEditUtil.foundCorrespondingEObject(selectedElement)));
}
}
- protected void createViewsReferencesTable(FormToolkit widgetFactory, Composite parent) {
+ protected void createViewsReferencesTable(FormToolkit widgetFactory, Composite parent) {
this.views = new ReferencesTable<ElementEditor>(ComponentsMessages.PropertiesMultiEditionElementPropertiesEditionPart_ViewsLabel, new ReferencesTableListener<ElementEditor>() {
public void handleAdd() {
TabElementTreeSelectionDialog<ElementEditor> dialog = new TabElementTreeSelectionDialog<ElementEditor>(resourceSet, viewsFilters, viewsBusinessFilters,
- "ElementEditor", ViewsPackage.eINSTANCE.getElementEditor()) {
+ "ElementEditor", ViewsPackage.eINSTANCE.getElementEditor(), current.eResource()) {
@Override
public void process(IStructuredSelection selection) {
for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
@@ -422,7 +438,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
this.views.setLayoutData(viewsData);
this.views.disableMove();
}
-
+
/**
*
*/
@@ -432,12 +448,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
views.refresh();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex));
}
-
+
/**
*
*/
protected void removeFromViews(ElementEditor element) {
-
// Start of user code for the removeFromViews() method body
EObject editedElement = viewsEditUtil.foundCorrespondingEObject(element);
@@ -446,13 +461,13 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartForm.this, ComponentsViewsRepository.PropertiesMultiEditionElement.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement));
// End of user code
+
}
/**
*
*/
protected void editViews(ElementEditor element) {
-
// Start of user code editViews() method body
EObject editedElement = viewsEditUtil.foundCorrespondingEObject(element);
@@ -468,6 +483,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
}
// End of user code
+
}
@@ -475,7 +491,8 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
// Start of user code for tab synchronization
// Nothing to do
- // End of user code
+ // End of user code
+
}
/**
@@ -493,7 +510,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -519,7 +540,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -557,6 +582,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
return modelEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -578,7 +604,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#updateModel(EObject newValue)
*/
public void updateModel(EObject newValue) {
- if(modelEditUtil!=null){
+ if(modelEditUtil != null){
modelEditUtil.reinit(newValue);
model.refresh();
}
@@ -602,6 +628,15 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
modelBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#isContainedInModelTable(EObject element)
+ */
+ public boolean isContainedInModelTable(EObject element) {
+ return modelEditUtil.contains(element);
+ }
+
@@ -633,6 +668,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -654,7 +690,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -678,6 +714,15 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
@@ -692,4 +737,5 @@ public class PropertiesMultiEditionElementPropertiesEditionPartForm extends Comp
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/DocumentationPropertiesEditionPartImpl.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/DocumentationPropertiesEditionPartImpl.java
index e24b252b0..cfdc9a138 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/DocumentationPropertiesEditionPartImpl.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/DocumentationPropertiesEditionPartImpl.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: DocumentationPropertiesEditionPartImpl.java,v 1.6 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: DocumentationPropertiesEditionPartImpl.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.impl;
@@ -32,21 +32,31 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class DocumentationPropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, DocumentationPropertiesEditionPart {
- private Text documentation;
+ protected Text documentation;
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public DocumentationPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite)
+ */
public Composite createFigure(final Composite parent) {
view = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -57,12 +67,18 @@ public class DocumentationPropertiesEditionPartImpl extends CompositePropertiesE
return view;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createControls(org.eclipse.swt.widgets.Composite)
+ */
public void createControls(Composite view) {
createDocumentationGroup(view);
// Start of user code for additional ui definition
// End of user code
+
}
protected void createDocumentationGroup(Composite parent) {
@@ -94,6 +110,7 @@ public class DocumentationPropertiesEditionPartImpl extends CompositePropertiesE
// Start of user code for tab synchronization
// End of user code
+
}
/**
@@ -111,7 +128,11 @@ public class DocumentationPropertiesEditionPartImpl extends CompositePropertiesE
* @see org.eclipse.emf.eef.mapping.parts.DocumentationPropertiesEditionPart#setDocumentation(String newValue)
*/
public void setDocumentation(String newValue) {
- documentation.setText(newValue);
+ if (newValue != null) {
+ documentation.setText(newValue);
+ } else {
+ documentation.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForDocumentation(String msg, int msgLevel) {
@@ -132,4 +153,5 @@ public class DocumentationPropertiesEditionPartImpl extends CompositePropertiesE
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionComponentPropertiesEditionPartImpl.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionComponentPropertiesEditionPartImpl.java
index 575d7b53d..24a9039c4 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionComponentPropertiesEditionPartImpl.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionComponentPropertiesEditionPartImpl.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentPropertiesEditionPartImpl.java,v 1.8 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionComponentPropertiesEditionPartImpl.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.impl;
@@ -35,6 +35,7 @@ import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.policies.EObjectPropertiesEditionContext;
import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPolicyProviderService;
import org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable;
import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
@@ -60,17 +61,18 @@ import org.eclipse.swt.widgets.Text;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesEditionComponentPropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, PropertiesEditionComponentPropertiesEditionPart {
- private Text name;
- private Text helpID;
- private Button explicit;
+ protected Text name;
+ protected Text helpID;
+ protected Button explicit;
protected EObjectFlatComboViewer model;
- private EMFListEditUtil viewsEditUtil;
- private ReferencesTable<?> views;
+ protected EMFListEditUtil viewsEditUtil;
+ protected ReferencesTable<? extends EObject> views;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -78,10 +80,19 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionComponentPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite)
+ */
public Composite createFigure(final Composite parent) {
view = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -92,6 +103,11 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
return view;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createControls(org.eclipse.swt.widgets.Composite)
+ */
public void createControls(Composite view) {
createPropertiesGroup(view);
createBindingGroup(view);
@@ -99,6 +115,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
// Start of user code for additional ui definition
// End of user code
+
}
protected void createPropertiesGroup(Composite parent) {
@@ -180,7 +197,6 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent) {
-
SWTUtils.createPartLabel(parent, ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionComponent.model, ComponentsViewsRepository.SWT_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
@@ -200,7 +216,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
this.views = new ReferencesTable<View>(ComponentsMessages.PropertiesEditionComponentPropertiesEditionPart_ViewsLabel, new ReferencesTableListener<View>() {
public void handleAdd() {
TabElementTreeSelectionDialog<View> dialog = new TabElementTreeSelectionDialog<View>(resourceSet, viewsFilters, viewsBusinessFilters,
- "View", ViewsPackage.eINSTANCE.getView()) {
+ "View", ViewsPackage.eINSTANCE.getView(), current.eResource()) {
public void process(IStructuredSelection selection) {
for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
@@ -228,7 +244,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
this.views.setLayoutData(viewsData);
this.views.disableMove();
}
-
+
/**
*
*/
@@ -238,7 +254,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
views.refresh();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartImpl.this, ComponentsViewsRepository.PropertiesEditionComponent.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex));
}
-
+
/**
*
*/
@@ -252,6 +268,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesEditionComponentPropertiesEditionPartImpl.this, ComponentsViewsRepository.PropertiesEditionComponent.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement));
// End of user code
+
}
/**
@@ -274,6 +291,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
}
// End of user code
+
}
@@ -281,6 +299,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
// Start of user code for tab synchronization
// End of user code
+
}
/**
@@ -298,7 +317,11 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -324,7 +347,11 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -386,8 +413,9 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -396,10 +424,20 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -455,6 +493,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -476,7 +515,7 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -500,6 +539,15 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionComponentPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
public void setMessageForViews(String msg, int msgLevel) {
}
@@ -518,4 +566,5 @@ public class PropertiesEditionComponentPropertiesEditionPartImpl extends Composi
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionContextPropertiesEditionPartImpl.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionContextPropertiesEditionPartImpl.java
index 0004fde7c..335b8407b 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionContextPropertiesEditionPartImpl.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionContextPropertiesEditionPartImpl.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextPropertiesEditionPartImpl.java,v 1.8 2009/05/20 17:57:33 sbouchet Exp $
+ * $Id: PropertiesEditionContextPropertiesEditionPartImpl.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.impl;
@@ -25,6 +25,7 @@ import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -41,6 +42,7 @@ import org.eclipse.swt.widgets.Group;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -52,10 +54,19 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionContextPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite)
+ */
public Composite createFigure(final Composite parent) {
view = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -66,12 +77,18 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
return view;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createControls(org.eclipse.swt.widgets.Composite)
+ */
public void createControls(Composite view) {
createBindingGroup(view);
// Start of user code for additional ui definition
// End of user code
+
}
protected void createBindingGroup(Composite parent) {
@@ -89,7 +106,6 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent) {
-
SWTUtils.createPartLabel(parent, ComponentsMessages.PropertiesEditionContextPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionContext.model, ComponentsViewsRepository.SWT_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
@@ -111,6 +127,7 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
// Start of user code for tab synchronization
// End of user code
+
}
/**
@@ -134,8 +151,9 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -144,10 +162,20 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionContextPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionContextPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -186,4 +214,5 @@ public class PropertiesEditionContextPropertiesEditionPartImpl extends Composite
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionElementPropertiesEditionPartImpl.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionElementPropertiesEditionPartImpl.java
index ca27ad1af..1eadcd5ca 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionElementPropertiesEditionPartImpl.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesEditionElementPropertiesEditionPartImpl.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementPropertiesEditionPartImpl.java,v 1.9 2009/06/09 15:47:31 sbouchet Exp $
+ * $Id: PropertiesEditionElementPropertiesEditionPartImpl.java,v 1.10 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.impl;
@@ -33,6 +33,7 @@ import org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil;
+import org.eclipse.emf.eef.runtime.ui.widgets.ButtonsModeEnum;
import org.eclipse.emf.eef.runtime.ui.widgets.EMFModelViewerDialog;
import org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.SWTUtils;
@@ -64,18 +65,19 @@ import org.eclipse.swt.widgets.Text;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesEditionElementPropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, PropertiesEditionElementPropertiesEditionPart {
- private Text name;
- private Text helpID;
+ protected Text name;
+ protected Text helpID;
protected EObjectFlatComboViewer model;
protected EMFListEditUtil viewsEditUtil;
protected TableViewer views;
- private Button addViews;
- private Button removeViews;
+ protected Button addViews;
+ protected Button removeViews;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -83,10 +85,19 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesEditionElementPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite)
+ */
public Composite createFigure(final Composite parent) {
view = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -97,6 +108,11 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
return view;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createControls(org.eclipse.swt.widgets.Composite)
+ */
public void createControls(Composite view) {
createPropertiesGroup(view);
createBindingGroup(view);
@@ -114,6 +130,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
});
// End of user code
+
}
protected void createPropertiesGroup(Composite parent) {
@@ -186,7 +203,6 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
* @param bindingGroup
*/
protected void createModelFlatComboViewer(Composite parent) {
-
SWTUtils.createPartLabel(parent, ComponentsMessages.PropertiesEditionElementPropertiesEditionPart_ModelLabel, propertiesEditionComponent.isRequired(ComponentsViewsRepository.PropertiesEditionElement.model, ComponentsViewsRepository.SWT_KIND));
model = new EObjectFlatComboViewer(parent, false);
model.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
@@ -234,7 +250,8 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
TableColumn name = new TableColumn(table, SWT.NONE);
name.setWidth(80);
name.setText("Views"); //$NON-NLS-1$
- // End of user code
+ // End of user code
+
TableViewer result = new TableViewer(table);
result.setContentProvider(new ArrayContentProvider());
result.setLabelProvider(new ITableLabelProvider() {
@@ -256,6 +273,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
return null;
}
// End of user code
+
public void addListener(ILabelProviderListener listener) {
}
@@ -317,7 +335,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
});
}
-
+
/**
*
*/
@@ -352,6 +370,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
// Start of user code for tab synchronization
// End of user code
+
}
/**
@@ -369,7 +388,11 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -395,7 +418,11 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -427,8 +454,9 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
*/
public void initModel(ResourceSet allResources, EObject current) {
model.setInput(allResources);
- if (current != null)
+ if (current != null) {
model.setSelection(new StructuredSelection(current));
+ }
}
/**
@@ -437,10 +465,20 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setModel(EObject newValue)
*/
public void setModel(EObject newValue) {
- if (newValue != null)
+ if (newValue != null) {
model.setSelection(new StructuredSelection(newValue));
- else
- model.setSelection(new StructuredSelection("")); //$NON-NLS-1$
+ } else {
+ model.setSelection(new StructuredSelection()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#setModelButtonMode(ButtonsModeEnum newValue)
+ */
+ public void setModelButtonMode(ButtonsModeEnum newValue) {
+ model.setButtonMode(newValue);
}
/**
@@ -496,6 +534,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -517,7 +556,7 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
* @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -541,6 +580,15 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesEditionElementPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
public void setMessageForViews(String msg, int msgLevel) {
}
@@ -559,4 +607,5 @@ public class PropertiesEditionElementPropertiesEditionPartImpl extends Composite
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesMultiEditionElementPropertiesEditionPartImpl.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesMultiEditionElementPropertiesEditionPartImpl.java
index 2e77d6363..aaeb47d4e 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesMultiEditionElementPropertiesEditionPartImpl.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/parts/impl/PropertiesMultiEditionElementPropertiesEditionPartImpl.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementPropertiesEditionPartImpl.java,v 1.9 2009/06/09 15:47:31 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementPropertiesEditionPartImpl.java,v 1.10 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.parts.impl;
@@ -65,21 +65,22 @@ import org.eclipse.swt.widgets.Text;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends CompositePropertiesEditionPart implements ISWTPropertiesEditionPart, PropertiesMultiEditionElementPropertiesEditionPart {
- private Text name;
- private Text helpID;
+ protected Text name;
+ protected Text helpID;
protected EMFListEditUtil modelEditUtil;
protected TableViewer model;
- private Button addModel;
- private Button removeModel;
+ protected Button addModel;
+ protected Button removeModel;
protected List<ViewerFilter> modelBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> modelFilters = new ArrayList<ViewerFilter>();
- private EMFListEditUtil viewsEditUtil;
- private ReferencesTable<?> views;
+ protected EMFListEditUtil viewsEditUtil;
+ protected ReferencesTable<? extends EObject> views;
protected List<ViewerFilter> viewsBusinessFilters = new ArrayList<ViewerFilter>();
protected List<ViewerFilter> viewsFilters = new ArrayList<ViewerFilter>();
@@ -87,10 +88,19 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
+ /**
+ * Default constructor
+ * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
+ */
public PropertiesMultiEditionElementPropertiesEditionPartImpl(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createFigure(org.eclipse.swt.widgets.Composite)
+ */
public Composite createFigure(final Composite parent) {
view = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -101,6 +111,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
return view;
}
+ /**
+ * {@inheritDoc}
+ * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
+ * createControls(org.eclipse.swt.widgets.Composite)
+ */
public void createControls(Composite view) {
createPropertiesGroup(view);
createBindingGroup(view);
@@ -108,6 +123,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
// Start of user code for additional ui definition
// End of user code
+
}
protected void createPropertiesGroup(Composite parent) {
@@ -208,7 +224,8 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
TableColumn name = new TableColumn(table, SWT.NONE);
name.setWidth(80);
name.setText("Label"); //$NON-NLS-1$
- // End of user code
+ // End of user code
+
TableViewer result = new TableViewer(table);
result.setContentProvider(new ArrayContentProvider());
result.setLabelProvider(new ITableLabelProvider() {
@@ -230,6 +247,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
return null;
}
// End of user code
+
public void addListener(ILabelProviderListener listener) {
}
@@ -291,7 +309,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
});
}
-
+
/**
*
*/
@@ -324,7 +342,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
this.views = new ReferencesTable<ElementEditor>(ComponentsMessages.PropertiesMultiEditionElementPropertiesEditionPart_ViewsLabel, new ReferencesTableListener<ElementEditor>() {
public void handleAdd() {
TabElementTreeSelectionDialog<ElementEditor> dialog = new TabElementTreeSelectionDialog<ElementEditor>(resourceSet, viewsFilters, viewsBusinessFilters,
- "ElementEditor", ViewsPackage.eINSTANCE.getElementEditor()) {
+ "ElementEditor", ViewsPackage.eINSTANCE.getElementEditor(), current.eResource()) {
public void process(IStructuredSelection selection) {
for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
@@ -352,7 +370,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
this.views.setLayoutData(viewsData);
this.views.disableMove();
}
-
+
/**
*
*/
@@ -362,7 +380,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
views.refresh();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartImpl.this, ComponentsViewsRepository.PropertiesMultiEditionElement.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex));
}
-
+
/**
*
*/
@@ -376,6 +394,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PropertiesMultiEditionElementPropertiesEditionPartImpl.this, ComponentsViewsRepository.PropertiesMultiEditionElement.views, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement));
// End of user code
+
}
/**
@@ -398,6 +417,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
}
// End of user code
+
}
@@ -405,6 +425,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
// Start of user code for tab synchronization
// End of user code
+
}
/**
@@ -422,7 +443,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#setName(String newValue)
*/
public void setName(String newValue) {
- name.setText(newValue);
+ if (newValue != null) {
+ name.setText(newValue);
+ } else {
+ name.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForName(String msg, int msgLevel) {
@@ -448,7 +473,11 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#setHelpID(String newValue)
*/
public void setHelpID(String newValue) {
- helpID.setText(newValue);
+ if (newValue != null) {
+ helpID.setText(newValue);
+ } else {
+ helpID.setText(""); //$NON-NLS-1$
+ }
}
public void setMessageForHelpID(String msg, int msgLevel) {
@@ -486,6 +515,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
return modelEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -507,7 +537,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#updateModel(EObject newValue)
*/
public void updateModel(EObject newValue) {
- if(modelEditUtil!=null){
+ if(modelEditUtil != null){
modelEditUtil.reinit(newValue);
model.refresh();
}
@@ -531,6 +561,15 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
modelBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#isContainedInModelTable(EObject element)
+ */
+ public boolean isContainedInModelTable(EObject element) {
+ return modelEditUtil.contains(element);
+ }
+
public void setMessageForModel(String msg, int msgLevel) {
}
@@ -566,6 +605,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
return viewsEditUtil.getVirtualList();
}
+
/**
* {@inheritDoc}
*
@@ -587,7 +627,7 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
* @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#updateViews(EObject newValue)
*/
public void updateViews(EObject newValue) {
- if(viewsEditUtil!=null){
+ if(viewsEditUtil != null){
viewsEditUtil.reinit(newValue);
views.refresh();
}
@@ -611,6 +651,15 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
viewsBusinessFilters.add(filter);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.components.parts.PropertiesMultiEditionElementPropertiesEditionPart#isContainedInViewsTable(EObject element)
+ */
+ public boolean isContainedInViewsTable(EObject element) {
+ return viewsEditUtil.contains(element);
+ }
+
public void setMessageForViews(String msg, int msgLevel) {
}
@@ -629,4 +678,5 @@ public class PropertiesMultiEditionElementPropertiesEditionPartImpl extends Comp
// Start of user code additional methods
// End of user code
+
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsMessages.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsMessages.java
index e3326d9f7..12abc9029 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsMessages.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsMessages.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: ComponentsMessages.java,v 1.6 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: ComponentsMessages.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -113,6 +113,7 @@ public class ComponentsMessages extends NLS {
// End of user code
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, ComponentsMessages.class);
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionPolicyProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionPolicyProvider.java
index 0141d1c04..afb365662 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionPolicyProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionPolicyProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: ComponentsPackagePropertiesEditionPolicyProvider.java,v 1.5 2009/05/20 17:57:32 sbouchet Exp $
+ * $Id: ComponentsPackagePropertiesEditionPolicyProvider.java,v 1.6 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -28,7 +28,7 @@ public class ComponentsPackagePropertiesEditionPolicyProvider extends StandardPr
* @see org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPolicyProvider#provides(org.eclipse.emf.ecore.EObject)
*/
public boolean provides(EObject eObject) {
- return ComponentsPackage.eINSTANCE.equals(eObject.eClass().getEPackage());
+ return ComponentsPackage.eINSTANCE.equals(eObject.eClass().getEPackage()) || ComponentsPackage.eINSTANCE.getESubpackages().contains(eObject.eClass().getEPackage());
}
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionProvider.java
index a22698426..a646912a8 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPackagePropertiesEditionProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: ComponentsPackagePropertiesEditionProvider.java,v 1.7 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: ComponentsPackagePropertiesEditionProvider.java,v 1.8 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPropertiesEditionPartProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPropertiesEditionPartProvider.java
index db7cfe4b6..f80522c25 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPropertiesEditionPartProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/ComponentsPropertiesEditionPartProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: ComponentsPropertiesEditionPartProvider.java,v 1.6 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: ComponentsPropertiesEditionPartProvider.java,v 1.7 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionComponentPropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionComponentPropertiesEditionProvider.java
index 33a8198b6..488c6c359 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionComponentPropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionComponentPropertiesEditionProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionComponentPropertiesEditionProvider.java,v 1.8 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: PropertiesEditionComponentPropertiesEditionProvider.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -35,7 +35,7 @@ public class PropertiesEditionComponentPropertiesEditionProvider implements IPro
public boolean provides(EObject eObject) {
return (eObject instanceof PropertiesEditionComponent) && (ComponentsPackage.eINSTANCE.getPropertiesEditionComponent() == eObject.eClass());
}
-
+
/**
* {@inheritDoc}
*
@@ -48,7 +48,7 @@ public class PropertiesEditionComponentPropertiesEditionProvider implements IPro
}
return null;
}
-
+
/**
* {@inheritDoc}
*
@@ -64,5 +64,6 @@ public class PropertiesEditionComponentPropertiesEditionProvider implements IPro
}
return null;
}
-
-}
+
+}
+
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionContextPropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionContextPropertiesEditionProvider.java
index cf671d782..70920a864 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionContextPropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionContextPropertiesEditionProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionContextPropertiesEditionProvider.java,v 1.8 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: PropertiesEditionContextPropertiesEditionProvider.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -35,7 +35,7 @@ public class PropertiesEditionContextPropertiesEditionProvider implements IPrope
public boolean provides(EObject eObject) {
return (eObject instanceof PropertiesEditionContext) && (ComponentsPackage.eINSTANCE.getPropertiesEditionContext() == eObject.eClass());
}
-
+
/**
* {@inheritDoc}
*
@@ -48,7 +48,7 @@ public class PropertiesEditionContextPropertiesEditionProvider implements IPrope
}
return null;
}
-
+
/**
* {@inheritDoc}
*
@@ -64,5 +64,6 @@ public class PropertiesEditionContextPropertiesEditionProvider implements IPrope
}
return null;
}
-
-}
+
+}
+
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionElementPropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionElementPropertiesEditionProvider.java
index 9dc8a1d9d..898c2ec8f 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionElementPropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesEditionElementPropertiesEditionProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesEditionElementPropertiesEditionProvider.java,v 1.8 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: PropertiesEditionElementPropertiesEditionProvider.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -35,7 +35,7 @@ public class PropertiesEditionElementPropertiesEditionProvider implements IPrope
public boolean provides(EObject eObject) {
return (eObject instanceof PropertiesEditionElement) && (ComponentsPackage.eINSTANCE.getPropertiesEditionElement() == eObject.eClass());
}
-
+
/**
* {@inheritDoc}
*
@@ -48,7 +48,7 @@ public class PropertiesEditionElementPropertiesEditionProvider implements IPrope
}
return null;
}
-
+
/**
* {@inheritDoc}
*
@@ -64,5 +64,6 @@ public class PropertiesEditionElementPropertiesEditionProvider implements IPrope
}
return null;
}
-
-}
+
+}
+
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesMultiEditionElementPropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesMultiEditionElementPropertiesEditionProvider.java
index b7ae36420..9c7e93181 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesMultiEditionElementPropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/PropertiesMultiEditionElementPropertiesEditionProvider.java
@@ -9,7 +9,7 @@
* Obeo - initial API and implementation
*
*
- * $Id: PropertiesMultiEditionElementPropertiesEditionProvider.java,v 1.8 2009/06/09 15:47:30 sbouchet Exp $
+ * $Id: PropertiesMultiEditionElementPropertiesEditionProvider.java,v 1.9 2009/07/31 14:12:53 glefur Exp $
*/
package org.eclipse.emf.eef.components.providers;
@@ -35,7 +35,7 @@ public class PropertiesMultiEditionElementPropertiesEditionProvider implements I
public boolean provides(EObject eObject) {
return (eObject instanceof PropertiesMultiEditionElement) && (ComponentsPackage.eINSTANCE.getPropertiesMultiEditionElement() == eObject.eClass());
}
-
+
/**
* {@inheritDoc}
*
@@ -48,7 +48,7 @@ public class PropertiesMultiEditionElementPropertiesEditionProvider implements I
}
return null;
}
-
+
/**
* {@inheritDoc}
*
@@ -64,5 +64,6 @@ public class PropertiesMultiEditionElementPropertiesEditionProvider implements I
}
return null;
}
-
-}
+
+}
+
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages.properties b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages.properties
index 8ce9e0968..b0005e4a9 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages.properties
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages.properties
@@ -2,9 +2,10 @@
# Generated with Acceleo
#
-#Start of user code for titles customization
+# Start of user code for titles customization
#End of user code
+
# default values ...
DocumentationPropertiesEditionPart_DocumentationGroupLabel=Documentation
PropertiesEditionContextPropertiesEditionPart_BindingGroupLabel=Binding
@@ -14,40 +15,55 @@ PropertiesEditionElementPropertiesEditionPart_PropertiesGroupLabel=Properties
PropertiesEditionElementPropertiesEditionPart_BindingGroupLabel=Binding
PropertiesMultiEditionElementPropertiesEditionPart_PropertiesGroupLabel=Properties
PropertiesMultiEditionElementPropertiesEditionPart_BindingGroupLabel=Binding
-Documentation_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
-PropertiesEditionContext_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
-PropertiesEditionComponent_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
-PropertiesEditionElement_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
-PropertiesMultiEditionElement_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+Documentation_ReadOnly=This property is read only
+PropertiesEditionContext_ReadOnly=This property is read only
+PropertiesEditionComponent_ReadOnly=This property is read only
+PropertiesEditionElement_ReadOnly=This property is read only
+PropertiesMultiEditionElement_ReadOnly=This property is read only
DocumentationPropertiesEditionPart_DocumentationLabel=Documentation :
+
PropertiesEditionContextPropertiesEditionPart_ModelLabel=Model :
+
PropertiesEditionComponentPropertiesEditionPart_NameLabel=Name :
+
PropertiesEditionComponentPropertiesEditionPart_HelpIDLabel=HelpID :
+
PropertiesEditionComponentPropertiesEditionPart_ExplicitLabel=Explicit
+
PropertiesEditionComponentPropertiesEditionPart_ModelLabel=Model :
+
PropertiesEditionComponentPropertiesEditionPart_ViewsLabel=Views :
+
PropertiesEditionElementPropertiesEditionPart_NameLabel=Name :
+
PropertiesEditionElementPropertiesEditionPart_HelpIDLabel=HelpID :
+
PropertiesEditionElementPropertiesEditionPart_ModelLabel=Model :
+
PropertiesEditionElementPropertiesEditionPart_ViewsLabel=Views :
+
PropertiesMultiEditionElementPropertiesEditionPart_NameLabel=Name :
+
PropertiesMultiEditionElementPropertiesEditionPart_HelpIDLabel=HelpID :
+
PropertiesMultiEditionElementPropertiesEditionPart_ModelLabel=Model :
+
PropertiesMultiEditionElementPropertiesEditionPart_ViewsLabel=Views :
-PropertiesEditionPart_PropertiesGroupLabel=Propri\u00E9t\u00E9s
-PropertiesEditionPart_EditTableViewerLabel=Editer
+
+PropertiesEditionPart_PropertiesGroupLabel=Properties
+PropertiesEditionPart_EditTableViewerLabel=Edit
PropertiesEditionPart_DocumentationLabel=Documentation
-PropertiesEditionPart_RequiredFeatureMessage=La propri\u00E9t\u00E9 {0} de l\u0027objet doit \u00EAtre renseign\u00E9e
-PropertiesEditionPart_RemoveTableViewerLabel=Supprimer
-PropertiesEditionPart_RemoveListViewerLabel=Supprimer
-PropertiesEditionPart_IntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un entier
-PropertiesEditionPart_FloatValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un flotant
-PropertiesEditionPart_ShortValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un short
-PropertiesEditionPart_DoubleValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un double
-PropertiesEditionPart_ByteValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un byte
-PropertiesEditionPart_LongValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un long
-PropertiesEditionPart_BigIntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigInteger
-PropertiesEditionPart_BigDecimalValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigDecimal
-PropertiesEditionPart_AddTableViewerLabel=Ajouter
-PropertiesEditionPart_AddListViewerLabel=Ajouter
+PropertiesEditionPart_RequiredFeatureMessage=The property {0} of the object shall be filled
+PropertiesEditionPart_RemoveTableViewerLabel=Delete
+PropertiesEditionPart_RemoveListViewerLabel=Delete
+PropertiesEditionPart_IntegerValueMessage=The property {0} shall be an integer
+PropertiesEditionPart_FloatValueMessage=The property {0} shall be a float
+PropertiesEditionPart_ShortValueMessage=The property {0} shall be a short
+PropertiesEditionPart_DoubleValueMessage=The property {0} shall be a double
+PropertiesEditionPart_ByteValueMessage=The property {0} shall be a byte
+PropertiesEditionPart_LongValueMessage=The property {0} shall be a long
+PropertiesEditionPart_BigIntegerValueMessage=The property {0} shall be a BigInteger
+PropertiesEditionPart_BigDecimalValueMessage=The property {0} shall be a BigDecimal
+PropertiesEditionPart_AddTableViewerLabel=Add
+PropertiesEditionPart_AddListViewerLabel=Add
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages_fr.properties b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages_fr.properties
new file mode 100644
index 000000000..05526479c
--- /dev/null
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/components/providers/componentsMessages_fr.properties
@@ -0,0 +1,69 @@
+#
+# Generated with Acceleo
+#
+
+# Start of user code for titles customization
+
+# End of user code
+
+# default values ...
+DocumentationPropertiesEditionPart_DocumentationGroupLabel=Documentation
+PropertiesEditionContextPropertiesEditionPart_BindingGroupLabel=Binding
+PropertiesEditionComponentPropertiesEditionPart_PropertiesGroupLabel=Properties
+PropertiesEditionComponentPropertiesEditionPart_BindingGroupLabel=Binding
+PropertiesEditionElementPropertiesEditionPart_PropertiesGroupLabel=Properties
+PropertiesEditionElementPropertiesEditionPart_BindingGroupLabel=Binding
+PropertiesMultiEditionElementPropertiesEditionPart_PropertiesGroupLabel=Properties
+PropertiesMultiEditionElementPropertiesEditionPart_BindingGroupLabel=Binding
+Documentation_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+PropertiesEditionContext_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+PropertiesEditionComponent_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+PropertiesEditionElement_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+PropertiesMultiEditionElement_ReadOnly=Cette propri\u00E9t\u00E9 est en lecture seule
+DocumentationPropertiesEditionPart_DocumentationLabel=Documentation :
+
+PropertiesEditionContextPropertiesEditionPart_ModelLabel=Model :
+
+PropertiesEditionComponentPropertiesEditionPart_NameLabel=Name :
+
+PropertiesEditionComponentPropertiesEditionPart_HelpIDLabel=HelpID :
+
+PropertiesEditionComponentPropertiesEditionPart_ExplicitLabel=Explicit
+
+PropertiesEditionComponentPropertiesEditionPart_ModelLabel=Model :
+
+PropertiesEditionComponentPropertiesEditionPart_ViewsLabel=Views :
+
+PropertiesEditionElementPropertiesEditionPart_NameLabel=Name :
+
+PropertiesEditionElementPropertiesEditionPart_HelpIDLabel=HelpID :
+
+PropertiesEditionElementPropertiesEditionPart_ModelLabel=Model :
+
+PropertiesEditionElementPropertiesEditionPart_ViewsLabel=Views :
+
+PropertiesMultiEditionElementPropertiesEditionPart_NameLabel=Name :
+
+PropertiesMultiEditionElementPropertiesEditionPart_HelpIDLabel=HelpID :
+
+PropertiesMultiEditionElementPropertiesEditionPart_ModelLabel=Model :
+
+PropertiesMultiEditionElementPropertiesEditionPart_ViewsLabel=Views :
+
+PropertiesEditionPart_PropertiesGroupLabel=Propri\u00E9t\u00E9s
+PropertiesEditionPart_EditTableViewerLabel=Editer
+PropertiesEditionPart_DocumentationLabel=Documentation
+PropertiesEditionPart_RequiredFeatureMessage=La propri\u00E9t\u00E9 {0} de l\u0027objet doit \u00EAtre renseign\u00E9e
+PropertiesEditionPart_RemoveTableViewerLabel=Supprimer
+PropertiesEditionPart_RemoveListViewerLabel=Supprimer
+PropertiesEditionPart_IntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un entier
+PropertiesEditionPart_FloatValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un flottant
+PropertiesEditionPart_ShortValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un short
+PropertiesEditionPart_DoubleValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un double
+PropertiesEditionPart_ByteValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un byte
+PropertiesEditionPart_LongValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un long
+PropertiesEditionPart_BigIntegerValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigInteger
+PropertiesEditionPart_BigDecimalValueMessage=La propri\u00E9t\u00E9 {0} doit \u00EAtre un BigDecimal
+PropertiesEditionPart_AddTableViewerLabel=Ajouter
+PropertiesEditionPart_AddListViewerLabel=Ajouter
+
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/components/DocumentedElementPropertiesEditionComponent.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/components/DocumentedElementPropertiesEditionComponent.java
index 85b4badae..e9a68adf7 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/components/DocumentedElementPropertiesEditionComponent.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/components/DocumentedElementPropertiesEditionComponent.java
@@ -32,6 +32,7 @@ import org.eclipse.emf.eef.components.parts.ComponentsViewsRepository;
import org.eclipse.emf.eef.components.parts.DocumentationPropertiesEditionPart;
import org.eclipse.emf.eef.mapping.DocumentedElement;
import org.eclipse.emf.eef.mapping.MappingPackage;
+import org.eclipse.emf.eef.runtime.EMFPropertiesRuntime;
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
@@ -43,6 +44,7 @@ import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPartProviderSe
import org.eclipse.jface.dialogs.IMessageProvider;
// End of user code
+
/**
* @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a>
*/
@@ -164,7 +166,7 @@ public class DocumentedElementPropertiesEditionComponent extends StandardPropert
public void initPart(java.lang.Class key, int kind, EObject elt, ResourceSet allResource) {
if (documentationPart != null && key == ComponentsViewsRepository.Documentation.class) {
((IPropertiesEditionPart)documentationPart).setContext(elt, allResource);
- DocumentedElement documentedElement = (DocumentedElement)elt;
+ final DocumentedElement documentedElement = (DocumentedElement)elt;
// init values
if (documentedElement.getDocumentation() != null)
documentationPart.setDocumentation(documentedElement.getDocumentation());
@@ -181,6 +183,8 @@ public class DocumentedElementPropertiesEditionComponent extends StandardPropert
+
+
/**
* {@inheritDoc}
*
@@ -233,7 +237,11 @@ public class DocumentedElementPropertiesEditionComponent extends StandardPropert
- liveEditingDomain.getCommandStack().execute(command);
+ if (!command.isEmpty() && !command.canExecute()) {
+ EMFPropertiesRuntime.getDefault().logError("Cannot perform model change command.", null);
+ } else {
+ liveEditingDomain.getCommandStack().execute(command);
+ }
} else if (PropertiesEditionEvent.CHANGE == event.getState()) {
Diagnostic diag = this.validateValue(event);
if (diag != null && diag.getSeverity() != Diagnostic.OK) {
@@ -267,16 +275,18 @@ public class DocumentedElementPropertiesEditionComponent extends StandardPropert
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.common.notify.Notification)
*/
public Diagnostic validateValue(PropertiesEditionEvent event) {
- String newStringValue = event.getNewValue().toString();
Diagnostic ret = null;
- try {
- if (ComponentsViewsRepository.Documentation.documentation == event.getAffectedEditor()) {
- Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getDocumentedElement_Documentation().getEAttributeType(), newStringValue);
- ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getDocumentedElement_Documentation().getEAttributeType(), newValue);
- }
+ if (event.getNewValue() != null) {
+ String newStringValue = event.getNewValue().toString();
+ try {
+ if (ComponentsViewsRepository.Documentation.documentation == event.getAffectedEditor()) {
+ Object newValue = EcoreUtil.createFromString(MappingPackage.eINSTANCE.getDocumentedElement_Documentation().getEAttributeType(), newStringValue);
+ ret = Diagnostician.INSTANCE.validate(MappingPackage.eINSTANCE.getDocumentedElement_Documentation().getEAttributeType(), newValue);
+ }
- } catch (IllegalArgumentException iae) {
- ret = BasicDiagnostic.toDiagnostic(iae);
+ } catch (IllegalArgumentException iae) {
+ ret = BasicDiagnostic.toDiagnostic(iae);
+ }
}
return ret;
}
@@ -287,15 +297,19 @@ public class DocumentedElementPropertiesEditionComponent extends StandardPropert
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validate()
*/
public Diagnostic validate() {
+ Diagnostic validate = null;
if (IPropertiesEditionComponent.BATCH_MODE.equals(editing_mode)) {
EObject copy = EcoreUtil.copy(PropertiesContextService.getInstance().entryPointElement());
copy = PropertiesContextService.getInstance().entryPointComponent().getPropertiesEditionObject(copy);
- return Diagnostician.INSTANCE.validate(copy);
+ validate = Diagnostician.INSTANCE.validate(copy);
}
else if (IPropertiesEditionComponent.LIVE_MODE.equals(editing_mode))
- return Diagnostician.INSTANCE.validate(documentedElement);
- else
- return null;
+ validate = Diagnostician.INSTANCE.validate(documentedElement);
+ // Start of user code for custom validation check
+
+ // End of user code
+
+ return validate;
}
diff --git a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/providers/DocumentedElementPropertiesEditionProvider.java b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/providers/DocumentedElementPropertiesEditionProvider.java
index 6eb8c6ad8..e858031a1 100644
--- a/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/providers/DocumentedElementPropertiesEditionProvider.java
+++ b/plugins/org.eclipse.emf.eef.components.edit/src-gen/org/eclipse/emf/eef/mapping/providers/DocumentedElementPropertiesEditionProvider.java
@@ -33,7 +33,7 @@ public class DocumentedElementPropertiesEditionProvider implements IPropertiesEd
public boolean provides(EObject eObject) {
return (eObject instanceof DocumentedElement) && (MappingPackage.eINSTANCE.getDocumentedElement() == eObject.eClass());
}
-
+
/**
* {@inheritDoc}
*
@@ -46,7 +46,7 @@ public class DocumentedElementPropertiesEditionProvider implements IPropertiesEd
}
return null;
}
-
+
/**
* {@inheritDoc}
*
@@ -60,5 +60,6 @@ public class DocumentedElementPropertiesEditionProvider implements IPropertiesEd
}
return null;
}
-
-}
+
+}
+

Back to the top