Commit 670cf09c authored by Romain Bioteau's avatar Romain Bioteau

fix npe when updating EObject

improve sforce connector query layout
parent f7a1a18b
......@@ -18,6 +18,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.bonitasoft.studio.common.Activator;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
......@@ -90,6 +92,14 @@ public class EMFModelUpdater<T extends EObject> {
.getEAllStructuralFeatures()
.stream()
.filter(EAttribute.class::isInstance)
.filter(feature -> {
if (!target.eClass().getEStructuralFeatures().contains(feature)) {
BonitaStudioLog.warning(String.format("Cannot update EObject value: %s does not have a %s feature.",
target.eClass().getName(), feature.getName()), Activator.PLUGIN_ID);
return false;
}
return true;
})
.forEach(feature -> source.eSet(feature, target.eGet(feature)));
source.eClass()
......
......@@ -39,8 +39,8 @@ public class GTKStyleHandler {
public static int replaceSingleWithWrap(int style) {
if (isGTK3()) {
style = style ^ SWT.SINGLE;
style = style | SWT.WRAP;
// style = style ^ SWT.SINGLE;
// style = style | SWT.WRAP;
return style;
}
return style;
......
......@@ -380,6 +380,7 @@ public class PageComponentSwitchBuilder {
viewer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 300).create());
viewer.addFilter(connectorExpressionContentTypeFilter);
viewer.setExpressionNameResolver(new ConnectorInputNameResolver(parameter.getKey()));
final Expression exp = (Expression) parameter.getExpression();
final String desc = getDescription(object.getId());
if (desc != null && !desc.isEmpty()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment