Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkscheglov2014-12-04 05:42:51 +0000
committerkscheglov2014-12-04 05:42:51 +0000
commit882959b1496e69e46626587adaafa2316794be36 (patch)
tree4b6dd8afb93e5f2b84dc32bb5cf1f29fa962266c
parentd8bb3a18878bf652a48c614a153bb5aa4af36f93 (diff)
downloadorg.eclipse.windowbuilder-882959b1496e69e46626587adaafa2316794be36.tar.gz
org.eclipse.windowbuilder-882959b1496e69e46626587adaafa2316794be36.tar.xz
org.eclipse.windowbuilder-882959b1496e69e46626587adaafa2316794be36.zip
Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=453988 - we need to check is model or ComponentDescription is given.
-rw-r--r--org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/validator/CompatibleLayoutRequestValidator.java6
-rw-r--r--org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/RcpDescriptionVersionsProviderFactory.java6
2 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/validator/CompatibleLayoutRequestValidator.java b/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/validator/CompatibleLayoutRequestValidator.java
index 0efd1666..84866613 100644
--- a/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/validator/CompatibleLayoutRequestValidator.java
+++ b/org.eclipse.wb.core/src/org/eclipse/wb/core/gef/policy/validator/CompatibleLayoutRequestValidator.java
@@ -126,7 +126,11 @@ public final class CompatibleLayoutRequestValidator extends AbstractLayoutReques
////////////////////////////////////////////////////////////////////////////
private static final String DEF_functions = StringUtils.join(new String[]{
"def isComponentType(model, c) {",
- " return ReflectionUtils.isSuccessorOf(model.description.componentClass, c);",
+ " if (ReflectionUtils.isSuccessorOf(model, 'org.eclipse.wb.core.model.ObjectInfo')) {",
+ " return ReflectionUtils.isSuccessorOf(model.description.componentClass, c);",
+ " } else {",
+ " return ReflectionUtils.isSuccessorOf(model.componentClass, c);",
+ " }",
"};",}, "\n");
private static boolean executeScriptBoolean(String script, Object parent, Object child)
diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/RcpDescriptionVersionsProviderFactory.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/RcpDescriptionVersionsProviderFactory.java
index 3b7607d9..f4252f74 100644
--- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/RcpDescriptionVersionsProviderFactory.java
+++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/RcpDescriptionVersionsProviderFactory.java
@@ -13,20 +13,20 @@ package org.eclipse.wb.internal.rcp;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import org.eclipse.swt.SWT;
import org.eclipse.wb.internal.core.model.description.resource.FromListDescriptionVersionsProvider;
import org.eclipse.wb.internal.core.model.description.resource.IDescriptionVersionsProvider;
import org.eclipse.wb.internal.core.model.description.resource.IDescriptionVersionsProviderFactory;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.swt.SWT;
import java.util.List;
import java.util.Map;
/**
* {@link IDescriptionVersionsProviderFactory} for RCP.
- *
+ *
* @author scheglov_ke
* @coverage rcp
*/
@@ -66,7 +66,7 @@ public final class RcpDescriptionVersionsProviderFactory
}
// OK, RCP project
String version = getSWTVersion();
- List<String> allVersions = ImmutableList.of("3.8", "4.2", "4.3", "4.4", "4.5");
+ List<String> allVersions = ImmutableList.of("3.7", "3.8", "4.2", "4.3", "4.4", "4.5");
return new FromListDescriptionVersionsProvider(allVersions, version) {
@Override
protected boolean validate(Class<?> componentClass) throws Exception {

Back to the top