Eclipse RCP入门(三)集成designer图形编辑器

丁阎宝
2023-12-01
Eclipse RCP入门(三)

swt swing eclipse 插件下载地址:
http://www.swt-designer.com/
破解的补丁是agiwp411km.exe,我放在tools里面,http://sillycat.3adisk.com
安装插件的时候,采用不侵入安装,在eclipse的下面新建一个links文件夹
新建一个文本类型的文件swt.designer.link
文件内容为:
path=E:\\book\\designer\\Designer_v6.4.1_for_Eclipse3.3
这样,重启eclipse,插件就安装好了。破解就可以了。以后编辑swing等就比较方便了。
不过我最喜欢的还是这种安装eclipse插件的方式,以后删除一个插件和管理这些插件非常的方便

注意:
在添加PLUGIN依赖的时候,需要加入这个包,不然运行的时候会报错
org.eclipse.core.runtime.compatibility.auth

使用SWT Designer来编辑页面很方便。
不过在编辑的时候有个问题:

项目下面META-INF/MANIFEST.MF文件会被修改:
正确的文件是:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ThreeRCP Plug-in
Bundle-SymbolicName: threeRCP;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: threercp.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Eclipse-LazyStart: true

但是当打开一个SWT Designer来编译过一个已经生成的VIEW时,有时会导致
中间的
Bundle-SymbolicName: threeRCP;singleton:=true
自动变成
Bundle-SymbolicName: threeRCP;singleton:=true;singleton:=true

导致项目运行时报错:
Product threeRCP.product could not be found.



java.lang.RuntimeException: No application id has been found.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:229)
at org.eclipse.equinox.internal.app.EclipseAppContainer.start(EclipseAppContainer.java:92)
at org.eclipse.equinox.internal.app.Activator.addingService(Activator.java:129)
at org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java:1064)
at org.osgi.util.tracker.ServiceTracker$Tracked.track(ServiceTracker.java:1042)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:967)
at org.eclipse.osgi.framework.internal.core.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:94)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1224)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:141)
at org.eclipse.osgi.framework.internal.core.Framework.publishServiceEventPrivileged(Framework.java:1603)
at org.eclipse.osgi.framework.internal.core.Framework.publishServiceEvent(Framework.java:1578)
at org.eclipse.osgi.framework.internal.core.ServiceRegistrationImpl.<init>(ServiceRegistrationImpl.java:103)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.createServiceRegistration(BundleContextImpl.java:657)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:609)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:675)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:359)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
at org.eclipse.equinox.launcher.Main.run(Main.java:1162)
at org.eclipse.equinox.launcher.Main.main(Main.java:1137)

删除原有的SampleView.java

重新选择向导新建一个

Designer ------> RCP ------> ViewPart
 类似资料: