什么时候选择“生成活化剂...”当创建一个新的Eclipse插件项目 [英] When to choose "Generate an activator..." when creating a new Eclipse plugin project

查看:193
本文介绍了什么时候选择“生成活化剂...”当创建一个新的Eclipse插件项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多Eclipse RCP教程从明显的第一步开始:创建一个新的插件项目...

There are lots of Eclipse RCP tutorials that begin with the obvious first step: "Create a new plugin project..."

其中70%指定检查生成激活程序,控制插件生命周期的Java类。其他人具体说不要检查该切换。

It seems that approx. 70% of them specify checking the "Generate an activator, a Java class that controls the plug-in life cycle". The others specifically say don't check that toggle.

alt文本http://img179.imageshack.us/img179/6710/newpluginoptions.png

它不清楚我,什么生成一个激活类对于你,当你需要一个,当你不需要时。

Its not clear to me, what generating an activator class does for you, when you need one, and when you don't.

作为一个突出的选择,你每次创建一个新的插件项目(似乎是默认情况下设置)此选项在我发现的任何地方都没有很好的解释。

For being a prominent option you get every time you create a new plugin project (it seems to be set on by default) this option isn't very well explained anywhere that I have found.

在创建Eclipse插件项目时选择此选项的任何建议/经验法则?

Any advice/rules of thumb on choosing this option when creating Eclipse plugin projects?

推荐答案

从Eclipse本身(对话框的上下文相关帮助)它说这是非常有用的。

From Eclipse itself (context sensitive help for the dialog) it says this, which is marginally useful.

一个激活器是一个控制插件生命周期的Java类,只有当您需要在启动或关闭您的PLU g-in。

"An activator is a Java class that controls the plug-in's life cycle. It is only needed if you require to do work upon the startup or shutdown of your plug-in."

当打开此选项时,将为您的新项目自动生成一个Activator.java类。

When turning this option ON, an Activator.java class is auto-generated for your new project.

所以,这听起来像是(有点新手),你不知道为什么或在插件启动/关闭时需要做什么额外的工作,你可以安全地离开这个关闭。只有少一个.java文件显示在您的项目源文件夹中。

So, it sounds like if (being somewhat a novice) you have no idea why or what additional work you have to do at plugin startup/shutdown, you can safely leave this OFF. Just one less .java file showing up in your project source folder.

这篇关于什么时候选择“生成活化剂...”当创建一个新的Eclipse插件项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆