KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > IStartup


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui;
12
13 /**
14  * Plug-ins that register a startup extension will be activated after
15  * the Workbench initializes and have an opportunity to run
16  * code that can't be implemented using the normal contribution
17  * mechanisms.
18  *
19  * @since 2.0
20  */

21 public interface IStartup {
22     /**
23      * Will be called in a separate thread after the workbench initializes.
24      * <p>
25      * Note that most workbench methods must be called in the UI thread
26      * since they may access SWT. For example, to obtain the current workbench
27      * window, use:
28      * <code>
29      * <pre>
30      * final IWorkbench workbench = PlatformUI.getWorkbench();
31      * workbench.getDisplay().asyncExec(new Runnable() {
32      * public void run() {
33      * IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
34      * if (window != null) {
35      * // do something
36      * }
37      * }
38      * });
39      * </pre>
40      * </code>
41      * </p>
42      * @see org.eclipse.swt.widgets.Display#asyncExec
43      * @see org.eclipse.swt.widgets.Display#syncExec
44      */

45     public void earlyStartup();
46 }
47
48
Popular Tags