我的插件必须写入eclipse控制台 - 为了测试目的,我简化了我的代码,所以我只有以下内容:
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
System.out.println("Tecomp Plugin is running");
MessageConsole myConsole = new MessageConsole("My Console", null);
//myConsole.activate();
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ myConsole });
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
final MessageConsoleStream stream = myConsole.newMessageStream();
stream.setActivateOnWrite(true);
stream.println("Hi there!");
stream.close();
}
Run Code Online (Sandbox Code Playgroud)
这是一个简单的插件,方法开始对扩展AbstractUIPlugin的类开始 - 它不是rcp应用程序.代码在运行时工作台内运行良好 - 一旦安装了插件,输出就会丢失.该插件的其余部分正常工作.
ConsolePlugin可能有问题吗?或者在运行时工作台和开发工作台中以不同方式处理流?
我尝试了两个 - 一个功能项目并直接将插件jar复制到eclipse目录 - 用于安装插件 - 两者的结果相同...
欢迎任何帮助,因为我现在已经解决了这个问题一段时间了......
此致,Kathi
它似乎不是控制台的问题...我提供了我自己的视图来打印输出,但虽然在plugin.xml中声明,安装插件后没有视图...这是我做的: - 使用ExportWizard将插件导出到jar-archive -copied这个存档到/ usr/share/eclipse/plugins -restarted eclipse
或者使用一个功能项目: - 使用ExportWizard导出包含我的插件的功能项目 - 从eclipse目录中删除上面的jar存档 - 安装了功能 - 重新启动eclipse
两个都没有说 - 安装插件我有什么问题吗?jar-archive是好的,我查了一下 - 这是最新版本.但不知何故,似乎eclipse仍在使用一些较旧的插件而没有我所做的更改
问候,卡蒂
是否可以在没有Java的情况下创建Eclipse插件/程序Eclipse RCP应用程序?(最好是在Jython中)
我正在开发一个插件,它接受实现特定接口(IDomain)的工作空间中的所有枚举解析代码(使用AST)对枚举进行一些修改并将其标记为使用注释(@IDomainInfo)处理.
例如,它需要像这样:
public
enum SomeEnum implements IDomain {
// ...
}
Run Code Online (Sandbox Code Playgroud)
并生成这样的东西:
public @IDomainInfo(domainId = 1)
enum SomeEnum implements IDomain {
// Some changes here...
}
Run Code Online (Sandbox Code Playgroud)
@IDomainInfo背后的想法是插件不再需要处理带注释的枚举.
基本上我完成任务的目的是使用JavaSearch API进行搜索以查找实现IDomain(简单任务)的所有枚举,结果我得到了IJavaElements列表(实际上是IType的实例).然后我调用一个迭代结果列表的方法,并创建一个未使用@IDomainInfo注释的所有IType实例的新列表,然后处理结果列表:对于每个未注释的IType做一些工作,用@注释IType IDomainInfo注释(使用AST)然后将结果保存回文件(使用IFile,所以我可以看到更改而不刷新,事实上,如果我在编辑器中打开枚举,我看到它立即刷新:-)
一切正常,但如果我打开一个@IDomainInfo带注释的枚举(仅用于测试),然后删除@IDomainInfo,保存文件(我确定)然后调用执行我之前描述的所有工作的操作,当我到达从非注释的过滤带注释的IType的部分时,代码是这样的:
for (IType type : typeList) {
IAnnotation annotation = type.getAnnotation(“IDomainInfo”);
if (!annotation.exists()) {
// The annotation does not exist, so add the type to the
// list of elements to update and go on...
ret.add(type);
continue;
}
// Something else here...
}
Run Code Online (Sandbox Code Playgroud)
好吧,结果是对于我刚刚保存的文件,IType检测到我刚删除的注释,就像它仍然存在一样.如果我关闭并重新打开eclipse,所有工作都会正常进行.
现在,我刚检查并三重检查了我的代码,所以我确定我没有使用注释版本保留未编辑的旧IType的旧版本(我的所有IType都来自每次新的java搜索调用我执行动作).
所以问题是,我可能做错了什么?我的意思是,我刚刚多次阅读JavaCore API来检查我是否可能使用它错了或者我是否有一些概念上的缺陷但我真的没有线索,就像eclipse会缓存IType忽略变化我刚刚在编辑中做出: - …
我正在尝试在Eclipse中安装C++版本的新软件.Help -> install new software.当我去安装新软件时,它会挂起或花费数小时来移动百分比.
我已经读过这是一个已知的错误JRE7,我假设我正在使用它,因为我安装了它.我改为使用参数JRE6更改eclipse.ini文件,-vm XXXX其中XXXX是我的路径javaw.exe.
它似乎没有改变任何东西.
想法?
谢谢.
我正在尝试按照以下说明安装Eclipse Indigo 3.7.2(在Ubuntu上运行)的gwt-maven-plugin:http: //uptick.com.au/content/getting-started-gwt-maven-and-日食
但是,当我进入安装"Maven Integration for Eclipse WTP"的步骤时,我收到以下错误:
无法完成安装,因为找不到一个或多个必需的项目.正在安装的软件:Maven Integration for WTP(可选)0.12.0.20110421-1500(org.maven.ide.eclipse.wtp.feature.feature.group 0.12.0.20110421-1500)缺少要求:WTP的Maven集成(可选)0.12. 0.20110421-1500(org.maven.ide.eclipse.wtp.feature.feature.group 0.12.0.20110421-1500)需要'org.maven.ide.eclipse.feature.feature.group [0.10.0,1.0.0)'但它无法找到
关于SO的类似问题建议勾选"联系所有更新站点",但这对我不起作用.根据这个帖子的建议,我还添加了Galileo&Helios更新站点(除了Indigo):http://www.eclipse.org/forums/index.php/t/206143/
还有其他想法如何解决这个问题?
我正在尝试使用Android Runtime将现有的Android应用程序移植到BlackBerry 10.首先,我需要提一下,我已成功将一个简单的Android应用程序移植到BlackBerry 10而没有任何错误.我在这个过程中使用了Eclipse的"插件重新打包工具".
在此应用程序中,它会因为包含项目ProjectName而导致错误,因为它有验证错误.生成错误后,它会在代码中显示错误.代码的错误行如下.
intent.addCategory(Intent.CATEGORY_HOME);
Run Code Online (Sandbox Code Playgroud)
携带上述行的完整代码块如下.
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
当我评论该代码块并尝试为AppWorld登录时,它工作正常.
上面的代码片段如何影响移植和生成错误?
我正在创建一些需要第三方插件和功能的Eclipse插件和功能.为了将这些依赖项包含到我的项目中,我创建了一个p2布局存储库.
注意:我的p2工件不是Maven项目......但是,我使用的是Maven风格的建筑.这是p2存储库的pom.xml
<properties>
<tycho-version>0.18.0</tycho-version>
</properties>
<repositories>
<repository>
<id>eclipse-platform-m6</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/3.8</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
<configuration>
<compress>false</compress>
<artifactRepositoryLocation>/mypath/target/repository</artifactRepositoryLocation>
<metadataRepositoryLocation>/mypath/target/repository</metadataRepositoryLocation>
<sourceLocation>/mypath/src</sourceLocation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>verify-repository</goal>
<goal>archive-repository</goal>
</goals>
<configuration>
<compress>false</compress>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<publishArtifacts>true</publishArtifacts>
</configuration>
</plugin>
<plugin><!-- enable the Tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
以上构建成功,并创建(并验证)p2存储库.我target/在项目目录中得到以下结构
- Project …Run Code Online (Sandbox Code Playgroud) 我想为自定义导航器视图弹出菜单实现自定义属性测试器.不幸的是它实际上从未被调用.这是plugin.xml部分和类.
定义的属性测试器:
<extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="com.mytest.MyPropertyTester"
id="com.mytest.myPropertyTester"
namespace="com.mytest.myPropertyTester"
properties="testProperty"
type="com.mytest.MyPropertyTester">
</propertyTester>
Run Code Online (Sandbox Code Playgroud)
定义部分:
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="org.eclipse.example.testExtension">
<adapt
type="org.eclipse.core.resources.IResource">
<test
property="com.mytest.myPropertyTester.testProperty">
</test>
</adapt>
</definition>
Run Code Online (Sandbox Code Playgroud)
可见部分:
<command
commandId="com.mytest.testcommand"
label="Test Command"
style="push">
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<iterate
ifEmpty="false"
operator="or">
<or>
<reference
definitionId="org.eclipse.example.testExtension">
</reference>
</or>
</iterate>
</with>
</visibleWhen>
</command>
Run Code Online (Sandbox Code Playgroud)
和相应的课程:
package com.mytest;
import org.eclipse.core.expressions.PropertyTester;
public class MyPropertyTester extends PropertyTester {
public MyPropertyTester() {
System.out.println("PROPERTY TESTER CONSTRUCTOR");
}
@Override
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
System.out.println("PROPERTY TESTER CALLED"); …Run Code Online (Sandbox Code Playgroud) 我正在尝试设置我的eclipse插件开发目标并多次收到以下错误:
!ENTRY org.eclipse.e4.ui.css.swt 4 0 2015-01-30 15:15:06.879
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.e4.ui.css.swt [955]
Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.css.core; bundle-version="0.9.0"
-> Bundle-SymbolicName: org.eclipse.e4.ui.css.core; bundle-version="0.10.100.v20140424-2042"; singleton:="true"
org.eclipse.e4.ui.css.core [1134]
Unresolved requirement: Require-Bundle: org.apache.batik.css; bundle-version="1.7.0"
-> Bundle-SymbolicName: org.apache.batik.css; bundle-version="1.7.0.v201011041433"
org.apache.batik.css [1177]
Unresolved requirement: Import-Package: org.w3c.dom.events; version="[3.0.0,4.0.0)"
Run Code Online (Sandbox Code Playgroud)
这是否意味着这些插件都无法解析,或者只是不是最后一个插件,或者org.w3c.dom.events这是由于捆绑版本的不匹配造成的org.eclipse.e4.ui.css.core?
我有(可能很常见)用例,我想在共享驱动器上创建一个文件夹:
public static void main(final String[] args) throws IOException {
final Path path = new File("H:\\test-folder").toPath();
Files.createDirectories(path);
}
Run Code Online (Sandbox Code Playgroud)
我得到以下异常:
Exception in thread "main" java.nio.file.FileSystemException: H:\test-folder: Unable to determine if root directory exists
at java.nio.file.Files.createDirectories(Unknown Source)
at org.acme.project.Main.main(Main.java:15)
Run Code Online (Sandbox Code Playgroud)
(这里奇怪的部分是谷歌几乎不知道这个例外.)
这个问题似乎完全是Eclipse的错,因为上面的代码完全可以从命令行运行.但是因为我在Eclipse插件中需要它,所以这些信息与我完全无关.我只是需要它才能工作.
那么在网络驱动器上创建文件夹需要做些什么呢?
eclipse-plugin ×10
eclipse ×7
java ×3
eclipse-jdt ×2
eclipse-rcp ×2
android ×1
console ×1
gwt ×1
jython ×1
maven ×1
osgi-bundle ×1
tycho ×1