alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

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

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.services.IServiceLocator;

/**
 * The common interface between the workbench and its parts, including pages
 * within parts.
 * <p>
 * The workbench site supports a few {@link IServiceLocator services} by
 * default. If these services are used to allocate resources, it is important to
 * remember to clean up those resources after you are done with them. Otherwise,
 * the resources will exist until the workbench site is disposed. The supported
 * services are:
 * </p>
 * <ul>
 * <li>{@link ICommandService}
 * <li>{@link IContextService}
 * <li>{@link IHandlerService}
 * <li>{@link IBindingService}. Resources allocated through this service will
 * not be cleaned up until the workbench shuts down.</li>
 * </ul>
 * <p>
 * This interface is not intended to be implemented or extended by clients.
 * </p>
 * 
 * @see org.eclipse.ui.IWorkbenchPartSite
 * @see org.eclipse.ui.part.IPageSite
 * @since 2.0
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IWorkbenchSite extends IAdaptable, IShellProvider,
		IServiceLocator {

	/**
	 * Returns the page containing this workbench site.
	 * 
	 * @return the page containing this workbench site
	 */
	public IWorkbenchPage getPage();

	/**
	 * Returns the selection provider for this workbench site.
	 * 
	 * @return the selection provider, or <code>null if none
	 */
	public ISelectionProvider getSelectionProvider();

	/**
	 * Returns the shell for this workbench site. Not intended to be called from
	 * outside the UI thread. Clients should call IWorkbench.getDisplay() to
	 * gain access to the display rather than calling getShell().getDisplay().
	 * 
	 * <p>
	 * For compatibility, this method will not throw an exception if called from
	 * outside the UI thread, but the returned Shell may be wrong.
	 * </p>
	 * 
	 * @return the shell for this workbench site
	 */
	public Shell getShell();

	/**
	 * Returns the workbench window containing this workbench site.
	 * 
	 * @return the workbench window containing this workbench site
	 */
	public IWorkbenchWindow getWorkbenchWindow();

	/**
	 * Sets the selection provider for this workbench site.
	 * 
	 * @param provider
	 *            the selection provider, or <code>null to clear it
	 */
	public void setSelectionProvider(ISelectionProvider provider);

}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.