Class WorkbenchAdvisor的部分译文
来源:互联网 发布:房产中介软件fangyou 编辑:程序博客网 时间:2024/04/27 20:41
org.eclipse.ui.application
Class WorkbenchAdvisor
java.lang.Object org.eclipse.ui.application.WorkbenchAdvisor
- public abstract class WorkbenchAdvisor
- extends Object
Public base class for configuring the workbench.
注意,工作台引导器( workbench advisor)对象先于工作台( workbench )被创建。尽管如此,使用PlatformUI.getWorkbench 确保已经完全初始化。
创建并运行Workbench(在IPlatformRunnab中)的示例:
public class MyApplication implements IPlatformRunnable { public Object run(Object args) { WorkbenchAdvisor workbenchAdvisor = new MyWorkbenchAdvisor(); Display display = PlatformUI.createDisplay(); int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor); if (returnCode == PlatformUI.RETURN_RESTART) { return IPlatformRunnable.EXIT_RESTART; } else { return IPlatformRunnable.EXIT_OK; } }
应用程序应该继承自WorkbenchAdvisor类,并覆写方法使工作台的配置符合特殊应用的需求。
以下的引导方法在工作台(workbench)的生命周期的关键点被调用(在动态调用PlatformUI.createAndRunWorkbench时,全部都触发.)
initialize – 在所有窗体之前最先调用,可用于注册实体。
preStartup – 在initialize之后但在第一个打开窗体之前调用,可用于在启动或恢复时临时禁用实体。
postStartup – 在preStartup之后但在第一个打开窗体之前调用,可用于重新启用上一步骤禁用的实体。
postRestore – 在工作台的窗体从先前保存的状态中恢复后调用。可用于调整恢复的工作台。
preWindowOpen – 在窗体打开之前调用,用于配置窗体的外貌除了工具条(菜单、工具条等)。
fillActionBars – 在preWindowOpen后调用,用来配置窗体的工具条。
postWindowRestore - 在窗体从先前保存的状态或从一个初始的状态中恢复后调用,用于调整窗体。
postWindowCreate – 在窗体从一个初始的状态或从一个恢复的状态中创建后调用,用于调整窗体。
openIntro – 打开窗体前调用,为了创建介绍组件。
postWindowOpen – 在窗体打开后调用,可用于调用窗体监听器或其他。
preWindowShellClose – 在窗体的Shell被用户关闭后调用,用来关闭屏幕窗体。
eventLoopException – 当事件循环(Event Loop)崩溃时用来操作异常事件,用来通知用户出现问题了。
eventLoopIdle – 当当前没有可以处理的事件时调用,用来执行其他工作或挂起直到新的时间进入了队列。
preShutdown – 在事件循环终止后窗体被关闭前调用,用来注销在初始化时注册的实体。
postShutdown –在事件循环终止且所有的窗体都被关闭后最后调用,用来注销在初始化时注册的实体。
- Since:
- 3.0
static int
FILL_COOL_BAR
Deprecated. use
instead
static int
FILL_MENU_BAR
Deprecated. use
instead
static int
FILL_PROXY
Deprecated. use
instead
static int
FILL_STATUS_LINE
Deprecated. use
instead
protected
WorkbenchAdvisor()
Creates and initializes a new workbench advisor instance.
void
createWindowContents(IWorkbenchWindowConfigurer configurer, Shell shell)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.createWindowContents(Shell)
instead WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
Creates a new workbench window advisor for configuring a new workbench window via the given workbench window configurer.
void
eventLoopException(Throwable exception)
Performs arbitrary actions when the event loop crashes (the code that handles a UI event throws an exception that is not caught).
void
eventLoopIdle(Display display)
Performs arbitrary work or yields when there are no events to be processed.
void
fillActionBars(IWorkbenchWindow window, IActionBarConfigurer configurer, int flags)
Deprecated. since 3.1, override
ActionBarAdvisor.fillActionBars(int)
instead IAdaptable
getDefaultPageInput()
Returns the default input for newly created workbench pages when the input is not explicitly specified.
abstract String
getInitialWindowPerspectiveId()
Returns the id of the perspective to use for the initial workbench window, or
null
if no initial perspective should be shown in the initial workbench window. String
getMainPreferencePageId()
Returns the id of the preference page that should be presented most prominently.
protected IWorkbenchConfigurer
getWorkbenchConfigurer()
Returns the workbench configurer for the advisor.
void
initialize(IWorkbenchConfigurer configurer)
Performs arbitrary initialization before the workbench starts running.
void
internalBasicInitialize(IWorkbenchConfigurer configurer)
Remembers the configurer and calls
initialize
. boolean
isApplicationMenu(IWorkbenchWindowConfigurer configurer, String menuId)
Deprecated. since 3.1, override
ActionBarAdvisor.isApplicationMenu(String)
instead void
openIntro(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.openIntro()
instead boolean
openWindows()
Opens the workbench windows on startup.
void
postShutdown()
Performs arbitrary finalization after the workbench stops running.
void
postStartup()
Performs arbitrary actions after the workbench windows have been opened (or restored), but before the main event loop is run.
void
postWindowClose(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.postWindowClose()
instead void
postWindowCreate(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.postWindowCreate()
instead void
postWindowOpen(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.postWindowOpen()
instead void
postWindowRestore(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.postWindowRestore()
instead boolean
preShutdown()
Performs arbitrary finalization before the workbench is about to shut down.
void
preStartup()
Performs arbitrary actions just before the first workbench window is opened (or restored).
void
preWindowOpen(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.preWindowOpen()
instead boolean
preWindowShellClose(IWorkbenchWindowConfigurer configurer)
Deprecated. since 3.1, override
WorkbenchWindowAdvisor.preWindowShellClose()
instead IStatus
restoreState(IMemento memento)
Restores arbitrary application-specific state information for this workbench advisor.
IStatus
saveState(IMemento memento)
Saves arbitrary application-specific state information for this workbench advisor.
- Class WorkbenchAdvisor的部分译文
- 关于CWinApp Class Members的译文
- L1Magic部分译文
- josso 2.3 部分译文
- Deep learning 译文 -- 第二部分
- WorkbenchAdvisor中的方法执行顺序
- lucene.apache.org部分译文(getting started)
- HTTP 1.1 Connction 报头部分译文
- 《The Custom Permission Problem》部分译文
- Databricks:2015 Spark调查报告(部分译文)
- Android doc |Getting Started|部分 部分译文 --Supporting Different Devices
- GlobalLock的MSDN译文
- Spring的@ModelAttribute译文
- 汇编写驱动(三)——字符串问题的补充——string.mac说明部分的译文
- 部分类 partial class
- 《Excel 2013 Power Programming with VBA》部分章节译文
- kaggle-浮游生物分类比赛一等奖---译文(第一部分)
- kaggle-浮游生物分类比赛一等奖---译文(第二部分)
- Excel Services OverView系列1:什么是Excel Services
- 转正困惑我的心
- discuz 5.0 爆新漏洞
- HttpWebRequest 登入.text博客系统但是发帖就登出的疑惑
- PowerDesigner 自定义报表输出项
- Class WorkbenchAdvisor的部分译文
- ASP.NET中常用的优化性能方法
- jdbc学习(转载)
- 网游防沉迷系统 - 呼之欲又出
- My Notebook!
- Marketing Case ----职场心得:关于资源整合!个人的体会
- windows+php5+apache2配置
- WEB编程开发常用的代码
- 网页计数器涉及的win2003权限设置