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插件开发Eclipse插件开发Eclipse插件开发Eclipse插件开发http://www.ibm.com/developerworks/cn/java/os-ecplug/
Eclipse插件开发学习笔记.pdf Eclipse插件开发学习笔记.pdf Eclipse插件开发学习笔记.pdf
eclipse插件开发指南.pdfeclipse插件开发指南.pdf
Eclipse插件开发方法与实战,一本不错的eclipse的插件开发参考书,感兴趣的可以下下看看!
Eclipse插件开发教程PPT Eclipse插件开发教程PPT
《Eclipse插件开发》由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面布局、事件处理等内容;第二篇是插件开发核心...
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》主要介绍了开发Eclipse商业插件的完整过程,并从标准窗口小部件工具集、命令与操作、视图、透视图、实现帮助、国际化等方面对创建Eclipse商业插件进行了详细...
《Eclipse插件开发学习笔记》PDF 高清版
《Eclipse插件开发(原书第3版)(畅销插件开发指南新版)》主要介绍了开发Eclipse商业插件的完整过程,并从标准窗口小部件工具集、命令与操作、视图、透视图、实现帮助、国际化等方面对创建Eclipse商业插件进行了详细...
Eclipse插件开发中编辑器代码的定位、背景色改变、高亮
本书由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面布局、事件处理等内容;第二篇是插件开发核心技术,主要介绍...
Eclipse插件开发指南 Eclipse插件开发指南
Eclipse插件开发学习笔记全书分为4篇共24章+配套全部源码。
《Eclipse插件开发》是一本介绍Eclipse插件开发的权威参考书。它对Eclipse插件开发进行了全程详细指导,内容不仅包括Eclipse使用入门、Eclipse基础结构、SWT、JFace、操作、视图、透视图、标记、性质、构建器等插件...
本书第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面布局、事件处理等...本书内容全面,讲解仔细,不仅适合没有Eclipse平台技术基础的相关人士,也适合了解相关技术、具有一定插件开发能力的读者。
资源名称:Eclipse插件开发学习笔记内容简介:《Eclipse插件开发》由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面...
eclipse插件开发指南.pdf eclipse插件开发指南.pdf eclipse插件开发指南.pdf
Eclipse插件开发指南-陈刚Eclipse插件开发指南-陈刚Eclipse插件开发指南-陈刚Eclipse插件开发指南-陈刚Eclipse插件开发指南-陈刚Eclipse插件开发指南-陈刚