Commit d5d1dfcb authored by Romain Bioteau's avatar Romain Bioteau

Merge branch 'master' of git@github.com:bonitasoft/bonita-studio-sp.git

parents b00b3408 1bc8c508
......@@ -219,6 +219,7 @@ currentScript=Original Source
refactoredScript=Refactored Source
refactorTitle=Refactor {0}
reviewChangesMessageRefactoring=Replacing {0} by {1} might cause minor errors in scripts{2}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the name change.
reviewTypeChangesMessageRefactoring=Updating {0} type might cause minor errors in scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the type change.
reviewChangesMessageRemoving={0} has been removed from all scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the remove operation.
reviewChangesMessageWithConditionPlace=and conditions
askConfirmationForDeleting=Do you really want to remove the following widget\: {0} \nif the variable is used in a Groovy script, the refactor window is displayed and you can validate the changes.
......
......@@ -220,6 +220,7 @@ currentScript=script original
refactoredScript=Script revisado
refactorTitle=Refactorizar {0}
reviewChangesMessageRefactoring=La sustituci\u00f3n de {0} por {1} puede causar errores menores en los scripts {2}. \nHaga doble clic en el nombre del script para revisar y editar los cambios. Haga clic en Cancelar para anular el cambio de nombre.
reviewTypeChangesMessageRefactoring=Updating {0} type might cause minor errors in scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the type change.
reviewChangesMessageRemoving={0} ha sido eliminado de todos los scripts {1}. \nHaga doble clic en el nombre del script para revisar y editar los cambios. Haga clic en Cancelar para anular la eliminaci\u00f3n realizada.
reviewChangesMessageWithConditionPlace=y las condiciones
askConfirmationForDeleting=\u00bfRealmente desea borrar los datos siguientes \: {0}
......
......@@ -220,6 +220,7 @@ currentScript=Source originale
refactoredScript=Source modifi\u00e9e
refactorTitle=Renommer {0}
reviewChangesMessageRefactoring=Remplacer {0} par {1} pourrait causer des erreurs mineures dans les scripts {2}.\nDouble-cliquez sur le nom d''un script afin de revoir les changements apport\u00e9s. Cliquez sur Annuler pour ne pas effectuer ce renommage.
reviewTypeChangesMessageRefactoring=Updating {0} type might cause minor errors in scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the type change.
reviewChangesMessageRemoving={0} a \u00e9t\u00e9 supprim\u00e9 de tous les scripts{1}. \nDouble-cliquez sur un nom de script afin de revoir les changements apport\u00e9s. \nCliquez sur Annuler pour ne pas effectuer la suppression.
reviewChangesMessageWithConditionPlace=et les conditions
askConfirmationForDeleting=Voulez-vous vraiment supprimer les donn\u00e9es suivantes\: {0}
......
......@@ -220,6 +220,7 @@ currentScript=\u5143\u306e\u30bd\u30fc\u30b9
refactoredScript=\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u305f\u30bd\u30fc\u30b9
refactorTitle={0} \u3092\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3059\u308b
reviewChangesMessageRefactoring={1} \u3067 {0} \u3092\u7f6e\u304d\u63db\u3048\u308b\u3068\u3001\u30b9\u30af\u30ea\u30d7\u30c8 {2} \u3067\u30de\u30a4\u30ca\u30fc\u306a\u30a8\u30e9\u30fc\u3092\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n\u5909\u66f4\u3092\u78ba\u8a8d\u3057\u3001\u7de8\u96c6\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002\u540d\u524d\u306e\u5909\u66f4\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u305f\u3044\u5834\u5408\u306f\u3001 \u300c\u30ad\u30e3\u30f3\u30bb\u30eb] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002
reviewTypeChangesMessageRefactoring=Updating {0} type might cause minor errors in scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the type change.
reviewChangesMessageRemoving={0} \u306f\u3059\u3079\u3066\u306e\u30b9\u30af\u30ea\u30d7\u30c8 {1} \u304b\u3089\u524a\u9664\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\u5909\u66f4\u3092\u78ba\u8a8d\u3057\u3001\u7de8\u96c6\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u540d\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002\u524a\u9664\u64cd\u4f5c\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u305f\u3044\u5834\u5408\u306f\u3001 \u300c\u30ad\u30e3\u30f3\u30bb\u30eb\u300d \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002
reviewChangesMessageWithConditionPlace=\u3068\u6761\u4ef6
askConfirmationForDeleting=\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u672c\u5f53\u306b\u524a\u9664\u3057\u305f\u3044\u3067\u3059\u304b\uff1a
......
......@@ -283,5 +283,6 @@ public class Messages extends NLS {
public static String invalidPath;
public static String pathDoesNotExist;
public static String moreDetails;
public static String reviewTypeChangesMessageRefactoring;
}
......@@ -31,7 +31,6 @@ public class TomcatVmArgsBuilder {
protected static final String WATCHDOG_PORT_PROPERTY = "org.bonitasoft.studio.watchdog.port";
protected static final String BONITA_WEB_REGISTER = "bonita.web.register";
private final RepositoryAccessor repositoryAccessor;
public TomcatVmArgsBuilder(final RepositoryAccessor repositoryAccessor) {
......@@ -54,13 +53,18 @@ public class TomcatVmArgsBuilder {
addSystemProperty(args, "wtp.deploy", "\"" + tomcatInstanceLocation + File.separatorChar + "webapps\"");
addSystemProperty(args, "java.endorsed.dirs", "\"" + tomcatInstanceLocation + File.separatorChar + "endorsed\"");
addSystemProperty(args, "sysprop.bonita.db.vendor", "h2");
addSystemProperty(args, "org.bonitasoft.platform.setup.folder", "\"" + bundleLocation + File.separatorChar + "setup\"");
addSystemProperty(args, "org.bonitasoft.platform.setup.folder",
"\"" + bundleLocation + File.separatorChar + "setup\"");
addSystemProperty(args, "org.bonitasoft.engine.incident.folder",
"\"" + tomcatInstanceLocation + File.separatorChar + "logs\"");
addSystemProperty(args, "bitronix.tm.configuration",
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar + "bitronix-config.properties\"");
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar
+ "bitronix-config.properties\"");
addSystemProperty(args, "java.util.logging.manager", "org.apache.juli.ClassLoaderLogManager");
if (tomcatExtraParams == null || !tomcatExtraParams.contains("-Djava.util.logging.config.file=")) {
addSystemProperty(args, "java.util.logging.config.file",
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar + "logging.properties\"");
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar
+ "logging.properties\"");
}
addSystemProperty(args, "file.encoding", "UTF-8");
addWatchDogProperties(args);
......@@ -91,7 +95,6 @@ public class TomcatVmArgsBuilder {
repositoryAccessor.getCurrentRepository().getDatabaseHandler().createBitronixConfFile();
}
public String getProductApplicationId() {
return Platform.getProduct() != null ? Platform.getProduct().getApplication() : null;
}
......@@ -106,7 +109,8 @@ public class TomcatVmArgsBuilder {
addSystemProperty(args, workspaceSystemProperties.getPageRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getWidgetRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getFragmentRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getRestAPIURL(WorkspaceResourceServerManager.getInstance().runningPort()));
addSystemProperty(args,
workspaceSystemProperties.getRestAPIURL(WorkspaceResourceServerManager.getInstance().runningPort()));
addSystemProperty(args, workspaceSystemProperties.activateSpringProfile("studio"));
}
......
......@@ -19,8 +19,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.repository.RepositoryAccessor;
import org.bonitasoft.studio.diagram.custom.repository.DiagramRepositoryStore;
......@@ -30,17 +28,14 @@ import org.bonitasoft.studio.model.process.CallActivity;
import org.bonitasoft.studio.model.process.ContractInput;
import org.bonitasoft.studio.model.process.Data;
import org.bonitasoft.studio.model.process.Pool;
import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.emf.ecore.EObject;
@Creatable
public class CallActivityHelper {
private final RepositoryAccessor repositoryAccessor;
private final CallActivitySelectionProvider selectionProvider;
@Inject
public CallActivityHelper(RepositoryAccessor repositoryAccessor, CallActivitySelectionProvider selectionProvider) {
this.repositoryAccessor = repositoryAccessor;
this.selectionProvider = selectionProvider;
......
......@@ -14,8 +14,6 @@
*/
package org.bonitasoft.studio.properties.sections.callActivity;
import javax.inject.Singleton;
import org.bonitasoft.studio.common.jface.selection.EObjectAdaptableSelectionProvider;
import org.bonitasoft.studio.model.process.CallActivity;
import org.eclipse.core.runtime.IAdaptable;
......@@ -23,7 +21,6 @@ import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.emf.ecore.EObject;
@Creatable
@Singleton
public class CallActivitySelectionProvider extends EObjectAdaptableSelectionProvider {
/*
......@@ -37,8 +34,9 @@ public class CallActivitySelectionProvider extends EObjectAdaptableSelectionProv
final Object object = unwrap(selection);
if (object instanceof EObject) {
return asCallActivity((EObject) object);
} else if (object != null) {
return asCallActivity((EObject) ((IAdaptable) object).getAdapter(EObject.class));
}
return asCallActivity((EObject) ((IAdaptable) object).getAdapter(EObject.class));
}
return null;
}
......
......@@ -29,6 +29,7 @@ import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.jface.databinding.CustomEMFEditObservables;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.repository.RepositoryAccessor;
import org.bonitasoft.studio.common.widgets.MagicComposite;
import org.bonitasoft.studio.expression.editor.filter.AvailableExpressionTypeFilter;
import org.bonitasoft.studio.expression.editor.viewer.ExpressionViewer;
......@@ -75,15 +76,10 @@ import org.eclipse.ui.progress.IProgressService;
public class InputParametersMappingSection extends AbstractBonitaDescriptionSection {
@Inject
private FetchContractOperation fetchContractOperation;
@Inject
private IProgressService progressService;
@Inject
private ISharedImages sharedImages;
@Inject
private CallActivitySelectionProvider selectionProvider;
@Inject
private CallActivityHelper callActivityHelper;
private MagicComposite inputMappingControl;
......@@ -92,6 +88,19 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
private EMFDataBindingContext dbc;
@Inject
public InputParametersMappingSection(RepositoryAccessor repositoryAccessor,
FetchContractOperation fetchContractOperation,
IProgressService progressService,
ISharedImages sharedImages,
CallActivitySelectionProvider selectionProvider) {
this.fetchContractOperation = fetchContractOperation;
this.progressService = progressService;
this.sharedImages = sharedImages;
this.selectionProvider = selectionProvider;
this.callActivityHelper = new CallActivityHelper(repositoryAccessor, selectionProvider);
}
@Override
public void refresh() {
super.refresh();
......@@ -138,7 +147,8 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
createInputMapping(null, InputMappingAssignationType.CONTRACT_INPUT, input.getName());
}
} catch (final InvocationTargetException ex) {
MessageDialogWithLink.openWarning(mainComposite.getShell(), Messages.fetchContract, ex.getCause().getMessage());
MessageDialogWithLink.openWarning(mainComposite.getShell(), Messages.fetchContract,
ex.getCause().getMessage());
} catch (final InterruptedException e1) {
BonitaStudioLog.error(e1);
}
......@@ -202,8 +212,10 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
neverUpdateValueStrategy().create(), updateValueStrategy().withConverter(hideIfEmpty()).create());
final Button addLineButton = getWidgetFactory().createButton(composite, Messages.Add, SWT.FLAT);
addLineButton.setLayoutData(GridDataFactory.swtDefaults().hint(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).indent(15, 0).create());
addLineButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_ADD_INPUT);
addLineButton.setLayoutData(
GridDataFactory.swtDefaults().hint(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).indent(15, 0).create());
addLineButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_ADD_INPUT);
addLineButton.addListener(SWT.Selection, new Listener() {
@Override
......@@ -228,16 +240,19 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
};
}
protected void createInputMapping(final Data source, final InputMappingAssignationType assignationType, final String target) {
protected void createInputMapping(final Data source, final InputMappingAssignationType assignationType,
final String target) {
final InputMapping mapping = ProcessFactory.eINSTANCE.createInputMapping();
mapping.setProcessSource(
source == null ? ExpressionHelper.createConstantExpression("", String.class.getName()) : ExpressionHelper.createVariableExpression(source));
source == null ? ExpressionHelper.createConstantExpression("", String.class.getName())
: ExpressionHelper.createVariableExpression(source));
if (target != null) {
mapping.setSubprocessTarget(target);
}
mapping.setAssignationType(assignationType);
final CallActivity callActivity = (CallActivity) selectionProvider.getAdapter(EObject.class);
getEditingDomain().getCommandStack().execute(new AddCommand(getEditingDomain(), callActivity.getInputMappings(), mapping));
getEditingDomain().getCommandStack()
.execute(new AddCommand(getEditingDomain(), callActivity.getInputMappings(), mapping));
addInputMappingLine(inputMappingControl, mapping);
}
......@@ -258,7 +273,8 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
}
if (newValue != mapping.getAssignationType()) {
getEditingDomain().getCommandStack().execute(
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.INPUT_MAPPING__ASSIGNATION_TYPE, newValue));
new SetCommand(getEditingDomain(), mapping,
ProcessPackage.Literals.INPUT_MAPPING__ASSIGNATION_TYPE, newValue));
targetCombo.removeAll();
updateAvailableValuesInputMappingTargetCombo(targetCombo, newValue);
}
......@@ -266,14 +282,16 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
});
final Button deleteButton = getWidgetFactory().createButton(outputMappingControl, null, SWT.FLAT);
deleteButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_DELETE_INPUT);
deleteButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_DELETE_INPUT);
deleteButton.setImage(sharedImages.getImage(ISharedImages.IMG_TOOL_DELETE));
deleteButton.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(final Event event) {
final CallActivity callActivity = (CallActivity) selectionProvider.getAdapter(EObject.class);
final RemoveCommand command = new RemoveCommand(getEditingDomain(), callActivity.getInputMappings(), mapping);
final RemoveCommand command = new RemoveCommand(getEditingDomain(), callActivity.getInputMappings(),
mapping);
getEditingDomain().getCommandStack().execute(command);
srcCombo.getControl().setData(MagicComposite.HIDDEN, true);
srcCombo.getControl().setVisible(false);
......@@ -300,17 +318,20 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
@Override
public void handleEvent(final Event event) {
getEditingDomain().getCommandStack().execute(
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.INPUT_MAPPING__SUBPROCESS_TARGET, targetCombo.getText()));
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.INPUT_MAPPING__SUBPROCESS_TARGET,
targetCombo.getText()));
}
});
if (mapping.getSubprocessTarget() != null) {
targetCombo.setText(mapping.getSubprocessTarget());
}
targetCombo.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_INPUT_CALLEDTARGET);
targetCombo.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_INPUT_CALLEDTARGET);
return targetCombo;
}
protected void updateAvailableValuesInputMappingTargetCombo(final CCombo targetCombo, final InputMappingAssignationType assignationType) {
protected void updateAvailableValuesInputMappingTargetCombo(final CCombo targetCombo,
final InputMappingAssignationType assignationType) {
if (InputMappingAssignationType.DATA == assignationType) {
for (final String subprocessData : callActivityHelper.getCallActivityData()) {
targetCombo.add(subprocessData);
......@@ -338,21 +359,27 @@ public class InputParametersMappingSection extends AbstractBonitaDescriptionSect
break;
}
assignationTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
assignationTypeCombo.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_INPUT_ASSIGNATIONTYPE);
assignationTypeCombo.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_INPUT_ASSIGNATIONTYPE);
return assignationTypeCombo;
}
private ExpressionViewer createInputMappingExpressionViewer(final Composite outputMappingControl, final InputMapping mapping) {
private ExpressionViewer createInputMappingExpressionViewer(final Composite outputMappingControl,
final InputMapping mapping) {
final ExpressionViewer srcCombo = new ExpressionViewer(outputMappingControl, SWT.BORDER, getWidgetFactory());
srcCombo.getControl().setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).hint(250, SWT.DEFAULT).create());
srcCombo.addFilter(new AvailableExpressionTypeFilter(ExpressionConstants.CONSTANT_TYPE, ExpressionConstants.VARIABLE_TYPE,
ExpressionConstants.SCRIPT_TYPE, ExpressionConstants.PARAMETER_TYPE, ExpressionConstants.DOCUMENT_TYPE));
srcCombo.getControl().setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false)
.hint(250, SWT.DEFAULT).create());
srcCombo.addFilter(
new AvailableExpressionTypeFilter(ExpressionConstants.CONSTANT_TYPE, ExpressionConstants.VARIABLE_TYPE,
ExpressionConstants.SCRIPT_TYPE, ExpressionConstants.PARAMETER_TYPE,
ExpressionConstants.DOCUMENT_TYPE));
dbc.bindValue(ViewersObservables.observeInput(srcCombo),
ViewersObservables.observeSingleSelection(selectionProvider));
if (mapping.getProcessSource() == null) {
getEditingDomain().getCommandStack().execute(SetCommand.create(getEditingDomain(), mapping, ProcessPackage.Literals.INPUT_MAPPING__PROCESS_SOURCE,
ExpressionHelper.createConstantExpression("", String.class.getName())));
getEditingDomain().getCommandStack().execute(
SetCommand.create(getEditingDomain(), mapping, ProcessPackage.Literals.INPUT_MAPPING__PROCESS_SOURCE,
ExpressionHelper.createConstantExpression("", String.class.getName())));
}
dbc.bindValue(ViewersObservables.observeSingleSelection(srcCombo),
EMFObservables.observeValue(mapping, ProcessPackage.Literals.INPUT_MAPPING__PROCESS_SOURCE));
......
......@@ -26,6 +26,7 @@ import org.bonitasoft.studio.common.jface.EMFFeatureLabelProvider;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.jface.databinding.CustomEMFEditObservables;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.repository.RepositoryAccessor;
import org.bonitasoft.studio.common.widgets.MagicComposite;
import org.bonitasoft.studio.model.process.CallActivity;
import org.bonitasoft.studio.model.process.Data;
......@@ -70,11 +71,10 @@ import org.eclipse.ui.IWorkbenchPart;
public class OutputParametersMappingSection extends AbstractBonitaDescriptionSection {
@Inject
private ISharedImages sharedImages;
@Inject
private CallActivitySelectionProvider selectionProvider;
@Inject
private CallActivityHelper callActivityHelper;
private MagicComposite outputMappingControl;
......@@ -83,6 +83,13 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
private EMFDataBindingContext dbc;
@Inject
public OutputParametersMappingSection(RepositoryAccessor repositoryAccessor,
CallActivitySelectionProvider selectionProvider, ISharedImages sharedImages) {
this.selectionProvider = selectionProvider;
this.callActivityHelper = new CallActivityHelper(repositoryAccessor, selectionProvider);
this.sharedImages = sharedImages;
}
/*
* (non-Javadoc)
......@@ -130,6 +137,7 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
mainComposite = getWidgetFactory().createComposite(parent);
doCreateControls(mainComposite);
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.properties.sections.subprocess.ParametersMappingSection#doCreateControls(org.eclipse.swt.widgets.Composite)
......@@ -151,9 +159,11 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
getWidgetFactory().adapt(outputMappingControl);
outputMappingControl.setLayout(GridLayoutFactory.fillDefaults().numColumns(4).margins(0, 0).create());
final Label targetParameterLabel = getWidgetFactory().createLabel(outputMappingControl, Messages.dataFromCalledProcess);
final Label targetParameterLabel = getWidgetFactory().createLabel(outputMappingControl,
Messages.dataFromCalledProcess);
targetParameterLabel.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).indent(15, 0).create());
final Control sourceParameterLabel = getWidgetFactory().createLabel(outputMappingControl, Messages.dataInRootProcess);
final Control sourceParameterLabel = getWidgetFactory().createLabel(outputMappingControl,
Messages.dataInRootProcess);
sourceParameterLabel.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create());
final IObservableValue inputMappibngsObservable = CustomEMFEditObservables.observeDetailValue(Realm.getDefault(),
......@@ -163,10 +173,12 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
neverUpdateValueStrategy().create(), updateValueStrategy().withConverter(hideIfEmpty()).create());
dbc.bindValue(SWTObservables.observeVisible(targetParameterLabel), inputMappibngsObservable,
neverUpdateValueStrategy().create(), updateValueStrategy().withConverter(hideIfEmpty()).create());
final Button addLineButton = getWidgetFactory().createButton(composite, Messages.Add, SWT.FLAT);
addLineButton.setLayoutData(GridDataFactory.swtDefaults().hint(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).indent(15, 0).create());
addLineButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_ADD_OUTPUT);
addLineButton.setLayoutData(
GridDataFactory.swtDefaults().hint(IDialogConstants.BUTTON_WIDTH, SWT.DEFAULT).indent(15, 0).create());
addLineButton.setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY,
SWTBotConstants.SWTBOT_ID_CALLACTIVITY_MAPPING_ADD_OUTPUT);
addLineButton.addListener(SWT.Selection, new Listener() {
@Override
......@@ -200,11 +212,11 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
outputMapping.setSubprocessSource(source);
}
final CallActivity callActivity = (CallActivity) selectionProvider.getAdapter(EObject.class);
getEditingDomain().getCommandStack().execute(new AddCommand(getEditingDomain(), callActivity.getOutputMappings(), outputMapping));
getEditingDomain().getCommandStack()
.execute(new AddCommand(getEditingDomain(), callActivity.getOutputMappings(), outputMapping));
addOutputMappingLine(outputMappingControl, outputMapping);
}
protected void addOutputMappingLine(final Composite outputMappingControl, final OutputMapping mapping) {
final CCombo subprocessSourceCombo = createSubprocessSourceCombo(outputMappingControl, mapping);
final Label assignToLabel = getWidgetFactory().createLabel(outputMappingControl, Messages.assignTo);
......@@ -217,7 +229,8 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
@Override
public void handleEvent(final Event event) {
final CallActivity callActivity = (CallActivity) selectionProvider.getAdapter(EObject.class);
final RemoveCommand command = new RemoveCommand(getEditingDomain(), callActivity.getOutputMappings(), mapping);
final RemoveCommand command = new RemoveCommand(getEditingDomain(), callActivity.getOutputMappings(),
mapping);
getEditingDomain().getCommandStack().execute(command);
processTargetCombo.getControl().setData(MagicComposite.HIDDEN, true);
processTargetCombo.getControl().setVisible(false);
......@@ -245,8 +258,9 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
public void handleEvent(final Event event) {
getEditingDomain().getCommandStack()
.execute(
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.OUTPUT_MAPPING__SUBPROCESS_SOURCE, subprocessSourceCombo
.getText()));
new SetCommand(getEditingDomain(), mapping,
ProcessPackage.Literals.OUTPUT_MAPPING__SUBPROCESS_SOURCE, subprocessSourceCombo
.getText()));
}
});
if (mapping.getSubprocessSource() != null) {
......@@ -256,7 +270,8 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
}
private ComboViewer createProcessTargetCombo(final Composite outputMappingControl, final OutputMapping mapping) {
final ComboViewer processTargetCombo = new ComboViewer(getWidgetFactory().createCCombo(outputMappingControl, SWT.READ_ONLY | SWT.BORDER));
final ComboViewer processTargetCombo = new ComboViewer(
getWidgetFactory().createCCombo(outputMappingControl, SWT.READ_ONLY | SWT.BORDER));
processTargetCombo.setContentProvider(new IStructuredContentProvider() {
@Override
......@@ -279,8 +294,9 @@ public class OutputParametersMappingSection extends AbstractBonitaDescriptionSec
@Override
public void selectionChanged(final SelectionChangedEvent event) {
getEditingDomain().getCommandStack().execute(
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.OUTPUT_MAPPING__PROCESS_TARGET, ((IStructuredSelection) event
.getSelection()).getFirstElement()));
new SetCommand(getEditingDomain(), mapping, ProcessPackage.Literals.OUTPUT_MAPPING__PROCESS_TARGET,
((IStructuredSelection) event
.getSelection()).getFirstElement()));
}
});
final CallActivity callActivity = (CallActivity) selectionProvider.getAdapter(EObject.class);
......
......@@ -14,8 +14,6 @@
*/
package org.bonitasoft.studio.properties.sections.operation;
import javax.inject.Singleton;
import org.bonitasoft.studio.common.jface.selection.EObjectAdaptableSelectionProvider;
import org.bonitasoft.studio.model.process.OperationContainer;
import org.eclipse.core.runtime.IAdaptable;
......@@ -23,7 +21,6 @@ import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.emf.ecore.EObject;
@Creatable
@Singleton
public class OperationContainerSelectionProvider extends EObjectAdaptableSelectionProvider {
/*
......
......@@ -24,6 +24,7 @@ import org.bonitasoft.studio.expression.editor.operation.OperationGroupViewer;
import org.bonitasoft.studio.model.process.ProcessPackage;
import org.bonitasoft.studio.properties.i18n.Messages;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.databinding.EMFDataBindingContext;
import org.eclipse.jface.databinding.viewers.ViewersObservables;
import org.eclipse.jface.layout.GridDataFactory;
......@@ -56,11 +57,12 @@ public class OperationsPropertySection extends AbstractBonitaDescriptionSection
operationComposite = createViewer(mainComposite);
operationComposite.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
operationComposite.setContext(context);
IObservableValue diagramSelectionObservable = ViewersObservables.observeSingleSelection(selectionProvider);
operationComposite.setInput(CustomEMFEditObservables.observeDetailList(Realm.getDefault(),
ViewersObservables.observeSingleSelection(selectionProvider), ProcessPackage.Literals.OPERATION_CONTAINER__OPERATIONS));
context.bindValue(ViewersObservables.observeSingleSelection(selectionProvider), ViewersObservables.observeSingleSelection(operationComposite));
diagramSelectionObservable, ProcessPackage.Literals.OPERATION_CONTAINER__OPERATIONS));
context.bindValue(diagramSelectionObservable, ViewersObservables.observeSingleSelection(operationComposite));
}
protected OperationGroupViewer createViewer(final Composite parent) {
......
......@@ -14,8 +14,6 @@
*/
package org.bonitasoft.studio.properties.sections.userxp;
import javax.inject.Singleton;
import org.bonitasoft.studio.common.jface.selection.EObjectAdaptableSelectionProvider;
import org.bonitasoft.studio.model.process.Task;
import org.eclipse.core.runtime.IAdaptable;
......@@ -23,7 +21,6 @@ import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.emf.ecore.EObject;
@Creatable
@Singleton
public class TaskSelectionProvider extends EObjectAdaptableSelectionProvider {
/*
......
......@@ -75,8 +75,9 @@ public class BonitaCompareEditorInput extends CompareEditorInput {
private final List<ScriptContainer<?>> scripts;
private final AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
private final AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(
new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
public BonitaCompareEditorInput(final CompareConfiguration configuration, final List<ScriptContainer<?>> scripts,
final RefactoringOperationType operationType,
......@@ -113,9 +114,17 @@ public class BonitaCompareEditorInput extends CompareEditorInput {
@Override
public Control createContents(final Composite parent) {
final CLabel label = new CLabel(parent, SWT.NONE);
final String lastArgumentWithConditionOrNot = canBeContainedInScript ? " " + Messages.reviewChangesMessageWithConditionPlace : "";
final String lastArgumentWithConditionOrNot = canBeContainedInScript
? " " + Messages.reviewChangesMessageWithConditionPlace : "";
if (operationType == RefactoringOperationType.UPDATE) {
label.setText(Messages.bind(Messages.reviewChangesMessageRefactoring, new String[] { elementName, newName, lastArgumentWithConditionOrNot }));
if (elementName.equals(newName)) {