Commit e7282d6c authored by Bonita CI's avatar Bonita CI
Browse files

Merge branch 'master' into 'BS-9100_RESTAPISecurity_static'

parents 8d681a0d ee8ec659
...@@ -237,6 +237,7 @@ ...@@ -237,6 +237,7 @@
eType="ecore:EClass expression.ecore#//Expression" containment="true"/> eType="ecore:EClass expression.ecore#//Expression" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="intialResourceList" upperBound="-1" <eStructuralFeatures xsi:type="ecore:EAttribute" name="intialResourceList" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="downloadType" eType="#//FileWidgetDownloadType"/>
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Column"> <eClassifiers xsi:type="ecore:EClass" name="Column">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="width" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="width" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
...@@ -387,4 +388,9 @@ ...@@ -387,4 +388,9 @@
<eClassifiers xsi:type="ecore:EClass" name="GroupIterator" eSuperTypes="process.ecore#//Element"> <eClassifiers xsi:type="ecore:EClass" name="GroupIterator" eSuperTypes="process.ecore#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers> </eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="FileWidgetDownloadType">
<eLiterals name="Both" literal="Both"/>
<eLiterals name="URL" value="1" literal="URL"/>
<eLiterals name="Browse" value="2" literal="Browse"/>
</eClassifiers>
</ecore:EPackage> </ecore:EPackage>
...@@ -153,6 +153,11 @@ ...@@ -153,6 +153,11 @@
<genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetInputType/URL"/> <genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetInputType/URL"/>
<genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetInputType/Resource"/> <genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetInputType/Resource"/>
</genEnums> </genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="form.ecore#//FileWidgetDownloadType">
<genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetDownloadType/Both"/>
<genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetDownloadType/URL"/>
<genEnumLiterals ecoreEnumLiteral="form.ecore#//FileWidgetDownloadType/Browse"/>
</genEnums>
<genClasses ecoreClass="form.ecore#//Form"> <genClasses ecoreClass="form.ecore#//Form">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference form.ecore#//Form/widgets"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference form.ecore#//Form/widgets"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//Form/nColumn"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//Form/nColumn"/>
...@@ -276,6 +281,7 @@ ...@@ -276,6 +281,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//FileWidget/updateDocument"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//FileWidget/updateDocument"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference form.ecore#//FileWidget/outputDocumentListExpression"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference form.ecore#//FileWidget/outputDocumentListExpression"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//FileWidget/intialResourceList"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//FileWidget/intialResourceList"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//FileWidget/downloadType"/>
</genClasses> </genClasses>
<genClasses ecoreClass="form.ecore#//Column"> <genClasses ecoreClass="form.ecore#//Column">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//Column/width"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute form.ecore#//Column/width"/>
......
...@@ -8711,5 +8711,40 @@ ...@@ -8711,5 +8711,40 @@
featureName="defaultValueLiteral" dataValue="NONE" oldDataValue="0"/> featureName="defaultValueLiteral" dataValue="NONE" oldDataValue="0"/>
</changes> </changes>
</releases> </releases>
<releases date="2014-10-28T10:45:10.092+0100" label="6.4.0-004">
<changes xsi:type="history:Create" target="form.ecore#/" referenceName="eClassifiers"
element="form.ecore#//FileWidgetDownloadType"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType"
featureName="name" dataValue="FileWidgetDownloadType"/>
<changes xsi:type="history:Create" target="form.ecore#//FileWidgetDownloadType"
referenceName="eLiterals" element="form.ecore#//FileWidgetDownloadType/Both"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/Both"
featureName="literal" dataValue="Both"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/Both"
featureName="name" dataValue="Both"/>
<changes xsi:type="history:Create" target="form.ecore#//FileWidgetDownloadType"
referenceName="eLiterals" element="form.ecore#//FileWidgetDownloadType/URL"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/URL"
featureName="literal" dataValue="URL"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/URL"
featureName="name" dataValue="URL"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/URL"
featureName="value" dataValue="1" oldDataValue="0"/>
<changes xsi:type="history:Create" target="form.ecore#//FileWidgetDownloadType"
referenceName="eLiterals" element="form.ecore#//FileWidgetDownloadType/Browse"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/Browse"
featureName="literal" dataValue="Browse"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/Browse"
featureName="name" dataValue="Browse"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidgetDownloadType/Browse"
featureName="value" dataValue="2" oldDataValue="0"/>
<changes xsi:type="history:Create" target="form.ecore#//FileWidget" referenceName="eStructuralFeatures"
element="form.ecore#//FileWidget/downloadType"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidget/downloadType"
featureName="name" dataValue="downloadType"/>
<changes xsi:type="history:Set" element="form.ecore#//FileWidget/downloadType"
featureName="eType" referenceValue="form.ecore#//FileWidgetDownloadType"/>
<changes xsi:type="history:MigrationChange" migration="org.bonitasoft.studio.migration.custom.migration.form.FileWidgetResourceMigration"/>
</releases>
<releases/> <releases/>
</history:History> </history:History>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.bonitasoft.studio.actors.ui.section; package org.bonitasoft.studio.actors.ui.section;
import org.bonitasoft.studio.actors.i18n.Messages; import org.bonitasoft.studio.actors.i18n.Messages;
import org.bonitasoft.studio.common.emf.converter.BooleanInverserConverter;
import org.bonitasoft.studio.common.emf.tools.ModelHelper; import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry; import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry;
import org.bonitasoft.studio.model.process.Actor; import org.bonitasoft.studio.model.process.Actor;
...@@ -64,30 +65,17 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti ...@@ -64,30 +65,17 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti
useLaneActorButton.setEnabled(current instanceof Lane) ; useLaneActorButton.setEnabled(current instanceof Lane) ;
final IObservableValue value = EMFEditObservables.observeValue(getEditingDomain(), assignable, ProcessPackage.Literals.TASK__OVERRIDE_ACTORS_OF_THE_LANE) ; final IObservableValue value = EMFEditObservables.observeValue(getEditingDomain(), assignable, ProcessPackage.Literals.TASK__OVERRIDE_ACTORS_OF_THE_LANE) ;
emfDatabindingContext.bindValue(SWTObservables.observeSelection(taskActorButton), value) ; emfDatabindingContext.bindValue(SWTObservables.observeSelection(taskActorButton), value) ;
emfDatabindingContext.bindValue(SWTObservables.observeSelection(useLaneActorButton), value,new UpdateValueStrategy(),new UpdateValueStrategy().setConverter(new Converter(Boolean.class,Boolean.class){ emfDatabindingContext.bindValue(SWTObservables.observeSelection(useLaneActorButton), value, new UpdateValueStrategy(),
new UpdateValueStrategy().setConverter(new BooleanInverserConverter()));
@Override final UpdateValueStrategy updateValueStrategy = new UpdateValueStrategy().setConverter(new BooleanInverserConverter());
public Object convert(Object from) { emfDatabindingContext.bindValue(SWTObservables.observeEnabled(actorComboViewer.getControl()), SWTObservables.observeSelection(useLaneActorButton),new UpdateValueStrategy(),updateValueStrategy);
return !(Boolean) from;
}
})) ;
final UpdateValueStrategy updateValueStrategy = new UpdateValueStrategy().setConverter(new Converter(Boolean.class,Boolean.class){
@Override
public Object convert(Object from) {
return !(Boolean) from;
}
});
emfDatabindingContext.bindValue(SWTObservables.observeEnabled(actorComboViewer.getControl()), SWTObservables.observeSelection(useLaneActorButton),new UpdateValueStrategy(),updateValueStrategy);
databindactorDefinedInLaneLabel(assignable); databindactorDefinedInLaneLabel(assignable);
} }
} }
private void databindactorDefinedInLaneLabel(Assignable assignable) { private void databindactorDefinedInLaneLabel(final Assignable assignable) {
final Lane parentLane = ModelHelper.getParentLane(assignable); final Lane parentLane = ModelHelper.getParentLane(assignable);
if(parentLane != null){ if(parentLane != null){
...@@ -102,7 +90,7 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti ...@@ -102,7 +90,7 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti
new UpdateValueStrategy().setConverter(new Converter(Object.class, String.class) { new UpdateValueStrategy().setConverter(new Converter(Object.class, String.class) {
@Override @Override
public String convert(Object fromObject) { public String convert(final Object fromObject) {
if(fromObject != null){ if(fromObject != null){
return "("+((Actor)fromObject).getName()+")"; return "("+((Actor)fromObject).getName()+")";
} else { } else {
...@@ -115,7 +103,7 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti ...@@ -115,7 +103,7 @@ public class AssignableActorsPropertySection extends AbstractActorsPropertySecti
} }
@Override @Override
protected void createRadioComposite(TabbedPropertySheetWidgetFactory widgetFactory,Composite mainComposite) { protected void createRadioComposite(final TabbedPropertySheetWidgetFactory widgetFactory,final Composite mainComposite) {
radioComposite = widgetFactory.createComposite(mainComposite, SWT.NONE) ; radioComposite = widgetFactory.createComposite(mainComposite, SWT.NONE) ;
radioComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).span(3, 1).create()) ; radioComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).span(3, 1).create()) ;
radioComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).margins(0, 0).create()) ; radioComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).margins(0, 0).create()) ;
......
...@@ -65,6 +65,7 @@ Export-Package: org.bonitasoft.studio.common, ...@@ -65,6 +65,7 @@ Export-Package: org.bonitasoft.studio.common,
org.bonitasoft.studio.common.dialog, org.bonitasoft.studio.common.dialog,
org.bonitasoft.studio.common.editingdomain, org.bonitasoft.studio.common.editingdomain,
org.bonitasoft.studio.common.editor, org.bonitasoft.studio.common.editor,
org.bonitasoft.studio.common.emf.converter,
org.bonitasoft.studio.common.emf.tools, org.bonitasoft.studio.common.emf.tools,
org.bonitasoft.studio.common.exporter, org.bonitasoft.studio.common.exporter,
org.bonitasoft.studio.common.extension, org.bonitasoft.studio.common.extension,
......
/**
* Copyright (C) 2014 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.common.emf.converter;
import org.assertj.core.api.Assertions;
import org.junit.Test;
public class BooleanInverserConverterTest {
@Test
public void testGetToType() {
Assertions.assertThat(new BooleanInverserConverter().getToType()).isEqualTo(Boolean.class);
}
@Test
public void testGetFromType() {
Assertions.assertThat(new BooleanInverserConverter().getFromType()).isEqualTo(Boolean.class);
}
@Test
public void testConvert() {
Assertions.assertThat(new BooleanInverserConverter().convert(true)).isEqualTo(Boolean.FALSE);
Assertions.assertThat(new BooleanInverserConverter().convert(false)).isEqualTo(Boolean.TRUE);
}
}
...@@ -20,7 +20,7 @@ package org.bonitasoft.studio.common; ...@@ -20,7 +20,7 @@ package org.bonitasoft.studio.common;
public class ModelVersion { public class ModelVersion {
public static final String VERSION_6_0_0_ALPHA = "6.0.0-Alpha"; public static final String VERSION_6_0_0_ALPHA = "6.0.0-Alpha";
public static final String CURRENT_VERSION = "6.4.0-003"; public static final String CURRENT_VERSION = "6.4.0-004";
public static boolean sameVersion(final String version) { public static boolean sameVersion(final String version) {
return CURRENT_VERSION.equals(version); return CURRENT_VERSION.equals(version);
......
/**
* Copyright (C) 2014 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.common.emf.converter;
import org.eclipse.core.databinding.conversion.Converter;
public class BooleanInverserConverter extends Converter {
public BooleanInverserConverter() {
super(Boolean.class, Boolean.class);
}
@Override
public Object convert(final Object arg0) {
return !((Boolean) arg0);
}
}
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or * the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
...@@ -22,6 +22,7 @@ import java.util.HashSet; ...@@ -22,6 +22,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.bonitasoft.studio.common.emf.converter.BooleanInverserConverter;
import org.bonitasoft.studio.common.emf.tools.ExpressionHelper; import org.bonitasoft.studio.common.emf.tools.ExpressionHelper;
import org.bonitasoft.studio.common.emf.tools.ModelHelper; import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry; import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry;
...@@ -46,7 +47,6 @@ import org.bonitasoft.studio.model.expression.ExpressionPackage; ...@@ -46,7 +47,6 @@ import org.bonitasoft.studio.model.expression.ExpressionPackage;
import org.bonitasoft.studio.model.parameter.Parameter; import org.bonitasoft.studio.model.parameter.Parameter;
import org.bonitasoft.studio.model.process.Data; import org.bonitasoft.studio.model.process.Data;
import org.eclipse.core.databinding.UpdateValueStrategy; import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.conversion.Converter;
import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.IValueChangeListener; import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent; import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
...@@ -118,21 +118,21 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -118,21 +118,21 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
private EmbeddedEditor comparisonEditor; private EmbeddedEditor comparisonEditor;
private EObject context; private final EObject context;
private ComposedAdapterFactory adapterFactory; private final ComposedAdapterFactory adapterFactory;
private AdapterFactoryLabelProvider adapterLabelProvider; private final AdapterFactoryLabelProvider adapterLabelProvider;
private Expression inputExpression; private Expression inputExpression;
private XtextResource resource; private XtextResource resource;
private Resource eResource; private final Resource eResource;
private boolean isPageFlowContext = false; private boolean isPageFlowContext = false;
public ComparisonExpressionEditor(Resource eResource, EObject context) { public ComparisonExpressionEditor(final Resource eResource, final EObject context) {
this.context = context; this.context = context;
this.eResource = eResource; this.eResource = eResource;
adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
...@@ -144,7 +144,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -144,7 +144,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
* @see org.bonitasoft.studio.expression.editor.provider.IExpressionEditor#createExpressionEditor(org.eclipse.swt.widgets.Composite) * @see org.bonitasoft.studio.expression.editor.provider.IExpressionEditor#createExpressionEditor(org.eclipse.swt.widgets.Composite)
*/ */
@Override @Override
public Control createExpressionEditor(Composite parent, EMFDataBindingContext ctx) { public Control createExpressionEditor(final Composite parent, final EMFDataBindingContext ctx) {
final Composite mainComposite = new Composite(parent, SWT.NONE); final Composite mainComposite = new Composite(parent, SWT.NONE);
mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create()); mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
...@@ -155,8 +155,8 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -155,8 +155,8 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
return mainComposite; return mainComposite;
} }
protected void createHeader(Composite parent) { protected void createHeader(final Composite parent) {
Composite header = new Composite(parent, SWT.NONE); final Composite header = new Composite(parent, SWT.NONE);
header.setLayout(GridLayoutFactory.fillDefaults().create()); header.setLayout(GridLayoutFactory.fillDefaults().create());
header.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); header.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
final Label autocompleteMessage = new Label(header, SWT.WRAP); final Label autocompleteMessage = new Label(header, SWT.WRAP);
...@@ -171,8 +171,8 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -171,8 +171,8 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
} }
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
protected void createComparisonEditor(Composite parent) { protected void createComparisonEditor(final Composite parent) {
IEditedResourceProvider resourceProvider = new IEditedResourceProvider() { final IEditedResourceProvider resourceProvider = new IEditedResourceProvider() {
@Override @Override
public XtextResource createResource() { public XtextResource createResource() {
...@@ -185,23 +185,23 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -185,23 +185,23 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
resource.setValidationDisabled(false); resource.setValidationDisabled(false);
final ConditionModelGlobalScopeProvider globalScopeProvider = injector.getInstance(ConditionModelGlobalScopeProvider.class); final ConditionModelGlobalScopeProvider globalScopeProvider = injector.getInstance(ConditionModelGlobalScopeProvider.class);
final List<String> accessibleObjects = new ArrayList<String>(); final List<String> accessibleObjects = new ArrayList<String>();
for (Data d : ModelHelper.getAccessibleData(context)) { for (final Data d : ModelHelper.getAccessibleData(context)) {
accessibleObjects.add(ModelHelper.getEObjectID(d)); accessibleObjects.add(ModelHelper.getEObjectID(d));
} }
for (Parameter p : ModelHelper.getParentProcess(context).getParameters()) { for (final Parameter p : ModelHelper.getParentProcess(context).getParameters()) {
accessibleObjects.add(ModelHelper.getEObjectID(p)); accessibleObjects.add(ModelHelper.getEObjectID(p));
} }
globalScopeProvider.setAccessibleEObjects(accessibleObjects); globalScopeProvider.setAccessibleEObjects(accessibleObjects);
return (XtextResource) resource; return resource;
} catch (Exception e) { } catch (final Exception e) {
BonitaStudioLog.error(e, ExpressionEditorPlugin.PLUGIN_ID); BonitaStudioLog.error(e, ExpressionEditorPlugin.PLUGIN_ID);
return null; return null;
} }
} }
}; };
ConditionModelActivator activator = ConditionModelActivator.getInstance(); final ConditionModelActivator activator = ConditionModelActivator.getInstance();
Injector injector = activator.getInjector(ConditionModelActivator.ORG_BONITASOFT_STUDIO_CONDITION_CONDITIONMODEL); final Injector injector = activator.getInjector(ConditionModelActivator.ORG_BONITASOFT_STUDIO_CONDITION_CONDITIONMODEL);
EmbeddedEditorFactory factory = injector.getInstance(EmbeddedEditorFactory.class); final EmbeddedEditorFactory factory = injector.getInstance(EmbeddedEditorFactory.class);
final Builder buildEditor = factory.newEditor(resourceProvider); final Builder buildEditor = factory.newEditor(resourceProvider);
comparisonEditor = buildEditor.withParent(parent); comparisonEditor = buildEditor.withParent(parent);
...@@ -210,13 +210,13 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -210,13 +210,13 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
comparisonEditor.getViewer().addTextListener(new ITextListener() { comparisonEditor.getViewer().addTextListener(new ITextListener() {
@Override @Override
public void textChanged(TextEvent event) { public void textChanged(final TextEvent event) {
comparisonEditor.getViewer().getControl().notifyListeners(SWT.Modify, new Event()); comparisonEditor.getViewer().getControl().notifyListeners(SWT.Modify, new Event());
} }
}); });
} }
protected void createDependanciesResolutionComposite(Composite parent) { protected void createDependanciesResolutionComposite(final Composite parent) {
final Composite dependanciesComposite = new Composite(parent, SWT.NONE); final Composite dependanciesComposite = new Composite(parent, SWT.NONE);
dependanciesComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).create()); dependanciesComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).create());
dependanciesComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create()); dependanciesComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create());
...@@ -227,7 +227,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -227,7 +227,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
automaticResolutionButton.addSelectionListener(new SelectionAdapter() { automaticResolutionButton.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(final SelectionEvent e) {
if (automaticResolutionButton.getSelection()) { if (automaticResolutionButton.getSelection()) {
removeDependencyButton.setEnabled(false); removeDependencyButton.setEnabled(false);
updateDependencies(); updateDependencies();
...@@ -240,7 +240,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -240,7 +240,7 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
dependencySection.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).create()); dependencySection.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).create());
dependencySection.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create()); dependencySection.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());
Composite dependenciesComposite = new Composite(dependencySection, SWT.NONE); final Composite dependenciesComposite = new Composite(dependencySection, SWT.NONE);
dependenciesComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); dependenciesComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
dependenciesComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create()); dependenciesComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create());
...@@ -251,14 +251,14 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i ...@@ -251,14 +251,14 @@ public class ComparisonExpressionEditor extends SelectionAwareExpressionEditor i
dependenciesViewer.addSelectionChangedListener(new ISelectionChangedListener() { dependenciesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override @Override
public void selectionChanged(SelectionChangedEvent event) { public void selectionChanged(final SelectionChangedEvent event) {
if (!event.getSelection().isEmpty() && !automaticResolutionButton.getSelection()) { if (!event.getSelection().isEmpty() && !automaticResolutionButton.getSelection()) {
removeDependencyButton.setEnabled(true); removeDependencyButton.setEnabled(true);
} }
} }
}); });
Composite addRemoveComposite = new Composite(dependenciesComposite, SWT.NONE); final Composite addRemoveComposite = new Composite(dependenciesComposite, SWT.NONE);
addRemoveComposite.setLayoutData(GridDataFactory.fillDefaults().create()); addRemoveComposite.setLayoutData(GridDataFactory.fillDefaults().create());
addRemoveComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(0, 0).create()); addRemoveComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(0, 0).create());