Commit 5292599e authored by Romain Bioteau's avatar Romain Bioteau

Merge remote-tracking branch 'origin/release-7.2.0'

Conflicts:
	translations/es/org.bonitasoft.studio.contract.nl_es/messages_es.properties
	translations/fr/org.bonitasoft.studio.designer.nl_fr/messages_fr.properties
parents 02e9d229 c5ac8760
......@@ -31,7 +31,7 @@
<overrideGtkButtonText>1</overrideGtkButtonText>
<compressionAlgorithm>lzma-ultra</compressionAlgorithm>
<lzmaUltraBlockSize>100</lzmaUltraBlockSize>
<allowedLanguages>en es fr de it pt_BR ja ru</allowedLanguages>
<allowedLanguages>en es fr ja</allowedLanguages>
<customLanguageFileList>
<language>
<code>en</code>
......@@ -44,42 +44,12 @@
<file>i18n/messages_fr.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>de</code>
<file>i18n/messages_de.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>es</code>
<file>i18n/messages_es.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>it</code>
<file>i18n/messages_it.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>pt_BR</code>
<file>i18n/messages_pt.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>pt</code>
<file>i18n/messages_pt.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>ru</code>
<file>i18n/messages_ru.properties</file>
<encoding>utf-8</encoding>
<resolveUCN>1</resolveUCN>
</language>
<language>
<code>ja</code>
......
......@@ -26,6 +26,7 @@ import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.QueryConten
import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.QueryNameEditingSupport;
import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.ReadOnlyQueryContentEditingSupport;
import org.bonitasoft.studio.common.NamingUtils;
import org.bonitasoft.studio.common.properties.Well;
import org.bonitasoft.studio.pics.Pics;
import org.bonitasoft.studio.pics.PicsConstants;
import org.eclipse.core.databinding.DataBindingContext;
......@@ -39,6 +40,7 @@ import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.SelectObservableValue;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.databinding.viewers.IViewerObservableValue;
import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
......@@ -59,20 +61,20 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Romain Bioteau
*/
public class QueriesTabItemControl extends AbstractTabItemControl {
private IObservableList fieldsList;
private final IObservableList fieldsList;
private WritableList defaultQueriesList;
private final WritableList defaultQueriesList;
private static final String DEFAULT_QUERY_NAME = "query";
......@@ -89,7 +91,7 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
@Override
public void handleValueChange(ValueChangeEvent event) {
BusinessObject selectedBo = (BusinessObject) event.diff.getNewValue();
final BusinessObject selectedBo = (BusinessObject) event.diff.getNewValue();
updateDefaultQueries(selectedBo);
}
......@@ -98,9 +100,9 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
@Override
public void widgetSelected(SelectionEvent e) {
Widget item = e.item;
final Widget item = e.item;
if (item instanceof TabItem && Messages.queries.equals(((TabItem) item).getText())) {
BusinessObject selectedBo = (BusinessObject) viewerObservableValue.getValue();
final BusinessObject selectedBo = (BusinessObject) viewerObservableValue.getValue();
updateDefaultQueries(selectedBo);
}
}
......@@ -115,17 +117,17 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
radioComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, false).span(2, 1).create());
radioComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).extendedMargins(5, 5, 5, 0).spacing(20, 0).create());
Button defaultQueriesRadioButton = new Button(radioComposite, SWT.RADIO);
final Button defaultQueriesRadioButton = new Button(radioComposite, SWT.RADIO);
defaultQueriesRadioButton.setLayoutData(GridDataFactory.swtDefaults().create());
defaultQueriesRadioButton.setText(Messages.defaultQueriesOption);
ControlDecoration controlDecoration = new ControlDecoration(defaultQueriesRadioButton, SWT.RIGHT);
final ControlDecoration controlDecoration = new ControlDecoration(defaultQueriesRadioButton, SWT.RIGHT);
controlDecoration.setDescriptionText(Messages.defaultQueriesHint);
controlDecoration.setImage(Pics.getImage(PicsConstants.hint));
controlDecoration.setShowOnlyOnFocus(false);
controlDecoration.setMarginWidth(-5);
Button customQueriesRadioButton = new Button(radioComposite, SWT.RADIO);
final Button customQueriesRadioButton = new Button(radioComposite, SWT.RADIO);
customQueriesRadioButton.setText(Messages.customQueriesOption);
final Composite stackComposite = new Composite(this, SWT.NONE);
......@@ -136,14 +138,14 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
final Composite defaultComposite = createDefaultQueriesControl(ctx, viewerObservableValue, stackComposite);
final Composite customComposite = createCustomQueriesControl(ctx, viewerObservableValue, stackComposite);
SelectObservableValue radioGroupObservable = new SelectObservableValue(String.class);
final SelectObservableValue radioGroupObservable = new SelectObservableValue(String.class);
radioGroupObservable.addOption(DEFAULT, SWTObservables.observeSelection(defaultQueriesRadioButton));
radioGroupObservable.addOption(CUSTOM, SWTObservables.observeSelection(customQueriesRadioButton));
radioGroupObservable.addValueChangeListener(new IValueChangeListener() {
@Override
public void handleValueChange(ValueChangeEvent event) {
Object newValue = event.diff.getNewValue();
final Object newValue = event.diff.getNewValue();
if (DEFAULT.equals(newValue)) {
stackLayout.topControl = defaultComposite;
} else {
......@@ -157,29 +159,29 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
}
protected void deleteQuery(IObservableList queryObserveDetailList, TableViewer queriesTableViewer) {
IStructuredSelection selection = (IStructuredSelection) queriesTableViewer.getSelection();
final IStructuredSelection selection = (IStructuredSelection) queriesTableViewer.getSelection();
queryObserveDetailList.removeAll(selection.toList());
}
protected void addQuery(IViewerObservableValue viewerObservableValue, IObservableList queryObserveDetailList, TableViewer queriesTableViewer) {
Query query = new Query(generateQueryName(viewerObservableValue), "", List.class.getName());
final Query query = new Query(generateQueryName(viewerObservableValue), "", List.class.getName());
queryObserveDetailList.add(query);
queriesTableViewer.editElement(query, 0);
}
protected String generateQueryName(IViewerObservableValue viewerObservableValue) {
Set<String> existingNames = new HashSet<String>();
BusinessObject businessObject = (BusinessObject) viewerObservableValue.getValue();
List<Query> queries = businessObject.getQueries();
for (Query q : queries) {
final Set<String> existingNames = new HashSet<String>();
final BusinessObject businessObject = (BusinessObject) viewerObservableValue.getValue();
final List<Query> queries = businessObject.getQueries();
for (final Query q : queries) {
existingNames.add(q.getName());
}
return NamingUtils.generateNewName(existingNames, DEFAULT_QUERY_NAME, 1);
}
protected TableViewerColumn createQueryContentColumn(DataBindingContext ctx, TableViewer queriesTableViewer) {
TableViewerColumn queryContentColumnViewer = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
TableColumn column = queryContentColumnViewer.getColumn();
final TableViewerColumn queryContentColumnViewer = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
final TableColumn column = queryContentColumnViewer.getColumn();
column.setText(Messages.query);
queryContentColumnViewer.setLabelProvider(new ColumnLabelProvider() {
......@@ -201,8 +203,8 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
}
protected TableViewerColumn createQueryNameColumn(DataBindingContext ctx, TableViewer queriesTableViewer) {
TableViewerColumn nameColumnViewer = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
TableColumn column = nameColumnViewer.getColumn();
final TableViewerColumn nameColumnViewer = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
final TableColumn column = nameColumnViewer.getColumn();
column.setText(Messages.name + " *");
nameColumnViewer.setLabelProvider(new ColumnLabelProvider() {
......@@ -222,7 +224,7 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
}
protected TableViewerColumn createStatusColumn(DataBindingContext ctx, IViewerObservableValue viewerObservableValue, TableViewer queriesTableViewer) {
TableViewerColumn statusColumn = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
final TableViewerColumn statusColumn = new TableViewerColumn(queriesTableViewer, SWT.LEFT);
statusColumn.setLabelProvider(new QueryStatusLabelProvider(viewerObservableValue));
return statusColumn;
}
......@@ -232,14 +234,8 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
composite.setLayoutData(GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).create());
composite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(5, 5).create());
Label countQueryInfoLabel = new Label(composite, SWT.WRAP);
countQueryInfoLabel.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).indent(50, 0).hint(450, SWT.DEFAULT).create());
countQueryInfoLabel.setText(Messages.countQueryInfo);
ControlDecoration controlDecoration = new ControlDecoration(countQueryInfoLabel, SWT.LEFT);
controlDecoration.setImage(composite.getDisplay().getSystemImage(SWT.ICON_INFORMATION));
controlDecoration.setMarginWidth(5);
controlDecoration.show();
final Well well = new Well(composite, Messages.countQueryInfo, new FormToolkit(getDisplay()), IStatus.INFO);
well.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).hint(450, SWT.DEFAULT).create());
final Composite buttonsComposite = new Composite(composite, SWT.NONE);
buttonsComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).indent(0, 20).create());
......@@ -255,7 +251,7 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
queriesTableViewer.getTable().setHeaderVisible(true);
queriesTableViewer.setContentProvider(new ObservableListContentProvider());
TableLayout tableLayout = new TableLayout();
final TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(1));
tableLayout.addColumnData(new ColumnWeightData(3));
tableLayout.addColumnData(new ColumnWeightData(9));
......@@ -271,7 +267,7 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
});
ctx.bindValue(SWTObservables.observeEnabled(queriesTableViewer.getTable()), viewerObservableValue, null, enableStrategy);
IViewerObservableValue constaintObserveSingleSelection = ViewersObservables.observeSingleSelection(queriesTableViewer);
final IViewerObservableValue constaintObserveSingleSelection = ViewersObservables.observeSingleSelection(queriesTableViewer);
ctx.bindValue(SWTObservables.observeEnabled(deleteButton), constaintObserveSingleSelection, null, enableStrategy);
enableStrategy = new UpdateValueStrategy();
......@@ -294,9 +290,9 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
ColumnViewerToolTipSupport.enableFor(queriesTableViewer);
createStatusColumn(ctx, viewerObservableValue, queriesTableViewer);
TableViewerColumn nameColumnViewer = createQueryNameColumn(ctx, queriesTableViewer);
final TableViewerColumn nameColumnViewer = createQueryNameColumn(ctx, queriesTableViewer);
nameColumnViewer.setEditingSupport(new QueryNameEditingSupport(viewerObservableValue, nameColumnViewer.getViewer(), ctx));
TableViewerColumn queryContentColumnViewer = createQueryContentColumn(ctx, queriesTableViewer);
final TableViewerColumn queryContentColumnViewer = createQueryContentColumn(ctx, queriesTableViewer);
queryContentColumnViewer.setEditingSupport(new QueryContentEditingSupport(queryContentColumnViewer.getViewer(), viewerObservableValue));
final IObservableList queryObserveDetailList = PojoObservables.observeDetailList(viewerObservableValue, "queries", Query.class);
......@@ -340,13 +336,13 @@ public class QueriesTabItemControl extends AbstractTabItemControl {
queriesTableViewer.getTable().setHeaderVisible(true);
queriesTableViewer.setContentProvider(new ObservableListContentProvider());
TableLayout tableLayout = new TableLayout();
final TableLayout tableLayout = new TableLayout();
tableLayout.addColumnData(new ColumnWeightData(1));
tableLayout.addColumnData(new ColumnWeightData(3));
queriesTableViewer.getTable().setLayout(tableLayout);
createQueryNameColumn(ctx, queriesTableViewer);
TableViewerColumn queryContentColumnViewer = createQueryContentColumn(ctx, queriesTableViewer);
final TableViewerColumn queryContentColumnViewer = createQueryContentColumn(ctx, queriesTableViewer);
queryContentColumnViewer.setEditingSupport(new ReadOnlyQueryContentEditingSupport(queryContentColumnViewer.getViewer(), viewerObservableValue));
queriesTableViewer.setInput(defaultQueriesList);
......
......@@ -425,9 +425,7 @@ public class PageComponentSwitchBuilder {
} else {
viewer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
}
for (int i = 0; i < array.getCols().intValue(); i++) {
viewer.addFilter(connectorExpressionContentTypeFilter);
}
configureArrayColumnFilters(array, viewer);
if (input.isMandatory()) {
viewer.setMandatoryField(getLabel(array.getId()), context);
}
......@@ -465,6 +463,12 @@ public class PageComponentSwitchBuilder {
return null;
}
protected void configureArrayColumnFilters(final Array array, final ExpressionCollectionViewer viewer) {
for (int i = 0; i < array.getCols().intValue(); i++) {
viewer.addFilter(connectorExpressionContentTypeFilter);
}
}
public Section createGroupControl(final Composite composite, final Group object) {
final String desc = getDescription(object.getId());
int style = Section.NO_TITLE_FOCUS_BOX | Section.TWISTIE | Section.CLIENT_INDENT;
......
......@@ -17,7 +17,7 @@
<bonita.home.dir>${basedir}/bonita-home</bonita.home.dir>
<javadoc.dir>${basedir}/javadoc</javadoc.dir>
<lib.dir>lib</lib.dir>
<tomcat.version>7.0.55</tomcat.version>
<tomcat.version>7.0.67</tomcat.version>
</properties>
<dependencies>
......
......@@ -75,7 +75,7 @@ autoGeneratedOperationStepButton=Auto-generate storage operations
manuallyDefinedOperationStepButton=No, thanks. I'll manually define how to use the contract.
autoGeneratedOperationProcessButton=Auto-generate the initialization script.Click on preview button to check its content.
manuallyDefinedOperationProcessButton=No, thanks. I'll manually define how to use the contract.
contractStrictGenerationMsg=The contract inputs have been specified.\nA script that sets the default values of the business variable attributes with the contract input values will be generated. It can be viewed and edited in the Data tab. If the default value of a business variable already exists, this script will override it.\n\nContract inputs and the script can be edited manually.\nHowever, there is no refactoring (for example, updating the attribute name or a multiple property in a business object or contract element will break the script).
contractStrictGenerationMsg=The contract inputs have been specified.\nA script that sets the default values of the business variable attributes with the contract input values will be generated. It can be viewed and edited in the Data tab. If the default value of a business variable already exists, this script will override it.\n\nThe contract inputs and the script can be edited manually.\nHowever, there is no refactoring (for example, updating the attribute name or a multiple property in a business object or contract element will break the script).
invalidBusinessDataSelected=Invalid business data selected.
setGeneratedScriptPreviewPageDescription=Preview of the generated script that initializes the default value of the data {0}. To edit this script, go to the Data declaration and edit the default value definition.
generatedScriptPreviewTitle=Generated script preview
......
......@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Set;
import org.bonitasoft.studio.common.ExpressionConstants;
import org.bonitasoft.studio.common.NamingUtils;
import org.bonitasoft.studio.common.jface.DataStyledTreeLabelProvider;
import org.bonitasoft.studio.common.jface.TableColumnSorter;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
......@@ -96,6 +97,10 @@ public class JavaExpressionEditor extends SelectionAwareExpressionEditor impleme
private boolean isPageFlowContext = false;
private MultiValidator validationStatusProvider;
private EMFDataBindingContext dataBindingContext;
@Override
public Control createExpressionEditor(final Composite parent, final EMFDataBindingContext ctx) {
mainComposite = new Composite(parent, SWT.NONE);
......@@ -245,7 +250,7 @@ public class JavaExpressionEditor extends SelectionAwareExpressionEditor impleme
public void bindExpression(final EMFDataBindingContext dataBindingContext, final EObject context, final Expression inputExpression,
final ViewerFilter[] filters,
final ExpressionViewer expressionViewer) {
this.dataBindingContext = dataBindingContext;
editorInputExpression = inputExpression;
setContentProvider(new PojoBrowserContentProvider());
javaTreeviewer.setContentProvider(getContentProvider());
......@@ -273,10 +278,11 @@ public class JavaExpressionEditor extends SelectionAwareExpressionEditor impleme
@Override
public Object convert(final Object data) {
if (data instanceof Data) {
return ((Data) data).getName() + " - " + ((JavaObjectData) data).getClassName() + "#" + editorInputExpression.getContent();
return ((Data) data).getName() + " - " + NamingUtils.getSimpleName(((JavaObjectData) data).getClassName()) + "#"
+ editorInputExpression.getContent();
} else if (data instanceof IMethod) {
final JavaObjectData data2 = (JavaObjectData) editorInputExpression.getReferencedElements().get(0);
return data2.getName() + " - " + data2.getClassName() + "#" + ((IMethod) data).getElementName();
return data2.getName() + " - " + NamingUtils.getSimpleName(data2.getClassName()) + "#" + ((IMethod) data).getElementName();
}
return null;
}
......@@ -396,13 +402,27 @@ public class JavaExpressionEditor extends SelectionAwareExpressionEditor impleme
dataBindingContext.bindValue(javaViewerSingleSelection, returnTypeObservable, selectionToReturnType,
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
dataBindingContext.bindValue(SWTObservables.observeText(typeText, SWT.Modify), returnTypeObservable);
dataBindingContext.addValidationStatusProvider(new MultiValidator() {
validationStatusProvider = new MultiValidator() {
@Override
protected IStatus validate() {
return javaViewerSingleSelection.getValue() instanceof IMethod ? ValidationStatus.ok() : ValidationStatus.error("");
}
});
};
dataBindingContext.addValidationStatusProvider(validationStatusProvider);
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.expression.editor.provider.SelectionAwareExpressionEditor#dispose()
*/
@Override
public void dispose() {
if (validationStatusProvider != null) {
dataBindingContext.removeValidationStatusProvider(validationStatusProvider);
validationStatusProvider.dispose();
}
super.dispose();
}
private boolean acceptExpression(final ExpressionViewer viewer, final Expression e, final EObject context, final ViewerFilter[] filters) {
......
......@@ -32,9 +32,9 @@ public class InfoMessageComposite extends Composite {
public InfoMessageComposite(final Composite parent, final TabbedPropertySheetWidgetFactory widgetFactory) {
super(parent, SWT.NONE);
setLayout(GridLayoutFactory.fillDefaults().numColumns(2).extendedMargins(10, 0, 10, 0).create());
setLayout(GridLayoutFactory.fillDefaults().extendedMargins(10, 0, 10, 0).create());
info = widgetFactory.createLabel(this, "", SWT.WRAP);
info.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).align(SWT.RIGHT, SWT.CENTER).create());
info.setLayoutData(GridDataFactory.swtDefaults().hint(600, SWT.DEFAULT).align(SWT.FILL, SWT.CENTER).create());
widgetFactory.adapt(this);
}
......
......@@ -75,7 +75,7 @@ public class InternalMappingComposite extends Composite implements BonitaPrefere
addResourceChangeListener(webPageNameResourceChangeListener);
info = widgetFactory.createLabel(this, "", SWT.WRAP);
info.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).align(SWT.RIGHT, SWT.CENTER).create());
info.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).hint(600, SWT.DEFAULT).align(SWT.FILL, SWT.CENTER).create());
widgetFactory.adapt(this);
}
......
......@@ -52,7 +52,7 @@ public class URLMappingComposite extends Composite implements BonitaPreferenceCo
urlText.setLayoutData(GridDataFactory.swtDefaults().hint(WIDTH_HINT, SWT.DEFAULT).create());
info = widgetFactory.createLabel(this, "", SWT.WRAP);
info.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).hint(750, SWT.DEFAULT).align(SWT.RIGHT, SWT.CENTER).create());
info.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).hint(600, SWT.DEFAULT).align(SWT.FILL, SWT.CENTER).create());
widgetFactory.adapt(this);
}
......
......@@ -20,9 +20,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.CommonRepositoryPlugin;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.repository.preferences.OrganizationPreferenceConstants;
import org.bonitasoft.studio.engine.BOSWebServerManager;
import org.bonitasoft.studio.engine.i18n.Messages;
import org.bonitasoft.studio.engine.server.PortConfigurator;
......@@ -31,21 +29,15 @@ import org.bonitasoft.studio.pics.PicsConstants;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.pages.AbstractBonitaPreferencePage;
import org.bonitasoft.studio.preferences.pages.PasswordFieldEditor;
import org.bonitasoft.studio.repository.themes.LookNFeelRepositoryStore;
import org.bonitasoft.studio.repository.themes.UserXpFileStore;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
......@@ -88,22 +80,6 @@ public class BonitaUserXpPreferencePage extends AbstractBonitaPreferencePage imp
port = new IntegerFieldEditor(BonitaPreferenceConstants.CONSOLE_PORT, Messages.consolePreferencePortLabel, getFieldEditorParent());
port.setValidRange(PortConfigurator.MIN_PORT_NUMBER, PortConfigurator.MAX_PORT_NUMBER);
addField(port);
final Group loginGroup = new Group(getFieldEditorParent(), SWT.NONE);
loginGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(15, 15).create());
loginGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
loginGroup.setText(Messages.loginAs);
final StringFieldEditor user = new StringFieldEditor(OrganizationPreferenceConstants.DEFAULT_USER, Messages.userNameLLabel, loginGroup);
user.setPreferenceStore(CommonRepositoryPlugin.getDefault().getPreferenceStore());
addField(user);
user.getTextControl(loginGroup).setLayoutData(GridDataFactory.fillDefaults().grab(true, false).indent(0, 15).create());
user.getLabelControl(loginGroup).setLayoutData(GridDataFactory.fillDefaults().grab(false, false).indent(0, 15).create());
final PasswordFieldEditor password = new PasswordFieldEditor(OrganizationPreferenceConstants.DEFAULT_PASSWORD, Messages.userPasswordLabel, loginGroup);
password.setPreferenceStore(CommonRepositoryPlugin.getDefault().getPreferenceStore());
addField(password);
defaultTheme = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_USERXP_THEME, Messages.defaultUserXPThemeLabel + " " + bonitaPortalModuleName,
getAvailableThemes(), getFieldEditorParent());
addField(defaultTheme);
......
......@@ -28,6 +28,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
......@@ -53,6 +54,7 @@ public class CellExpressionViewer extends ExpressionViewer {
protected void createToolbar(final int style, final TabbedPropertySheetWidgetFactory widgetFactory) {
toolbar = new ToolBar(control, SWT.FLAT | SWT.NO_FOCUS);
toolbar.setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).create());
toolbar.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
final ToolItem editControl = new ToolItem(toolbar, SWT.FLAT);
editControl.setImage(Pics.getImage(PicsConstants.edit));
editControl.setData(SWTBOT_WIDGET_ID_KEY, SWTBOT_ID_EDITBUTTON);
......
......@@ -325,13 +325,15 @@ public class EditExpressionDialog extends TrayDialog implements IBonitaVariableC
if (currentExpressionEditor != null) {
currentExpressionEditor.dispose();
}
if (dataBindingContext != null) {
dataBindingContext.dispose();
}
currentExpressionEditor = provider.getExpressionEditor(inputExpression, context);
currentExpressionEditor.setIsPageFlowContext(isPageFlowContext);
if (currentExpressionEditor != null) {
if (dataBindingContext != null) {
dataBindingContext.dispose();
}
// if (dataBindingContext != null) {
// dataBindingContext.dispose();
// }
dataBindingContext = new EMFDataBindingContext();
currentExpressionEditor.createExpressionEditor(contentComposite, dataBindingContext, isPassword);
contentComposite.layout