Context Menus
首先,了解一下一些背景知识。eclipse平台的用户接口(UI)最初目标是具有可扩展性。实际上,也就是可扩展性,才让大家自由自在地往平台里面加入我们设计的views,editors, perspectives, actions等等。当然,扩展可以通过方式来达到。当你希望扩展平台,而其他人希望扩展你的view。一个插件往另外一个插件的view里面增添菜单,工具条和上下文菜单是很普遍的事情。
支持context menu扩展是通过view和平台之间的协助来完成。局部菜单和工具条是由平台platform来创建,而通过view来显示,而一个view的context menu必须由view来创建的,这是因为view的context menu不在平台的可视范围内(the scope of platform visibility),并且一个view包括 0、1、或多个context menu。一旦一个context menu被创建,其所属的view必须明显地在平台里注册这个上下文菜单,以该上下文菜单具有可扩展性。
上下文菜单可以直接通过使用
SWT Menu和
MenuItem来创建,或者通过使用
JFace MenuManager来创建。如果使用
MenuManager来创建,平台可以利用
actions来扩展这个菜单。然而,如果你使用
SWT Menu和
MenuItem来创建,想扩展是不可能的。
分享到:
相关推荐
Web Browser (It works as an Eclipse's editor) Image Viewer Tag Palette CSS code completion and outline DTD code completion, outline and validation JavaScript code completion, outline and ...
Anatomy of an Android Project Drawable Resources Building the Project Android Emulator Summary Chapter 5 Main Building Blocks A Real-World Example Activities Intents Services Content Providers ...
Creating an application-scoped database pool 62 Creating a client-scoped pool 64 Editing an existing pool 66 Importing a pool from another application server 67 Creating an XA pool 69 Using a ...
In summary, this graduation thesis focuses on the design and development of an Android sokoban game using the Eclipse SDK and the MVC pattern. It explores the game's background, design principles, ...
Adopting the B/S (Browser/Server) architecture pattern, the system is deployed and tested on the Tomcat application server, creating an integrated project management system suitable for small ...
The development tool software selects Eclipse, and the database software chooses MySQL server. The system adopts the B/S mode, focusing on web development, and also requires Tomcat as the WEB server ...
Creating Your First Android Project in Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Examining the Android-Created Files . . . . . . . . . . . . . . . . . . . . . . . . . . ...
- **Creating an Example Software Project**:指导用户如何创建示例软件项目,这些项目通常包含了一些预定义的功能,方便学习和测试。 #### 十四、新项目向导 - **The New Project Wizard**:新项目向导是创建新...
■CHAPTER 16 From Eclipse RCP to the NetBeans Platform . . . . . . . . . . . . . . . . . . 279 ■CHAPTER 17 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Installing Eclipse...........................................................................................3 Getting the Android SDK....................................................................