Commit baa5a1d8 authored by adrien's avatar adrien

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

into release-7.12.0

Conflicts:
	community/bundles/plugins/org.bonitasoft.studio.actors/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.actors/messages_pt_BR.properties
	community/bundles/plugins/org.bonitasoft.studio.actors/src/org/bonitasoft/studio/actors/ui/wizard/page/UsersWizardPage.java
	community/bundles/plugins/org.bonitasoft.studio.application/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/messages.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/messages_es.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/messages_fr.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/messages_pt_BR.properties
	community/bundles/plugins/org.bonitasoft.studio.businessobject/src/org/bonitasoft/studio/businessobject/i18n/Messages.java
	community/bundles/plugins/org.bonitasoft.studio.common.repository/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.common.repository/messages_pt_BR.properties
	community/bundles/plugins/org.bonitasoft.studio.common/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.configuration/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.connectors.model.edit/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.connectors.model.edit/messages_pt_BR.properties
	community/bundles/plugins/org.bonitasoft.studio.designer/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.designer/plugin_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.diagram.custom/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.engine/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.engine/messages_pt_BR.properties
	community/bundles/plugins/org.bonitasoft.studio.engine/plugin_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.groovy.ui/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.importer.bos/src/org/bonitasoft/studio/importer/bos/handler/ImportBosHandler.java
	community/bundles/plugins/org.bonitasoft.studio.importer.bos/src/org/bonitasoft/studio/importer/bos/wizard/ImportBosArchiveControlSupplier.java
	community/bundles/plugins/org.bonitasoft.studio.importer/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.la/messages_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.la/plugin_ja.properties
	community/bundles/plugins/org.bonitasoft.studio.validation/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.application.ex/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.configuration.ex/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.configuration.ex/plugin_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.connector.wizard.uipath/messages_pt_BR.properties
	subscription/bundles/plugins/org.bonitasoft.studio.engine.ex/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.intro.ex/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.rest.api.extension/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.rest.api.extension/plugin_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.team/messages_ja.properties
	subscription/bundles/plugins/org.bonitasoft.studio.team/plugin_ja.properties
parents c06257b0 8ed1de8a
......@@ -250,4 +250,4 @@ organizationDeployed='%s' \u7d44\u7e54\u304c\u30c7\u30d7\u30ed\u30a4\u3055\u308
showPassword=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8868\u793a\u3059\u308b\u3002
noOrganizationFoundTitle=\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u7d44\u7e54\u304c\u3042\u308a\u307e\u305b\u3093\u3002
noOrganizationFoundMsg=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u7d44\u7e54\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30d7\u30ed\u30bb\u30b9\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u7d44\u7e54\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
showPassword=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8868\u793a\u3059\u308b\u3002
......@@ -250,4 +250,3 @@ organizationDeployed='%s' organiza\u00e7\u00e3o foi implantada
showPassword=Mostrar senha
noOrganizationFoundTitle=Nenhuma organiza\u00e7\u00e3o para implantar
noOrganizationFoundMsg=Nenhuma organiza\u00e7\u00e3o foi definida para este projeto. Voc\u00ea precisa de uma organiza\u00e7\u00e3o para ser implantada para utilizar seus processos e aplica\u00e7\u00f5es.
......@@ -307,11 +307,11 @@ public class ProcessActorsPropertySection extends AbstractBonitaDescriptionSecti
getEditingDomain().getCommandStack().execute(
AddCommand.create(getEditingDomain(), process, ProcessPackage.Literals.ABSTRACT_PROCESS__ACTORS, actor));
refresh();
actorsViewer.editElement(actor, 0);
actorsViewer.editElement(actor, 1);
}
private String generateActorName(final AbstractProcess process) {
final Set<String> actorsName = new HashSet<String>();
final Set<String> actorsName = new HashSet<>();
for (final Actor a : process.getActors()) {
actorsName.add(a.getName());
}
......
......@@ -102,4 +102,4 @@ applicationAsDisplayName=%s \u3068\u3057\u3066 %s
allArtifactSelected=\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059
noArtifactSelected=\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u305f\u3081\u306e\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093
incompatibleModelFoundTitle=\u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f
incompatibleModelFoundMsg=\u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 \n\u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001\u6b21\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u30c7\u30d7\u30ed\u30a4\u53ef\u80fd\u306a\u30a8\u30ec\u30e1\u30f3\u30c8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002 \u4ed6\u306e\u3044\u304f\u3064\u304b\u306e\u30e2\u30c7\u30eb\u306f\u3001\u73fe\u5728\u306e\u4e92\u63db\u6027\u306e\u3042\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u79fb\u884c\u3055\u308c\u307e\u3059\u3002
\ No newline at end of file
incompatibleModelFoundMsg=\u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002 \n\u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u305a\u3001\u6b21\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u30c7\u30d7\u30ed\u30a4\u53ef\u80fd\u306a\u30a8\u30ec\u30e1\u30f3\u30c8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002 \u4ed6\u306e\u3044\u304f\u3064\u304b\u306e\u30e2\u30c7\u30eb\u306f\u3001\u73fe\u5728\u306e\u4e92\u63db\u6027\u306e\u3042\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u79fb\u884c\u3055\u308c\u307e\u3059\u3002
......@@ -14,13 +14,19 @@
*/
package org.bonitasoft.studio.application.ui.control;
import java.util.Objects;
import org.bonitasoft.studio.common.repository.model.IDisplayable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Event;
public class DeployTreeLabelProvider extends StyledCellLabelProvider implements ILabelProvider {
......@@ -42,18 +48,38 @@ public class DeployTreeLabelProvider extends StyledCellLabelProvider implements
@Override
public Image getImage(Object element) {
if(element instanceof IDisplayable) {
return ((IDisplayable) element).getIcon();
if (element instanceof IDisplayable) {
return ((IDisplayable) element).getIcon();
}
return null;
}
@Override
public String getText(Object element) {
if(element instanceof IDisplayable) {
return ((IDisplayable) element).getDisplayName();
if (element instanceof IDisplayable) {
return ((IDisplayable) element).getDisplayName();
}
return element.toString();
}
@Override
protected void erase(Event event, Object element) {
super.erase(event, element);
// Necessary since the MacOS Big Sur update -> Seems that table with StyledCellLabelProvider aren't redraw automatically
// TODO Hopefully this could be removed on the futur (current date: 19/11/2020)
if (Objects.equals(Platform.OS_MACOSX, Platform.getOS())) {
Rectangle bounds = event.getBounds();
if ((event.detail & SWT.SELECTED) != 0) {
Color oldForeground = event.gc.getForeground();
event.gc.setForeground(event.item.getDisplay().getSystemColor(
SWT.COLOR_LIST_SELECTION_TEXT));
event.gc.fillRectangle(bounds);
/* restore the old GC colors */
event.gc.setForeground(oldForeground);
event.detail &= ~SWT.SELECTED;
}
}
}
}
......@@ -48,7 +48,11 @@ fieldNameAlreadyExists=\u5c5e\u6027\u540d\u306f\u65e2\u306b\u5b58\u5728\u3057\u3
constraintNameAlreadyExists=\u5236\u7d04\u540d\u306f\u65e2\u306b\u5b58\u5728\u3057\u307e\u3059
deleteBOConfirmTitle=\u30d3\u30b8\u30cd\u30b9 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f
deleteBOConfirmMessage=\u30d3\u30b8\u30cd\u30b9 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8`%s `\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f
<<<<<<< HEAD
attribute=\u5c5e\u6027
=======
attribute=attribute
>>>>>>> branch 'master' of git@github.com:bonitasoft/bonita-studio-sp.git
error_emptyPackageName=\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u304c\u7a7a\u3067\u3059
modelValidationFailedTitle=\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3 \u30ec\u30dd\u30fc\u30c8
validatingBDM=\u691c\u8a3c\u3057\u3066\u3044\u307e\u3059...
......
......@@ -45,6 +45,7 @@ import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
......@@ -57,6 +58,7 @@ import org.eclipse.jface.layout.LayoutConstants;
import org.eclipse.jface.viewers.CheckboxCellEditor;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
......@@ -204,6 +206,12 @@ public class AttributeEditionControl extends Composite {
viewer.setInput(fieldsObservable);
selectedFieldObservable = ViewerProperties.singleSelection(Field.class).observe(viewer);
// Necessary since the MacOS Big Sur update -> Seems that table with StyledCellLabelProvider aren't redraw automatically
// TODO Hopefully this could be removed on the futur (current date: 19/11/2020)
if (Objects.equals(Platform.OS_MACOSX, Platform.getOS())) {
selectedBoObservable.addValueChangeListener(e -> viewer.getTable().redraw());
}
addDragAndDropSupport();
}
......@@ -301,10 +309,10 @@ public class AttributeEditionControl extends Composite {
FieldNameValidator fieldNameValidator = new FieldNameValidator();
column.setLabelProvider(new LabelProviderBuilder<Field>()
.withTextProvider(element -> element.getName())
.withStyledStringProvider((element -> new StyledString(element.getName())))
.withStatusProvider(fieldNameValidator::validate)
.shouldRefreshAllLabels(viewer)
.createColumnLabelProvider());
.createStyledCellLabelProvider());
column.setEditingSupport(new EditingSupportBuilder<Field>(viewer)
.withId(SWTBotConstants.SWTBOT_ID_ATTRIBUTE_NAME_TEXTEDITOR)
.withValueProvider(Field::getName)
......
......@@ -14,6 +14,8 @@
*/
package org.bonitasoft.studio.businessobject.editor.editor.ui.provider;
import java.util.Objects;
import org.bonitasoft.studio.businessobject.editor.editor.ui.styler.DeprecatedTypeStyler;
import org.bonitasoft.studio.businessobject.editor.model.BusinessObject;
import org.bonitasoft.studio.businessobject.editor.model.BusinessObjectModel;
......@@ -25,6 +27,7 @@ import org.bonitasoft.studio.businessobject.validator.AttributeReferenceExitence
import org.bonitasoft.studio.ui.ColorConstants;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ColumnViewer;
......@@ -33,9 +36,12 @@ import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.viewers.ViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
public class TypeLabelProvider extends StyledCellLabelProvider implements ILabelProvider {
......@@ -122,6 +128,26 @@ public class TypeLabelProvider extends StyledCellLabelProvider implements ILabel
return getStyledString(element).getString();
}
@Override
protected void erase(Event event, Object element) {
super.erase(event, element);
// Necessary since the MacOS Big Sur update -> Seems that table with StyledCellLabelProvider aren't redraw automatically
// TODO Hopefully this could be removed on the futur (current date: 19/11/2020)
if (Objects.equals(Platform.OS_MACOSX, Platform.getOS())) {
Rectangle bounds = event.getBounds();
if ((event.detail & SWT.SELECTED) != 0) {
Color oldForeground = event.gc.getForeground();
event.gc.setForeground(event.item.getDisplay().getSystemColor(
SWT.COLOR_LIST_SELECTION_TEXT));
event.gc.fillRectangle(bounds);
/* restore the old GC colors */
event.gc.setForeground(oldForeground);
event.detail &= ~SWT.SELECTED;
}
}
}
@Override
public void dispose() {
errorColor.dispose();
......
......@@ -62,4 +62,4 @@ migrationConfirmationTitle=\u30e2\u30c7\u30eb\u306e\u66f4\u65b0\u304c\u5fc5\u898
migrationConfirmationMsg=\u3053\u306e\u30e2\u30c7\u30eb\u306f\u3001Studio \u306e\u73fe\u5728\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u66f4\u65b0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u53e4\u3044Studio\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u306e\u9061\u53ca\u7684\u306a\u4e92\u63db\u6027\u304c\u5931\u308f\u308c\u307e\u3059\u3002
continueLabel=\u7d9a\u884c
migrationError=\u30de\u30a4\u30b0\u30ec\u30fc\u30c8 \u30a8\u30e9\u30fc
updateAllModels=\u3059\u3079\u3066\u306e\u30e2\u30c7\u30eb\u3092\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u66f4\u65b0
\ No newline at end of file
updateAllModels=\u3059\u3079\u3066\u306e\u30e2\u30c7\u30eb\u3092\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u66f4\u65b0
......@@ -62,4 +62,4 @@ migrationConfirmationTitle=Atualiza\u00e7\u00e3o de modelo necess\u00e1ria
migrationConfirmationMsg=Este modelo precisa ser atualizado para trabalhar com a vers\u00e3o atual do Studio. Executar esta atualiza\u00e7\u00e3o quebrar\u00e1 a compatibilidade retro com a vers\u00e3o mais antiga do Studio.
continueLabel=Continuar
migrationError=Erro de migra\u00e7\u00e3o
updateAllModels=Atualizar todos os modelos para a vers\u00e3o mais recente
\ No newline at end of file
updateAllModels=Atualizar todos os modelos para a vers\u00e3o mais recente
......@@ -252,4 +252,4 @@ overwriteAction=\u4e0a\u66f8\u304d
keepAction=\u65e2\u5b58\u3092\u4fdd\u6301
smartImportAction=\u30a4\u30f3\u30dd\u30fc\u30c8
migrationWillBreakRetroCompatibility=%s\: \u53e4\u3044Studio\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u306e\u4e92\u63db\u6027\u3092\u6301\u305f\u306a\u3044\u30e2\u30c7\u30eb\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u9069\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
incompatibleModelVersion=%s\: \u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u30d0\u30fc\u30b8\u30e7\u30f3\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u53d6\u308a\u3084\u7de8\u96c6\u306b\u306f\u65b0\u3057\u3044Studio\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002
\ No newline at end of file
incompatibleModelVersion=%s\: \u4e92\u63db\u6027\u306e\u306a\u3044\u30e2\u30c7\u30eb\u30d0\u30fc\u30b8\u30e7\u30f3\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u53d6\u308a\u3084\u7de8\u96c6\u306b\u306f\u65b0\u3057\u3044Studio\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002
......@@ -14,18 +14,23 @@
*/
package org.bonitasoft.studio.common.jface;
import java.util.Objects;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.TreeItem;
public abstract class AbstractCheckboxLabelProvider extends StyledCellLabelProvider implements ILabelProvider {
public abstract class AbstractCheckboxLabelProvider extends StyledCellLabelProvider
implements ILabelProvider {
public AbstractCheckboxLabelProvider(final ColumnViewer viewer) {
}
......@@ -54,20 +59,21 @@ public abstract class AbstractCheckboxLabelProvider extends StyledCellLabelProvi
return true;
}
private Image checkboxImage(final boolean selected, final boolean enabled) {
if (selected) {
return enabled ? Pics.getImage("/checkboxes/checkbox_yes.png") : Pics.getImage("/checkboxes/checkbox_yes_disabled.png");
return enabled ? Pics.getImage("/checkboxes/checkbox_yes.png")
: Pics.getImage("/checkboxes/checkbox_yes_disabled.png");
}
return enabled ? Pics.getImage("/checkboxes/checkbox_no.png") : Pics.getImage("/checkboxes/checkbox_no_disabled.png");
return enabled ? Pics.getImage("/checkboxes/checkbox_no.png")
: Pics.getImage("/checkboxes/checkbox_no_disabled.png");
}
@Override
protected void paint(final Event event, final Object element) {
final Image img = getImage(element);
if (img != null) {
final Rectangle bounds = event.item instanceof TableItem ? ((TableItem) event.item).getBounds(event.index) :
((TreeItem) event.item).getBounds(event.index);
final Rectangle bounds = event.item instanceof TableItem ? ((TableItem) event.item).getBounds(event.index)
: ((TreeItem) event.item).getBounds(event.index);
final Rectangle imgBounds = img.getBounds();
bounds.width /= 2;
bounds.width -= imgBounds.width / 2;
......@@ -91,7 +97,26 @@ public abstract class AbstractCheckboxLabelProvider extends StyledCellLabelProvi
if (image != null) {
event.height = image.getBounds().height;
}
}
@Override
protected void erase(Event event, Object element) {
super.erase(event, element);
// Necessary since the MacOS Big Sur update -> Seems that table with StyledCellLabelProvider aren't redraw automatically
// TODO Hopefully this could be removed on the futur (current date: 19/11/2020)
if (Objects.equals(Platform.OS_MACOSX, Platform.getOS())) {
Rectangle bounds = event.getBounds();
if ((event.detail & SWT.SELECTED) != 0) {
Color oldForeground = event.gc.getForeground();
event.gc.setForeground(event.item.getDisplay().getSystemColor(
SWT.COLOR_LIST_SELECTION_TEXT));
event.gc.fillRectangle(bounds);
/* restore the old GC colors */
event.gc.setForeground(oldForeground);
event.detail &= ~SWT.SELECTED;
}
}
}
}
......@@ -16,10 +16,12 @@ package org.bonitasoft.studio.common.jface;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import org.bonitasoft.studio.common.Messages;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.viewers.ArrayContentProvider;
......@@ -113,7 +115,13 @@ public class TreeExplorer extends Composite implements SWTBotConstants {
leftTree.addSelectionChangedListener(event -> {
final Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
if (selection != null) {
rightTable.refresh(null);
rightTable.refresh();
// Necessary since the MacOS Big Sur update -> Seems that table with StyledCellLabelProvider aren't redraw automatically
// TODO Hopefully this could be removed on the futur (current date: 19/11/2020)
if (Objects.equals(Platform.OS_MACOSX, Platform.getOS())) {
rightTable.getTable().redraw();
}
}
});
......
......@@ -28,7 +28,11 @@ actorfilter=\u30a2\u30af\u30bf\u30fc\u30d5\u30a3\u30eb\u30bf\u30fc
validator=\u30d0\u30ea\u30c7\u30fc\u30bf
datatypes=\u30c7\u30fc\u30bf\u578b
missingJarFileInRepository={0} \u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f
<<<<<<< HEAD
add=\u8ffd\u52a0
=======
add=\u8ffd\u52a0...
>>>>>>> branch 'master' of git@github.com:bonitasoft/bonita-studio-sp.git
remove=\u524a\u9664
others=\u305d\u306e\u4ed6
groovyScripts=Groovy\u30b9\u30af\u30ea\u30d7\u30c8
......@@ -67,4 +71,3 @@ missingParameterValue=\u30d1\u30e9\u30e1\u30fc\u30bf {0} \u306e\u5024\u304c\u898
actorHasNoMapping=\u30a2\u30af\u30bf\u30fc\: {0} \u306f\u3001\u4efb\u610f\u306e\u30b0\u30eb\u30fc\u30d7\u3001\u5f79\u5272\u3001\u6240\u5c5e\u307e\u305f\u306f\u30e6\u30fc\u30b6\u30fc\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u3066\u3044\u307e\u305b\u3093
invalidImplementationFor=\u30b3\u30cd\u30af\u30bf\u307e\u305f\u306f\u30a2\u30af\u30bf\u30fc\u30d5\u30a3\u30eb\u30bf\u306e\u5b9f\u88c5\u304c\u3042\u308a\u307e\u305b\u3093\: {0}
missingInternalFormMapping='%s' %s \u306b UI \u30c7\u30b6\u30a4\u30ca\u30fc\u306e\u30d5\u30a9\u30fc\u30e0\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093
......@@ -119,4 +119,5 @@ loadConfigurationSuccessMsg=\u69cb\u6210\u8a2d\u5b9a\u306e\u3059\u3079\u3066\u30
loadConfigurationWarningMsg=\u30ed\u30fc\u30c9\u3055\u308c\u305f\u69cb\u6210\u8a2d\u5b9a\u306e\u3044\u304f\u3064\u304b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\uff08\u5909\u6570\u3001\u30d1\u30e9\u30e1\u30fc\u30bf...\uff09\u306f\u3001\u3053\u306e\u30b3\u30cd\u30af\u30bf\u7bc4\u56f2\u5916\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u3089\u306f\u3001\u30b3\u30f3\u30b9\u30bf\u30f3\u30c8\u5024\u3068\u3057\u3066\u5909\u63db\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u307e\u305f\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f9d\u5b58\u95a2\u4fc2\u304b\u3089\u524a\u9664\u3055\u308c\u3066\u3044\u307e\u3059\u3002%s
missingDependency='%s' of type %s for '%s' \u30d1\u30e9\u30e1\u30fc\u30bf
connectorScriptingShellForbidden=Bonita Cloud \u74b0\u5883\u5185\u3067\u306f\u30b7\u30b9\u30c6\u30e0\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002
connectorCalendarForbidden=Google calendar connectors cannot be used within a Bonita Cloud environment.
jarSapConnector=SAP \u30b3\u30cd\u30af\u30bf\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001Bonita Cloud \u74b0\u5883\u306e\u7ba1\u7406\u8005\u304c SAP jar \u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002
......@@ -119,4 +119,5 @@ loadConfigurationSuccessMsg=All parameters of the configuration has been loaded
loadConfigurationWarningMsg=Some parameters of the loaded configuration has dependencies (variables, parameters...) not in the scope of this connector, they have been transformed as constant values or removed from scripts dependencies.\n%s
missingDependency='%s' of type %s for '%s' parameter.
connectorScriptingShellForbidden=Scripts do sistema n\u00e3o podem ser usados em um ambiente Bonita Cloud.
connectorCalendarForbidden=Google calendar connectors cannot be used within a Bonita Cloud environment.
jarSapConnector=O SAP jar deve ser adicionado por um administrador do ambiente Bonita Cloud para usar o conector SAP.
......@@ -66,7 +66,9 @@ public class ContractConstraintControllerTest {
FileActionDialog.setDisablePopup(true);
controller = spy(new ContractConstraintController(new WritableValue(aContract().build(), Contract.class)));
contract = ProcessFactory.eINSTANCE.createContract();
when(viewer.getInput()).thenReturn(EMFObservables.observeList(contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS));
when(viewer.getInput())
.thenReturn(EMFObservables.observeList(contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS));
doReturn(false).when(controller).isMacos();
}
@Test
......
......@@ -16,6 +16,8 @@ package org.bonitasoft.studio.contract.ui.property.constraint;
import static org.assertj.core.api.Assertions.assertThat;
import static org.bonitasoft.studio.model.process.builders.ContractBuilder.aContract;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.model.process.Contract;
......@@ -30,6 +32,7 @@ import org.eclipse.core.databinding.observable.value.WritableValue;
import org.eclipse.emf.databinding.EMFDataBindingContext;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
......@@ -67,8 +70,9 @@ public class ContractConstraintsTableViewerTest {
parent = realm.createComposite();
FileActionDialog.setDisablePopup(true);
viewer = new ContractConstraintsTableViewer(parent, new FormToolkit(parent.getDisplay()));
final ContractConstraintController inputController = new ContractConstraintController(new WritableValue(aContract()
.build(), Contract.class));
ContractConstraintController inputController = spy(
new ContractConstraintController(new WritableValue(aContract().build(), Contract.class)));
doReturn(false).when(inputController).isMacos();
viewer.initialize(inputController, messageManager, new EMFDataBindingContext());
final Contract contract = ProcessFactory.eINSTANCE.createContract();
final ContractInput input = ProcessFactory.eINSTANCE.createContractInput();
......@@ -81,7 +85,8 @@ public class ContractConstraintsTableViewerTest {
constraint2.setName("c2");
contract.getConstraints().add(constraint);
contract.getConstraints().add(constraint2);
viewer.setInput(EMFObservables.observeList(Realm.getDefault(), contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS));
viewer.setInput(
EMFObservables.observeList(Realm.getDefault(), contract, ProcessPackage.Literals.CONTRACT__CONSTRAINTS));
}
@Test
......@@ -94,7 +99,8 @@ public class ContractConstraintsTableViewerTest {
}
@Test
public void shoud_createRemoveListener_add_a_selection_listener_that_remove_selected_contract_constraints() throws Exception {
public void shoud_createRemoveListener_add_a_selection_listener_that_remove_selected_contract_constraints()
throws Exception {
final Button button = new Button(parent, SWT.PUSH);
viewer.createRemoveListener(button);
viewer.setSelection(new StructuredSelection(constraint));
......@@ -104,7 +110,8 @@ public class ContractConstraintsTableViewerTest {
}
@Test
public void shoud_createMoveUpListener_add_a_selection_listener_that_moveUp_selected_contract_constraint() throws Exception {
public void shoud_createMoveUpListener_add_a_selection_listener_that_moveUp_selected_contract_constraint()
throws Exception {
final Button button = new Button(parent, SWT.PUSH);
viewer.createMoveUpListener(button);
assertThat(viewer.getTable().getItem(1).getData()).isEqualTo(constraint2);
......@@ -114,7 +121,8 @@ public class ContractConstraintsTableViewerTest {
}
@Test
public void shoud_createMoveUpListener_add_a_selection_listener_that_moveDown_selected_contract_constraint() throws Exception {
public void shoud_createMoveUpListener_add_a_selection_listener_that_moveDown_selected_contract_constraint()
throws Exception {
final Button button = new Button(parent, SWT.PUSH);
viewer.createMoveDownListener(button);
assertThat(viewer.getTable().getItem(0).getData()).isEqualTo(constraint);
......@@ -123,4 +131,20 @@ public class ContractConstraintsTableViewerTest {
assertThat(viewer.getTable().getItem(1).getData()).isEqualTo(constraint);
}
@Test
public void should_getStyledText_strip_expression_charriage() throws Exception {
final ContractConstraint constraint = ProcessFactory.eINSTANCE.createContractConstraint();
constraint.setExpression("toto == true && \n titi == false \r");
final StyledString styledText = viewer.getExpressionStyledText(constraint);
assertThat(styledText.toString()).doesNotContain("\n").doesNotContain("\r");
}
@Test
public void should_getStyledText_supportNull() throws Exception {
final ContractConstraint constraint = ProcessFactory.eINSTANCE.createContractConstraint();
constraint.setExpression(null);
final StyledString styledText = viewer.getExpressionStyledText(constraint);
assertThat(styledText.toString()).doesNotContain("\n").doesNotContain("\r");
}
}
/**
* 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.contract.ui.property.constraint.labelProvider;
import static org.assertj.core.api.Assertions.assertThat;
import org.bonitasoft.studio.contract.ui.property.constraint.labelProvider.ConstraintExpressionCellLabelProvider;
import org.bonitasoft.studio.model.process.ContractConstraint;
import org.bonitasoft.studio.model.process.ProcessFactory;
import org.bonitasoft.studio.model.process.provider.ProcessItemProviderAdapterFactory;
import org.eclipse.core.databinding.observable.set.WritableSet;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.jface.viewers.StyledString;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
/**
* @author Romain Bioteau
*/