我正在编写Eclipse命令插件,并希望在包资源管理器视图中检索当前选定的节点.我希望能够从返回的结果中获取绝对文件路径,其中所选节点位于文件系统上(即c:\ eclipse\test.html).
我该怎么做呢 ?
我希望能够在启动我的eclipse插件应用程序时完全删除菜单项.我想要做的是以后可以根据用户操作的业务逻辑添加这些菜单项.有没有办法做到这一点?我看过使用贡献,但我觉得这不是我想要的.
如果它可以做我需要它做的事情,我该如何使用它们?在此先感谢您的任何帮助.
我有一个老鼠听众.它有一些代码来响应mouseUp和mouseDown事件.这工作正常.
但是,只要我添加一个DragSource,我的mouseDown事件就不再发送 - 直到我释放鼠标按钮!
重现这一点很简单 - 下面是一个简单的程序,它包含一个只有鼠标监听器和拖动监听器的普通shell.当我运行它(在Mac上),然后按住鼠标按钮时,没有任何反应 - 但是一旦我释放鼠标按钮,我立即看到鼠标按下和鼠标按下事件.如果我注释掉拖动源,那么鼠标事件将以它们应该的方式传递.
我搜索过其他有类似问题的人,而我最接近解释的是:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=26605#c16 "如果您挂钩拖动检测,操作系统需要吃掉鼠标事件,直到它确定您是否已拖动."
但是,我不明白为什么这是真的 - 为什么操作系统必须吃掉鼠标事件以确定我是否有阻力?在我按下按钮的鼠标移动事件之前,拖动才会开始.
更重要的是:有人可以建议解决方法吗?(当我按下鼠标时,我尝试动态添加和删除我的拖动源,但是我无法通过拖放操作正常,因为它从未看到初始按键 - 我找不到以编程方式启动的方法拖动.)
这是示例程序:
package swttest;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class SwtTest {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
System.out.println("mouseUp");
}
public void mouseDown(MouseEvent e) {
System.out.println("mouseDown");
}
public void mouseDoubleClick(MouseEvent e) …
Run Code Online (Sandbox Code Playgroud) 运行我的 eclipse 插件时出现以下错误。Eclipse 使用 4.12 和 java11。它曾经在 eclipse 4.6.3 + java8 中工作正常。
javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory not found
- with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory cannot be found by com.my.cep.studio.cluster.topology_0.0.0]
!ENTRY com.my.cep.diagramming 4 0 at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:289)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)
at com.my.cep.studio.cluster.topology.editors.ClusterTopologyDiagramManager.parseFile(ClusterTopologyDiagramManager.java:193)
at com.my.cep.studio.cluster.topology.editors.ClusterTopologyDiagramManager.openModel(ClusterTopologyDiagramManager.java:175)
at com.my.cep.diagramming.drawing.BaseDiagramManager.createDrawingCanvas(BaseDiagramManager.java:233)
at com.my.cep.diagramming.drawing.DiagramManager$2.run(DiagramManager.java:259)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory cannot …
Run Code Online (Sandbox Code Playgroud) 我正在使用Eclipse RCP(Kepler)编写Eclipse插件.一切都工作正常,直到昨晚突然我尝试测试我的插件时开始得到空指针异常.这是堆栈跟踪的一个snippit:
!ENTRY org.eclipse.ui.workbench 4 2 2013-08-24 08:36:17.616
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.getLastMigration(MigrationSupport.java:229)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.baseChangedSinceLastPresentationOfWizard(MigrationSupport.java:190)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration.MigrationSupport.performMigration(MigrationSupport.java:69)
at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdateScheduler.earlyStartup(AutomaticUpdateScheduler.java:89)
at org.eclipse.ui.internal.EarlyStartupRunnable.runEarlyStartup(EarlyStartupRunnable.java:87)
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
java.lang.NullPointerException
at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:354)
at org.eclipse.core.runtime.Plugin.getLog(Plugin.java:291)
at org.eclipse.ui.internal.WorkbenchPlugin.log(WorkbenchPlugin.java:830)
at org.eclipse.ui.statushandlers.StatusManager.logError(StatusManager.java:285)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:200)
at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:231)
at org.eclipse.ui.statushandlers.StatusManager$StatusManagerLogListener.logging(StatusManager.java:305)
at org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:160)
at org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:100)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:86)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:205)
at org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:178)
at org.eclipse.equinox.log.internal.ExtendedLogServiceFactory.log(ExtendedLogServiceFactory.java:65)
at org.eclipse.equinox.log.internal.ExtendedLogServiceImpl.log(ExtendedLogServiceImpl.java:87)
at org.eclipse.equinox.log.internal.LoggerImpl.log(LoggerImpl.java:54)
at org.eclipse.core.internal.runtime.PlatformLogWriter.logging(PlatformLogWriter.java:43)
at org.eclipse.core.internal.runtime.RuntimeLog.log(RuntimeLog.java:96)
at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:71)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:44)
at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
at …
Run Code Online (Sandbox Code Playgroud) Scala Eclipse插件页面说:*支持Eclipse插件和OSGi开发,包括从plugin.xml和清单文件超链接到Scala源代码.
这种支持如何运作?制作Scala插件没有向导.我没有找到关于如何在Eclipse插件/ RCP应用程序中使用Scala的文档.它甚至可能吗?
我目前正在评估maven以改进我们的构建过程.到目前为止,构建和创建普通的jar文件仍然有效,尽管我对Maven IDE并不满意.
我现在正处于构建项目所需的所有库中,并且我正在转向Eclipse RCP项目.现在我不知道该怎么做.
在进入实际的RCP部分之前,我需要首先构建一些插件.因此我实际上有3个问题.
我想构建这些插件,唯一真正的解决方案似乎是maven-bundle-plugin:http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
但是,为了很好的IDE集成,我还需要适当的文件(plugin.xml,build.properties等...),这些文件应该自动生成.
为了构建RCP部件,似乎到目前为止唯一的解决方案只是pde-maven-plugin http://mojo.codehaus.org/pde-maven-plugin/,据我所知,它使用了ant-pde .这是愚蠢的,不是吗?
我唯一能找到的东西是tycho(http://www.sonatype.com/people/2008/11/building-eclipse-plugins-with-maven-tycho/),但这是在很早的阶段.
再一次,一个很好的Eclipse集成是必要的.我真的,真的,真的不想两次指定依赖项.
那么如何使用maven构建Eclipse RCP项目?
更新
目前,似乎没有这样的解决方案.Tycho看起来非常有前途,但是我浪费了2天而没有让它运行(此时的当前版本).也许它会在半年左右的时间内准备就绪.
好的,所以这可能是一个NooB问题(我更像是一个C++人),但我迷失在java森林及其框架森林......
我正在尝试研究eclipse RCP开发.为此,我正在遵循这个着名的教程:http: //www.vogella.com/tutorials/EclipseRCP/article.html
在步骤15,我需要添加以下依赖包以在我的包中导入.javax.annotation javax.injection
问题是我无法选择它们(它们不在选择列表中)我有javax.el javax.servlet.*和javax.xml.*
查看 http://docs.oracle.com/javase/7/docs/api/overview-summary.html 表明这应该是标准java的一部分.
我错过了什么明显的错误?
我将很快开始为我现在的雇主维护一个Eclipse RCP应用程序.
您对此平台有何经验?什么是专业人士,有什么缺点,我应该注意哪些警告?
另外,您可以推荐哪些阅读材料(书籍,教程)?我在网上找到的大多数教程都已过时,有哪些更好的教程更新?
我开始阅读
Eclipse Rich Client Platform:设计,编码和打包Java(TM)应用程序,
但由于它也已经过时,我在开始时就陷入了困境,这本书实际上似乎更像是一系列的食谱做一些关于这个主题的真实书籍(它没有很好地解释核心概念).
那么,您能告诉我有关使用Eclipse RCP开发应用程序的好方面和坏方面,以及您的阅读建议是什么?
如何获取当前eclipse项目的名称?我在GMF视图中,并且在使用弹出菜单的某个子菜单时需要项目名称.
eclipse-rcp ×10
eclipse ×7
java ×5
build ×1
constraints ×1
eclipse-gmf ×1
java-11 ×1
maven-2 ×1
menuitem ×1
osgi ×1
plugins ×1
rcp ×1
scala ×1
swt ×1