Home » Eclipse Projects » WindowBuilder » WindowBuilder Design view not working on Eclipse Mars (Version 4.5)(windowBuilder throws an Internal Error)
WindowBuilder Design view not working on Eclipse Mars (Version 4.5) [message #1434617] |
Tue, 30 September 2014 10:46 |
Wallace Roets Messages: 1 Registered: September 2014 |
Junior Member |
|
|
Good day all,
Not sure if I am doing something wrong, but when I create a class via the WindowBuilder and then click on the Design tab, I get the following:
Internal Error
WindowBuilder encountered unexpected internal error.
This could be caused by a WindowBuilder bug or by a misconfiguration issue, conflict, partial update, etc.
org.eclipse.wb.internal.core.utils.check.AssertionFailedException: Version 4.5 is not present in [3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 4.2, 4.3, 4.4]
I allready tried to update (Help > Check for Updates). Is there anything (other than downgrading my Eclipse) I can do to get this to work again?
Thanking you all in advance
|
|
|
Re: WindowBuilder Design view not working on Eclipse Mars (Version 4.5) [message #1445299 is a reply to message #1434617] |
Wed, 15 October 2014 08:46 |
Sébastien GUISSE Messages: 3 Registered: July 2014 |
Junior Member |
|
|
Hello,
I have resolved this problem with this workarround :
¤ Decompile RcpDescriptionVersionsProviderFactory.class of org.eclipse.wb.rcp_1.7.0.r44x201405021526.jar located in eclipse/plugins/
¤ Do a copy of this jar (before any modification) : org.eclipse.wb.rcp_1.7.0.r44x201405021526.jar.copy
¤ Create an eclipse project and add the decompiled classe to modify RcpDescriptionVersionsProviderFactory.java and include all needed dependencies
¤ Add 4.5 version to AllVersions List
==> final List allVersions = ImmutableList.of("3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "4.2", "4.3", "4.4","4.5");
¤ Compile RcpDescriptionVersionsProviderFactory
¤ Finally modify classes of org.eclipse.wb.rcp_1.7.0.r44x201405021526.jar with Winrar by coping /bin/org/eclipse/wb/internal/rcp/ :
*RcpDescriptionVersionsProviderFactory.class
* RcpDescriptionVersionsProviderFactory$MyFromListDescriptionVersionsProvider.class
I have joined the modified jar.
FYI : Here is the modified code :
package org.eclipse.wb.internal.rcp;
import java.util.List;
import java.util.Map;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
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 com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
public final class [color=blue]RcpDescriptionVersionsProviderFactory [/color]implements IDescriptionVersionsProviderFactory {
public static final IDescriptionVersionsProviderFactory INSTANCE = new RcpDescriptionVersionsProviderFactory();
@Override
public Map<String, Object> getVersions(final IJavaProject javaProject, final ClassLoader classLoader) throws Exception {
if (!isRCP(javaProject)) {
return (Map) ImmutableMap.of();
}
final String version = getSWTVersion();
return (Map) ImmutableMap.of("rcp_version", version);
}
@Override
public IDescriptionVersionsProvider getProvider(final IJavaProject javaProject, final ClassLoader classLoader) throws Exception {
if (!isRCP(javaProject)) {
return null;
}
final String version = getSWTVersion();
final List allVersions = ImmutableList.of("3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "4.2", "4.3", "4.4","4.5");
return new MyFromListDescriptionVersionsProvider(this, allVersions, version);
}
private boolean isRCP(final IJavaProject javaProject) throws JavaModelException {
return javaProject.findType("org.eclipse.swt.custom.CTabFolder") != null;
}
private static String getSWTVersion() {
final int version = SWT.getVersion();
final int major = version / 1000;
final int minor = (version - (major * 1000)) / 100;
return major + "." + minor;
}
private class MyFromListDescriptionVersionsProvider extends FromListDescriptionVersionsProvider {
MyFromListDescriptionVersionsProvider(final RcpDescriptionVersionsProviderFactory paramRcpDescriptionVersionsProviderFactory,
final List $anonymous0, final String $anonymous1) {
super($anonymous0, $anonymous1);
}
@Override
protected boolean validate(final Class<?> componentClass) throws Exception {
final String className = componentClass.getName();
return (className.startsWith("org.eclipse.swt.")) || (className.startsWith("org.eclipse.jface."))
|| (className.startsWith("org.eclipse.ui."));
}
}
}
|
|
|
Goto Forum:
Current Time: Sat Apr 27 05:09:55 GMT 2024
Powered by FUDForum. Page generated in 0.02705 seconds
|