Commit 82d07f34 authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

feat(gtk3) improve border management when gtk3 is used (#1439)

Closes BS-19039
parent 6581ad00
......@@ -27,6 +27,7 @@ import org.bonitasoft.studio.actors.ui.wizard.FilterWizard;
import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.connector.model.definition.ConnectorDefinition;
import org.bonitasoft.studio.model.process.AbstractProcess;
import org.bonitasoft.studio.model.process.Actor;
......@@ -158,7 +159,9 @@ public abstract class AbstractActorsPropertySection extends AbstractBonitaDescri
setButton = createSetButton(viewerComposite);
filterText = getWidgetFactory().createText(viewerComposite,"", SWT.BORDER | SWT.SINGLE | SWT.NO_FOCUS | SWT.READ_ONLY);
filterText = getWidgetFactory().createText(viewerComposite, "",
GTKStyleHandler.replaceSingleWithWrap(
GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.SINGLE | SWT.NO_FOCUS | SWT.READ_ONLY)));
filterText.setLayoutData(GridDataFactory.swtDefaults().align(SWT.FILL,SWT.CENTER).grab(true,false).create());
updateConnectorButton = createUpdateButton(viewerComposite);
......
......@@ -27,6 +27,7 @@ import org.bonitasoft.studio.common.jface.CellEditorValidationStatusListener;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.jface.TableColumnSorter;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.model.process.AbstractProcess;
import org.bonitasoft.studio.model.process.Actor;
import org.bonitasoft.studio.model.process.ProcessFactory;
......@@ -117,7 +118,8 @@ public class ProcessActorsPropertySection extends AbstractBonitaDescriptionSecti
protected void createTable(final TabbedPropertySheetWidgetFactory widgetFactory,
final Composite mainComposite, final CLabel statusControl) {
actorsViewer = new TableViewer(mainComposite, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
actorsViewer = new TableViewer(mainComposite,
GTKStyleHandler.removeBorderFlag(SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI | SWT.V_SCROLL));
widgetFactory.adapt(actorsViewer.getTable(), false, false);
actorsViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
actorsViewer.setContentProvider(new ArrayContentProvider());
......
......@@ -15,6 +15,7 @@
package org.bonitasoft.studio.common.properties;
import org.bonitasoft.studio.common.Messages;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.model.process.Element;
import org.bonitasoft.studio.model.process.MainProcess;
import org.bonitasoft.studio.model.process.MessageFlow;
......@@ -123,7 +124,7 @@ public abstract class AbstractNamePropertySectionContribution implements IExtens
final GridLayout rl = new GridLayout(3, false);
composite.setLayout(rl);
text = widgetFactory.createText(composite, "", SWT.BORDER); //$NON-NLS-1$
text = widgetFactory.createText(composite, "", GTKStyleHandler.removeBorderFlag(SWT.BORDER)); //$NON-NLS-1$
final GridData rd = new GridData(SWT.NONE, SWT.CENTER, false, false);
rd.widthHint = 250;
......
/**
* Copyright (C) 2009 BonitaSoft S.A.
* BonitaSoft, 31 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
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.common.properties;
import org.bonitasoft.studio.common.Messages;
import org.bonitasoft.studio.common.jface.databinding.validator.InputLengthValidator;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.model.process.Element;
import org.bonitasoft.studio.model.process.ProcessPackage;
import org.bonitasoft.studio.model.process.TextAnnotation;
......@@ -40,119 +38,74 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
/**
* @author Mickael Istria
* @author Aurelien Pupier : refactored
*
*/
public class DescriptionPropertySectionContribution implements IExtensibleGridPropertySectionContribution {
protected Element element;
protected TransactionalEditingDomain editingDomain;
private EMFDataBindingContext context;
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution
* #createControl(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory)
*/
@Override
protected Element element;
protected TransactionalEditingDomain editingDomain;
private EMFDataBindingContext context;
@Override
public void createControl(final Composite composite, final TabbedPropertySheetWidgetFactory widgetFactory,
final ExtensibleGridPropertySection page) {
composite.setLayout(new RowLayout());
final Text text = widgetFactory.createText(composite, element.getDocumentation(), SWT.BORDER | SWT.MULTI | SWT.WRAP);
final RowData rd = new RowData();
rd.width = 300;
rd.height = 60;
text.setLayoutData(rd);
context = new EMFDataBindingContext();
final UpdateValueStrategy strategy = new UpdateValueStrategy();
strategy.setBeforeSetValidator(new InputLengthValidator(Messages.GeneralSection_Description, 254));
// context.bindValue(SWTObservables.observeDelayedValue(400, SWTObservables.observeText(text, SWT.Modify)), EMFEditObservables.observeValue(editingDomain, element, ProcessPackage.Literals.ELEMENT__DOCUMENTATION),strategy,null);
ControlDecorationSupport.create(context.bindValue(SWTObservables.observeDelayedValue(400, SWTObservables.observeText(text, SWT.Modify)), EMFEditObservables.observeValue(editingDomain, element, ProcessPackage.Literals.ELEMENT__DOCUMENTATION),strategy,null), SWT.LEFT|SWT.TOP);
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution#getLabel()
*/
@Override
final ExtensibleGridPropertySection page) {
composite.setLayout(new RowLayout());
final Text text = widgetFactory.createText(composite, element.getDocumentation(),
GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.MULTI | SWT.WRAP));
final RowData rd = new RowData();
rd.width = 300;
rd.height = 60;
text.setLayoutData(rd);
context = new EMFDataBindingContext();
final UpdateValueStrategy strategy = new UpdateValueStrategy();
strategy.setBeforeSetValidator(new InputLengthValidator(Messages.GeneralSection_Description, 254));
ControlDecorationSupport.create(context.bindValue(
SWTObservables.observeDelayedValue(400, SWTObservables.observeText(text, SWT.Modify)),
EMFEditObservables.observeValue(editingDomain, element, ProcessPackage.Literals.ELEMENT__DOCUMENTATION),
strategy, null), SWT.LEFT | SWT.TOP);
}
@Override
public String getLabel() {
return Messages.GeneralSection_Description;
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution#refresh()
*/
@Override
return Messages.GeneralSection_Description;
}
@Override
public void refresh() {
}
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution
* #setEObject(org.eclipse.emf.ecore.EObject)
*/
@Override
@Override
public void setEObject(final EObject object) {
element = (Element) object;
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution
* #setEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain)
*/
@Override
element = (Element) object;
}
@Override
public void setEditingDomain(final TransactionalEditingDomain editingDomain) {
this.editingDomain = editingDomain;
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution
* #isRelevantFor(org.eclipse.emf.ecore.EObject)
*/
@Override
this.editingDomain = editingDomain;
}
@Override
public boolean isRelevantFor(final EObject eObject) {
return eObject instanceof Element && !(eObject instanceof TextAnnotation);
}
/*
* (non-Javadoc)
*
* @seeorg.bonitasoft.studio.properties.sections.general.
* IExtenstibleGridPropertySectionContribution
* #setSelection(org.eclipse.jface.viewers.ISelection)
*/
@Override
return eObject instanceof Element && !(eObject instanceof TextAnnotation);
}
@Override
public void setSelection(final ISelection selection) {
// NOTHING
}
// NOTHING
}
/* (non-Javadoc)
* @see org.bonitasoft.studio.common.properties.IExtensibleGridPropertySectionContribution#dispose()
*/
@Override
@Override
public void dispose() {
if(context!= null) {
if (context != null) {
context.dispose();
}
}
}
}
/**
* Copyright (C) 2018 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.widgets;
import java.util.Objects;
import org.eclipse.swt.SWT;
public class GTKStyleHandler {
private GTKStyleHandler() {
//private constructor
}
public static int removeBorderFlag(int style) {
return isGTK() ? style ^ SWT.BORDER : style;
}
private static boolean isGTK3() {
String gtkVersion = System.getProperty("org.eclipse.swt.internal.gtk.version");
return gtkVersion != null && gtkVersion.startsWith("3");
}
private static boolean isGTK() {
return Objects.equals(System.getProperty("osgi.ws"), "gtk");
}
public static int replaceSingleWithWrap(int style) {
if (isGTK3()) {
style = style ^ SWT.SINGLE;
style = style | SWT.WRAP;
return style;
}
return style;
}
}
......@@ -24,6 +24,7 @@ import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.jface.EMFListFeatureTreeContentProvider;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.connector.model.definition.ConnectorDefinition;
import org.bonitasoft.studio.connectors.i18n.Messages;
import org.bonitasoft.studio.connectors.repository.ConnectorDefRepositoryStore;
......@@ -93,14 +94,14 @@ public abstract class ConnectorSection extends AbstractBonitaDescriptionSection
mainComposite);
viewerComposite.setLayoutData(GridDataFactory.fillDefaults()
.grab(true, true).create());
viewerComposite.setLayout(GridLayoutFactory.fillDefaults()
.numColumns(2).margins(0, 0).create());
viewerComposite.setLayout(
GridLayoutFactory.fillDefaults().numColumns(2).margins(5, 5).create());
createConnectorComposite(viewerComposite);
}
private void createConnectorComposite(final Composite parent) {
final Composite buttonsComposite = getWidgetFactory()
.createPlainComposite(parent, SWT.NONE);
.createComposite(parent);
buttonsComposite.setLayoutData(GridDataFactory.fillDefaults()
.grab(false, true).create());
buttonsComposite.setLayout(GridLayoutFactory.fillDefaults()
......@@ -113,8 +114,8 @@ public abstract class ConnectorSection extends AbstractBonitaDescriptionSection
downConnectorButton = createDownConnectorButton(buttonsComposite);
moveButton = createMoveConnectorButton(buttonsComposite);
tableViewer = new TableViewer(parent, SWT.BORDER | SWT.MULTI
| SWT.NO_FOCUS);
tableViewer = new TableViewer(parent, GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.MULTI
| SWT.NO_FOCUS));
getWidgetFactory().adapt(tableViewer.getTable(), false, false);
tableViewer.getTable().setLayoutData(
GridDataFactory.fillDefaults().grab(true, true)
......
......@@ -15,6 +15,7 @@
package org.bonitasoft.studio.contract.ui.property.constraint;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.contract.i18n.Messages;
import org.bonitasoft.studio.contract.ui.property.AddRowOnEnterCellNavigationStrategy;
import org.bonitasoft.studio.contract.ui.property.CharriageColumnViewerEditorActivationStrategy;
......@@ -63,7 +64,7 @@ public class ContractConstraintsTableViewer extends TableViewer {
private IMessageManager messageManager;
public ContractConstraintsTableViewer(final Composite parent, final FormToolkit toolkit) {
super(toolkit.createTable(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI));
super(toolkit.createTable(parent, GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI)));
getTable().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CONTRACT_CONSTRAINT_TABLE);
}
......
......@@ -15,6 +15,7 @@
package org.bonitasoft.studio.contract.ui.property.input;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.contract.core.refactoring.ContractInputRefactorOperationFactory;
import org.bonitasoft.studio.contract.i18n.Messages;
import org.bonitasoft.studio.contract.ui.property.AddRowOnEnterCellNavigationStrategy;
......@@ -73,7 +74,7 @@ public class ContractInputTreeViewer extends TreeViewer {
public ContractInputTreeViewer(final Composite parent, final FormToolkit toolkit, final IProgressService progressService,
final ISharedImages sharedImages) {
super(toolkit.createTree(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI));
super(toolkit.createTree(parent, GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI)));
getTree().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_CONTRACT_INPUT_TREE);
this.progressService = progressService;
this.sharedImages = sharedImages;
......
......@@ -25,6 +25,7 @@ import org.bonitasoft.studio.common.jface.DataStyledTreeLabelProvider;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.data.DataPlugin;
import org.bonitasoft.studio.data.commands.MoveDataCommand;
import org.bonitasoft.studio.data.i18n.Messages;
......@@ -109,7 +110,8 @@ public abstract class AbstractDataSection extends AbstractBonitaDescriptionSecti
final Composite dataComposite = getWidgetFactory().createComposite(mainComposite);
dataComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
dataComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create());
dataComposite.setLayout(
GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).extendedMargins(0, 20, 5, 15).create());
createDataComposite(dataComposite);
}
......@@ -150,19 +152,20 @@ public abstract class AbstractDataSection extends AbstractBonitaDescriptionSecti
protected void createDataComposite(final Composite parent) {
createViewerHeaderLabel(parent);
final Composite buttonsComposite = getWidgetFactory().createPlainComposite(parent, SWT.NONE);
buttonsComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create());
buttonsComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).spacing(0, 3).create());
final Composite buttonsComposite = getWidgetFactory().createComposite(parent, SWT.NONE);
buttonsComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(0, 3).create());
buttonsComposite.setLayoutData(GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).create());
createAddDataButton(buttonsComposite);
updateDataButton = createEditDataButton(buttonsComposite);
removeDataButton = createRemoveDataButton(buttonsComposite);
promoteDataButton = createMoveDataButton(buttonsComposite);
dataTableViewer = new TableViewer(parent, SWT.BORDER | SWT.MULTI | SWT.NO_FOCUS | SWT.H_SCROLL | SWT.V_SCROLL);
dataTableViewer = new TableViewer(
getWidgetFactory().createTable(parent, GTKStyleHandler
.removeBorderFlag(SWT.BORDER | SWT.MULTI | SWT.NO_FOCUS | SWT.H_SCROLL | SWT.V_SCROLL)));
dataTableViewer.getTable().setLayout(GridLayoutFactory.fillDefaults().create());
dataTableViewer.getTable().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, SWTBotConstants.SWTBOT_ID_PROCESS_DATA_LIST);
getWidgetFactory().adapt(dataTableViewer.getTable(), false, false);
dataTableViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(200, 100).create());
dataTableViewer.setSorter(new ViewerSorter());
dataTableViewer.addDoubleClickListener(this);
......
......@@ -25,6 +25,7 @@ import org.bonitasoft.studio.common.jface.CustomWizardDialog;
import org.bonitasoft.studio.common.jface.ElementForIdLabelProvider;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.document.i18n.Messages;
import org.bonitasoft.studio.document.refactoring.RefactorDocumentOperation;
import org.bonitasoft.studio.model.process.Document;
......@@ -89,7 +90,7 @@ public class DocumentPropertySection extends AbstractBonitaDescriptionSection
getWidgetFactory().createLabel(masterComposite, "");// filler
final Text documentListFilter = getWidgetFactory().createText(
masterComposite, "",
SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL);
GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL));
documentListFilter.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
documentListFilter.setMessage(WorkbenchMessages.FilteredTree_FilterMessage);
documentListFilter.addModifyListener(new ModifyListener() {
......
......@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.List;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.expression.editor.autocompletion.AutoCompletionField;
import org.bonitasoft.studio.expression.editor.autocompletion.IBonitaContentProposalListener2;
import org.bonitasoft.studio.expression.editor.autocompletion.IExpressionProposalLabelProvider;
......@@ -79,8 +80,7 @@ public class ContentAssistText extends Composite implements SWTBotConstants, ISe
}
setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(margins).spacing(indent, 0).create());
setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
textControl = new Text(this, style | SWT.SINGLE);
textControl = new Text(this, GTKStyleHandler.replaceSingleWithWrap(style | SWT.SINGLE));
textControl.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
textControl.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
textControl.addFocusListener(new FocusListener() {
......
......@@ -28,6 +28,7 @@ import org.bonitasoft.studio.common.emf.tools.ModelHelper;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.properties.AbstractBonitaDescriptionSection;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.model.parameter.Parameter;
import org.bonitasoft.studio.model.parameter.ParameterFactory;
import org.bonitasoft.studio.model.parameter.ParameterPackage;
......@@ -147,7 +148,8 @@ public class ParameterPropertySection extends AbstractBonitaDescriptionSection i
updateButton = createUpdateParameterButton(buttonsComposite);
createRemoveParameterButton(buttonsComposite);
parameterTableViewer = new TableViewer(parameterComposite, SWT.BORDER | SWT.MULTI | SWT.NO_FOCUS | SWT.H_SCROLL | SWT.V_SCROLL);
parameterTableViewer = new TableViewer(widgetFactory.createTable(parameterComposite,
GTKStyleHandler.removeBorderFlag(SWT.BORDER | SWT.MULTI | SWT.NO_FOCUS | SWT.H_SCROLL | SWT.V_SCROLL)));
parameterTableViewer.getTable().setLayout(GridLayoutFactory.fillDefaults().create());
getWidgetFactory().adapt(parameterTableViewer.getTable(), false, false);
parameterTableViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(200, 100).create());
......
......@@ -18,10 +18,10 @@
package org.bonitasoft.studio.properties.sections.general;
import org.bonitasoft.studio.common.jface.databinding.validator.EmptyInputValidator;
import org.bonitasoft.studio.common.jface.databinding.validator.URLEncodableInputValidator;
import org.bonitasoft.studio.common.jface.databinding.validator.UTF8InputValidator;
import org.bonitasoft.studio.common.properties.ExtensibleGridPropertySection;
import org.bonitasoft.studio.common.properties.IExtensibleGridPropertySectionContribution;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.model.process.AbstractProcess;
import org.bonitasoft.studio.model.process.Lane;
import org.bonitasoft.studio.model.process.MainProcess;
......@@ -44,10 +44,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
/**
* @author Mickael Istria
*
*/
public class VersionGridPropertySectionContribution implements IExtensibleGridPropertySectionContribution {
private Text text;
......@@ -55,14 +52,12 @@ public class VersionGridPropertySectionContribution implements IExtensibleGridPr
private TransactionalEditingDomain editingDomain;
private EMFDataBindingContext context;
/* (non-Javadoc)
* @see org.bonitasoft.studio.properties.sections.general.IExtenstibleGridPropertySectionContribution#createControl(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory)
*/
@Override
public void createControl(Composite composite, TabbedPropertySheetWidgetFactory widgetFactory, ExtensibleGridPropertySection page) {
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
composite.setLayout(new RowLayout());
text = widgetFactory.createText(composite, "", SWT.BORDER); //$NON-NLS-1$
text = widgetFactory.createText(composite, "", GTKStyleHandler.removeBorderFlag(SWT.BORDER));
RowData rd = new RowData();
rd.width = 80 ;
text.setLayoutData(rd);
......@@ -75,7 +70,6 @@ public class VersionGridPropertySectionContribution implements IExtensibleGridPr
}
protected void createBinding(EMFDataBindingContext context) {
UpdateValueStrategy versionUpdate = new UpdateValueStrategy();
versionUpdate.setAfterGetValidator(new EmptyInputValidator(Messages.GeneralSection_Version));
......
......@@ -20,6 +20,7 @@ import java.util.function.BiConsumer;
import java.util.stream.Stream;
import org.bonitasoft.studio.common.jface.SWTBotConstants;
import org.bonitasoft.studio.common.widgets.GTKStyleHandler;
import org.bonitasoft.studio.ui.ColorConstants;
import org.bonitasoft.studio.ui.i18n.Messages;
import org.eclipse.core.databinding.Binding;
......@@ -504,12 +505,13 @@ public class TextWidget extends EditableControlWidget {
}
protected Text newText(final Composite textContainer) {
final Text newText = new Text(textContainer, SWT.SINGLE);
final Text newText = new Text(textContainer, GTKStyleHandler.replaceSingleWithWrap(SWT.SINGLE));
newText.setLayoutData(
GridDataFactory.fillDefaults().grab(true,