标签: eclipse-plugin

两个Eclispse项目 - >一个Eclipse插件

背景

我是Vrapper项目的开发人员.

Vrapper包含2个主要部分

  • Vim仿真库(vrapper.core)
  • Eclipse部分可以很好地利用它

我们希望vrapper.core是Eclipse不知道的,所以它可以在Eclipse之外重用.目前,我们可以"整理"各种Eclipse文本编辑器和我们用于单元测试的小型模拟文本编辑器.

vrapper.core实现了各种Vim命令,模式等.这些都与Platform进行通信 - 一个抽象出底层内容的接口(文本编辑器,剪贴板,设置系统等).

当为编辑器创建模式时,它会询问平台是否有额外的命令,这些命令适用于底层编辑器,当前编辑的文件类型等.

EclipsePlatform使用Eclipse扩展点机制提供这些命令.

那么,让我们考虑以下项目(还有更多):

  • vrapper.core - 与Vrapper无关的Eclipse代码
  • vrapper.eclipse - 依赖于vrapper.core的 Eclipse插件
  • surround.core - 与Eclipse无关的代码,模拟surround.vim(Vim插件)
  • surround.eclipse - vrapper.eclipse的 Eclipse片段, 它通过surround.core提供命令.

我们可以通过两种方式来处理这些问题:

一个插件来统治它们

从Eclipse的角度看它应该是这样的.有一个插件包含来自vrapper.eclipse和vrapper.core的代码,以及一个包含来自surround.core和surround.eclipse的代码的片段.

很多插件

  • 有3个插件
    • 两个OSGified库vrapper.core,surround.core
    • vrapper.eclipse
  • 在这种情况下,surround.eclipse片段依赖于vrapper.core

问题

许多插件解决方案都有一些我不理解的延迟类加载的问题.这是因为当创建vrapper.core的模式实例时,他们需要创建来自surround.core的类(通过vrapper.eclipse - > surround.eclipse).

如果你从Eclipse运行东西并从运行配置中选择所有插件,这是有效的,但如果一个部署功能和插件并运行eclipse,则会抛出异常,因为找不到来自surround.core的类.这是环绕的精神.从依赖插件请求额外的命令创建隐式循环依赖.

我所说的隐式依赖是指在编译时没有核心类依赖于eclipse特定的类.

模式(如vim普通模式)是核心类.它们包含命令.有一些特定于Eclipse编辑器的命令(比如运行这个特定于JDT的重构).这些命令实现了核心接口,但它们的代码(显然)存在于特定于eclipse的项目中.创建模式时,它会向底层平台询问一些额外命令 - 这些额外命令是在eclipse插件中实现的.这是当eclipse中的延迟类加载使得一切都在运行时爆炸 - …

eclipse eclipse-plugin eclipse-pdt eclipse-rcp

5
推荐指数
1
解决办法
618
查看次数

How to write JavaScript in Eclipse

I am using eclipse for java coding. Can I use JavaScript in eclipse? If yes, How to use it? Please give ideas.

javascript eclipse eclipse-plugin

5
推荐指数
2
解决办法
1万
查看次数

Eclipse有类似StyleCop的插件吗?

我想用Java编程,并希望在Visual Studio中使用类似StyleCop的东西.

有谁知道这样的事情?

eclipse-plugin

5
推荐指数
1
解决办法
4211
查看次数

更新到Eclipse的ADT rev 23时出错

  • 最近我将Android SDK工具从Android SDK Manager更新到rev 23.0.重新启动eclipse IDE后,我收到一条错误消息" The Android SDK requires Android Developer Toolkit version 23.0.0 or above"(最后附上了错误对话框的图片).

    为了解决这个错误,我按照以下步骤更新了我的ADT

    菜单 - >帮助 - >安装新软件 - >添加 - >添加ADT更新站点并将ADT更新为rev 23.0.0.1245622.

  • 更新后,我重启了我的eclipse,我的eclipse开始显示我在上面的步骤中得到的旧错误信息The Android SDK requires Android Developer Toolkit version 23.0.0.x or above.

    我在帮助 - >关于菜单中检查了我的ADT插件的版本,它还显示了版本为22.0.0,而且我的SDK在eclipse的Android偏好设备中显示它显示以下错误

    This Android SDK requires Android Developer Toolkit version 23.0.0.x or above. Current version is 22.0.5.v201307292155--757759. Please update ADT to the latest version . Android首选项对话框中的错误消息Android首选项对话框中的错误消息

  • 此时我试图将ADT更新为rev 23.0.0.再次使用菜单 - >帮助 - >安装新软件,显示以下屏幕 …

eclipse eclipse-plugin adt eclipse-adt

5
推荐指数
0
解决办法
553
查看次数

加载调试配置时Eclipse Luna挂起

Eclipse(Luna)IDE遇到问题,在运行程序时我遇到了一个永无止境的循环,所以不得不终止程序.之后每次我尝试重新运行程序时它都会在加载调试配置时挂起.

我正在尝试创建一个Eclipse插件来检索文件名并为其添加注释.我不相信程序有错误,因为之前工作正常.我在另一个工作区中测试了一个简单的helloWorld程序,看看是否有任何问题,但程序运行正常.根据我的阅读,它可能与元数据文件有关,但我不知道如何纠正它.

问题

当试图加载Eclipse Luna框时,弹出框(这是正常的)在框的右下角,它会显示它正在加载的内容.当它试图加载org.eclipse.web.core时似乎挂起了.

该程序在循环发生之前工作正常,我可以毫无问题地运行它.

当Eclipse停止响应时,它询问"如果你想关闭程序"及其下面的内容,它会为您提供下面列出的一些问题详细信息.

问题细节

问题签名:

  • 问题事件名称:AppHangB1
  • 应用程序名称:javaw.exe
  • 应用版本:8.0.11.12
  • 应用程序时间戳:539f94f3
  • Hang Signature:8701
  • 吊型:134217728
  • 操作系统版本:6.3.9600.2.0.0.256.48
  • 区域设置ID:2057
  • 其他Hang Signature 1:8701579a6fb10e5d0065e1f36c8dcf91
  • 额外的Hang Signature 2:6c5e
  • 其他Hang Signature 3:6c5ef7​​fd43455b1ace2cb9fa4a881a13
  • 其他Hang Signature 4:8701
  • 其他Hang Signature 5:8701579a6fb10e5d0065e1f36c8dcf91
  • 额外的Hang Signature 6:6c5e
  • 其他Hang Signature 7:6c5ef7​​fd43455b1ace2cb9fa4a881a13

试过

清理和重建所有项目,禁用防火墙和防病毒软件,创建另一个基本程序,重新安装Eclipse和Java.

java debugging eclipse-plugin hang eclipse-luna

5
推荐指数
1
解决办法
5956
查看次数

由Tycho surefire运行时OSGi捆绑包未激活

我有几个OSGi捆绑包,这些捆绑包是在Eclipse中使用正常的清单管理的依赖关系以及使用Maven Tycho进行的外部构建而构建的。

在Equinox上的Eclipse内部运行捆绑软件可以正常工作。用Tycho构建它们可以正常工作。

现在,我想使用Tycho Surefire来运行集成测试,为此,我创建了一个包含一些基本测试的简单测试包。被测试的捆绑包依赖于OSGi容器中存在的其他捆绑包以及一些较小的启动级别调整才能正常运行-就像我说的那样,当在Equinox上正常运行捆绑包时,捆绑包本身启动时就可以正常运行。

因此,为了模仿Tycho Surefire,我在测试包的pom.xml中指定了以下内容:

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-surefire-plugin</artifactId>
            <version>0.21.0</version>
            <configuration>
                <bundleStartLevel>
                    <bundle>
                        <id>org.hibernate.osgi</id>
                        <level>6</level>
                        <autoStart>true</autoStart>
                    </bundle>
                    <!-- plus a few more bundles in the real pom.xml -->
                </bundleStartLevel>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <configuration>
                <dependency-resolution>
                    <extraRequirements>
                        <requirement>
                            <type>eclipse-plugin</type>
                            <id>org.hibernate.entitymanager</id>
                            <versionRange>4.2.12.Final</versionRange>
                        </requirement>
                        <requirement>
                            <type>eclipse-plugin</type>
                            <id>org.hibernate.osgi</id>
                            <versionRange>4.2.12.Final</versionRange>
                        </requirement>
                        <!-- plus a few more bundles in the real pom.xml -->
                    </extraRequirements>
                </dependency-resolution>
            </configuration>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

有趣的是,测试失败了。经过一些研究,我发现在失败的测试运行期间/之后如何访问OSGi控制台以进一步调查问题(运行tycho测试后的OSGi控制台)。

我的发现是,尽管OSGi容器中存在所有必需的捆绑软件(所有可传递衍生的捆绑软件和所有手动指定的捆绑软件),但只有具有独特特征<bundleStartLevel>的捆绑软件才被启动(当然还有OSGi-core-bundles)。

因此,考虑上面的例子中,我发现是,虽然双方org.hibernate.osgi并org.hibernate.entitymanager已得到解决,只有第一个是在“有效”状态。这显然使整个启动混乱,并且我的猜测是,如果捆绑包按预期启动,则测试可以正常运行。

当我查看“常规” Eclipse-OSGi-Launch配置时,有一个参数“ …

java eclipse-plugin tycho maven tycho-surefire-plugin

5
推荐指数
1
解决办法
1012
查看次数

对状态栏的贡献控制不可见

我想在工作台窗口的状态栏中放置一个控件.整个过程应该是直截了当的,但无论我尝试什么,状态栏贡献都不会变得明显.

因为我不拥有应用程序而只是设计IDE的插件,WorkbenchWindowAdvisor而朋友不是一个选择.

扩展点是这样的:

<extension point="org.eclipse.ui.menus">
   <menuContribution locationURI="toolbar:org.eclipse.ui.trim.status" allPopups="false">
      <control class="MyContributionItem" id="myContributionItem" />
   </menuContribution>
</extension>
Run Code Online (Sandbox Code Playgroud)

这个MyContributionItem班是这样的:

public class MyContributionItem extends WorkbenchWindowControlContribution {
  protected Control createControl( Composite parent ) {
    Label label = new Label( parent, SWT.NONE );
    label.setText( "STATUS BAR!" );
    return label;
  }
}
Run Code Online (Sandbox Code Playgroud)

我到目前为止所做的一切都没有成功(即状态栏贡献没有显示):

  • 加入?after=org.eclipse.jface.action.StatusLineManager了locationURI
  • 把断点放进去MyContributionItem#createControl(),永远不会到达
  • 目标平台:Eclipse Platform SDK 3.8或4.4:没有区别
  • 将allPopups属性更改为true

我很确定我正在搞一些非常明显的事情......

eclipse eclipse-plugin eclipse-rcp

5
推荐指数
1
解决办法
1257
查看次数

在Eclipse RCP项目中运行普通JUnit + Mockito时的SecurityException

我有一个带有多个插件的Eclipse RCP项目.我正在编写简单的JUnit测试(不依赖于Eclipse/UI)作为测试插件的单独片段.

当使用Mockito并尝试从另一个插件模拟一个接口(正确导出;我可以在我的代码中使用该接口)时,我得到一个与类签名相关的SecurityException:

org.mockito.exceptions.base.MockitoException: 
Mockito cannot mock this class: interface ch.sbb.polar.client.communication.inf.service.IUserService
Mockito can only mock visible & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
at org.mockito.internal.runners.JUnit45AndHigherRunnerImpl$1.withBefores(JUnit45AndHigherRunnerImpl.java:27)

[...]

Caused by: org.mockito.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:238)

[...]

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[...]

Caused by: java.lang.SecurityException: Signers of 'ch.sbb.polar.client.communication.inf.service.IUserService$$EnhancerByMockitoWithCGLIB$$a8bfe723' do not match signers of other classes in package

at java.lang.ClassLoader.checkPackageSigners(ClassLoader.java:361)

at java.lang.ClassLoader.defineClass(ClassLoader.java:295)

... 40 more
Run Code Online (Sandbox Code Playgroud)

当我将测试作为"JUnit插件测试"运行时,即使用OSGi环境,一切都按预期工作.但是我想因速度而使用普通的JUnit执行; 在被测试的类中,我不需要OSGi环境.

有人知道这样做的方法吗?

junit eclipse-plugin eclipse-rcp mockito osgi-fragment

5
推荐指数
1
解决办法
1108
查看次数

无法更新Eclipse Luna

我只需单击帮助 - >检查更新并完成向导,我收到以下错误:

An error occurred while collecting items to be installed
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.springsource.ide.eclipse.commons.browser,3.6.4.201503050855-RELEASE
No repository found containing: osgi.bundle,org.springsource.ide.eclipse.commons.gettingstarted,3.6.4.201503050855-RELEASE
No repository found containing: osgi.bundle,org.springsource.ide.eclipse.commons.quicksearch,3.6.4.201503050855-RELEASE
No repository found containing: osgi.bundle,org.springsource.ide.eclipse.dashboard.ui,3.6.4.201503050855-RELEASE
No repository found containing: osgi.bundle,org.aspectj.runtime.source,1.7.0.20120703164200
No repository found containing: osgi.bundle,org.eclipse.contribution.weaving.jdt.source,2.2.0.e37x-RELEASE-20120704-0900
No repository found containing: org.eclipse.update.feature,org.eclipse.contribution.weaving.source,2.2.0.e37x-RELEASE-20120704-0900
No repository found containing: osgi.bundle,org.eclipse.contribution.xref.core.source,2.2.0.e37x-RELEASE-20120704-0900
No repository found containing: org.eclipse.update.feature,org.eclipse.contribution.xref.source,2.2.0.e37x-RELEASE-20120704-0900
No repository found containing: osgi.bundle,org.eclipse.contribution.xref.ui.source,2.2.0.e37x-RELEASE-20120704-0900
No repository found containing: osgi.bundle,org.eclipse.fx.core,0.9.0.201401250701
No repository found containing: osgi.bundle,org.eclipse.fx.javafx,2.2.0.201401250701 …
Run Code Online (Sandbox Code Playgroud)

eclipse eclipse-plugin eclipse-luna

5
推荐指数
1
解决办法
3100
查看次数

需要登录:eclipse.tmatesoft.com每隔几分钟就会消失

在此输入图像描述

来自ErrorLog - eclipse.buildId = 4.6.3.M20170301-0400 org.eclipse.equinox.p2.repository错误星期六09年9月16日16:13:23 CST 2017身份验证失败http://eclipse.tmatesoft.com/svnkit/1.8 .x /.

如何删除此插件?

eclipse eclipse-plugin equinox

5
推荐指数
1
解决办法
3439
查看次数