Q: |
When does a plugin get started? |
A: |
Each plug-in can be viewed as having a declarative section and a code section. The declarative part is contained in the plugin.xml file. This file is loaded into a registry when the platform starts up and so is always available, regardless of whether a plug-in has started. The code section are laze loaded by default. They are activated only when their functionality has been explicitly invoked by the user. . |
|
|
Q: |
How to config a plugin to start automatically during platform starts up? |
A: |
Define the 'Eclipse-AutoStart=true' header in Manifest file. . |
|
|
Q: |
What are extensions and extension points? |
A: |
Loose coupling in Eclipse is achieved partially through the mechanism of extensions and extension points. When a plug-in wants to allow other plug-ins to extend or customize portions of its functionality, it will declare an extension point. The extension point declares a typically a combination of XML markup and Java interfaces, that extensions must conform to. Plug-ins that want to connect to that extension point must implement that contract in their extension.
The key attribute is that the plug-in being extended knows nothing about the plug-in that is connecting to it beyond the scope of that extension point contract. This allows plug-ins built by different individuals or companies to interact seamlessly, even without their knowing much about one another. . |
|
|
Q: |
What is the classpath of a plug-in? |
A: |
The OSGi parent class loader. (Java boot class loader by default); The exported libraries of all imported plug-ins; The declared libraries of the plug-in and all its fragments.
|
|
|
Q: |
How to access UI objects from a non-ui thread? |
A: |
Use Display.getDefault().asyncExec(new Runnable()...) Display.asyncExec causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.
|
|
|
Q: |
Do we need to explicitly invoke org.eclipse.swt.graphics.Image.dispose()? |
A: |
Application code must explicitly invoke the Image.dispose() method to release the operating system resources managed by each instance when those instances are no longer required. This is because that the Java finalization is too weak to reliably support management of operating system resources.
|
|
|
Q: |
How to fire a key event in my test code to make the program act as if a user pressed a key? |
A: |
Two ways to implement it in code: generating OS level key event use Display.post(Event) or use Widge.notifyListeners(...) to just notify a widget's listeners.
|
|
|
Q: |
What is Display, what is Shell? |
A: |
The Display class respresents the GUI process(thread), the Shell class represents windows.
|
|
|
Q: |
Why do I get the error "org.eclipse.swt.SWTException: Invalid thread access"? |
A: |
SWT implements a single-threaded UI model often called apartment threading. In this model, only the UI-thread can invoke UI operations. SWT strictly enforces this rule. If you try and access an SWT object from outside the UI-thread, you get the exception "org.eclipse.swt.SWTException: Invalid thread access". The following code sets the text of a label from a background thread and waits for the operation to complete: display.syncExec( new Runnable() { public void run(){ label.setText(text); } }); |
|
|
Q: |
How to resize my shell to get my changed widgets to lay out again? |
A: |
A layout is only performed automatically on a Composite's children when the Composite is resized, including when it is initially shown. To make a Composite lay out its children under any other circumstances, such as when children are created or disposed, its layout() method must be called.
|
|
|
Q: |
What is EMF? |
A: |
The Eclipse Modeling Framework is a Java/XML framework for generating tools and other applications based on simple class models. EMF helps you rapidly turn models into efficient, correct, and easily customizable Java code. It is intended to provide the benefits of formal modeling, but with a very low cost of entry. In addition to code generation, it provides the ability to save objects as XML documents for interchange with other tools and applications.
Models can be created using annotated Java, XML documents, or modeling tools like Rational Rose, then imported into EMF. The code generator turns a model into a set of Java implementation classes. These classes are extensible and regenerable - you can modify them by adding user-defined methods and instance variables. When the model changes, you can regenerate the implementation classes, and your modifications will be retained. This works both ways - changes in the Java code can be used to update the model.
|
|
|
Q: |
Is there a built-in facility to check whether a given value is valid compared to the effective facets of its type? |
A: |
To determine if a literal is valid with respect to a simple type, you can use either XSDSimpleTypeDefinition.isValidLiteral or XSDSimpleTypeDefinition.assess.
|
|
|
Q: |
What is included in the Rich Client Platform? |
A: |
Eclipse Runtime, SWt, JFace, Workbench
|
|
|
Q: |
How can I change the window icon in my application? |
A: |
Define a product via the products extension point and specify the windowImages property to refer to two image files, a 16x16 one and a 32x32 one.
|
|
|
Q: |
How can I hide menu contribued by other plugins? |
A: |
We can use org.eclipse.ui.activities extension to hide menu from other plugin
<extension point="org.eclipse.ui.activities">
<activity id="com.xyz.Activity" description="Menus contributions from com.xyz" name="My Activity" />
<category id="com.xyz.Category" description="com.xyz Activities" name="My Category">
<!-- put the activity in the category --> ><categoryActivityBinding activityId="com.xyz.Activity" categoryId="com.xyz.Category" />
<!-- bind all contributions from plugin com.xyz --> <activityPatternBinding id="com.xyz.Activity" pattern="com\.xyz/.*"/>
<!-- menu activity from xyz plugin will be be disabled by default --> </extension>
|
|
|
Q: |
[OSGI]What are the differences between 'Require-Bundle' and 'Import-Package' |
A: |
There are two complementary ways of depending on something from outside a given plug-in; Require-Bundle and Import-Package.
Using the Require-Bundle manifest header, plug-ins specify an explicit dependency on a specific bundle and version. As such, the required bundles are placed logically on the dependent plug-in's classpath.
Import-Package is used to declare a dependency on a package without knowing which exact bundle will provide it. Any bundle in the environment must export the package with Export-Package for the Import-Package to be resolved.
|
|
|
Q: |
[OSGI]What is optional dependency |
A: |
plug-in prerequisite elements can be made optional by adding the optional="true" attribute in Manifest file(see below for an example). Marking an import as optional simply states that if the specified plug-in is not found at runtime, the dependent plug-in should be left enabled.
This is used when a plug-in can be used in many scenarios or it is reasonable to operate with reduced function. It allows the creation of minimal installs that cover functional subsets. Require-Bundle: org.eclipse.swt; optional="true"
|
|
|
Q: |
[TEST]How to write unit test for eclipse plugin |
A: |
Use Eclipse plugin fragments to develop PDE Unit tests for each plugin. Two ways to run the unit test:
Use JUnit Plug-in Test Launcher to test in GUI
Use PDE headless build to integrate into the automatic build and test environment.
|
分享到:
相关推荐
本书由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括 SWT控件的使用、界面布局、事件处理等内容;第二篇是插件开发核心技术,主要介绍...
在本教程中,我们将深入探讨Eclipse插件开发的关键概念和技术。 首先,Eclipse插件的基础是OSGi(Open Service Gateway Initiative)框架,它定义了一种模块化系统,使得插件之间可以独立地加载、更新和卸载。每个...
6. **面试题**: 在Java面试中,Eclipse和MyEclipse的使用技巧、Struts和Spring的配置与实践、以及MVC模式的理解是常见的考察点。面试者需要熟悉Eclipse的工作空间设置、快捷键、插件安装等,理解Struts的Action和...
2. **插件机制**:Eclipse支持丰富的插件,如Mylyn用于任务管理,Maven插件用于构建项目,JUnit用于单元测试等。 3. **调试技巧**:掌握如何设置断点、单步执行、查看变量值、调用栈和线程状态等。 4. **版本控制*...
"1000道互联网Java工程师面试题" 本资源提供了互联网Java工程师面试题,涵盖了Java、MyBatis、ZooKeeper、Dubbo、Elasticsearch、Memcached、Redis、MySQL、Spring、Spring Boot、Spring Cloud、RabbitMQ、Kafka、...
标题中的“eclipse插件swtDesigner的注册码”指的是在Eclipse集成开发环境中使用的SWT Designer插件的注册信息。SWT Designer是用于帮助Java开发者设计和构建 SWT(Standard Widget Toolkit)和JFace用户界面的工具...
标题“Java Tools Eclipse Plugins”揭示了我们关注的焦点是Java编程环境中的Eclipse插件,这些插件是为了增强Eclipse IDE的功能,以更好地支持开发、调试和测试Java应用程序。Eclipse是一个开源的集成开发环境(IDE...
2. 开发环境:如Eclipse、IntelliJ IDEA、VS Code等的使用,包括配置、调试、插件安装等。 3. 构建工具:Maven、Gradle等,用于项目管理和自动化构建。 4. 测试工具:JUnit、Mockito等进行单元测试和集成测试。 5. ...
以上内容涵盖了Java笔试面试题中提到的核心技术和重点知识,对于准备Java相关职位的面试者而言非常实用。理解并掌握这些知识点不仅有助于面试成功,还能为成为一名优秀的Java开发者打下坚实的基础。
### Java 面试题精选解析(2012年版) #### 一、Java IDE的理解与应用 **IDE(Integrated Development Environment,集成开发环境)**是用于提供全面设施进行软件开发的一种应用软件。它通常包含代码编辑器、...
在开始NCC开发之前,需要安装并配置NCC的开发环境,这通常包括Java开发工具(如JDK)、集成开发环境(IDE,如Eclipse或IntelliJ IDEA)、NCC SDK以及相关的构建工具(如Maven或Gradle)。确保所有依赖库和插件正确...
TortoiseSVN和WinCVS分别是Windows下的SVN和CVS图形界面客户端,Subclipse则是一个用于Eclipse集成开发环境的SVN插件。 5. **字符串翻转**:PHP提供了`strrev()`函数可以直接实现字符串翻转,也可以自定义函数通过...
- 提供了与开发工具集成的相关支持,如Eclipse插件等。 6. **消息(Messaging)** - 支持STOMP、AMQP等协议,提供消息中间件集成的能力。 7. **测试(Test)** - 提供了支持单元测试和集成测试的功能,简化了测试...
- **IDE工具**:Eclipse, IntelliJ IDEA等的使用,快捷键和插件。 - **版本控制**:Git的使用,包括分支管理、合并冲突等。 以上知识点都是Java程序员面试中常见的,熟练掌握这些将有助于你在面试中表现出色。...
【用友软件应聘笔面试题】涉及的知识点广泛,涵盖了Java编程、逻辑推理、数据库管理、Web开发、软件设计模式等多个领域。以下是这些题目中涉及的主要知识点: 1. **Java基础**: - `==`与`.equals()`的区别:`==`...
Maven 面试题系列之 Maven 面试专题及答案(18题) Maven 是一个基于项目对象模型(POM)的项目管理和构建工具,由 Apache 软件基金会开发和维护。它提供了一个 uniform 的方式来构建、打包和部署项目,使得开发者...
本资源包涵盖了Java领域的多个重要知识点,包括常规Java工具、算法、加密技术、数据库管理和面试题,同时提供了源代码分析和解决方案,旨在帮助开发者提升技能,解决实际问题。 1. **常规Java工具**:这部分可能...
- Subclipse 是Eclipse中的SVN插件。 #### 5. 字符串反转 使用`strrev()`函数可以轻松地反转字符串。 #### 6. 优化MySQL查询的建议 - 避免使用NULL作为比较条件,应使用NOT NULL。 - 尽量使用JOIN而不是子查询。...
- 开发类似Eclipse的软件,应考虑采用插件架构,可以使用动态库或模块化设计,使得第三方开发者可以轻松扩展功能。 - 需要提供稳定的API接口和良好的文档,以便第三方开发者理解和集成。 8. **指针和数组的运算**...