org.eclipse.corona.container.project.ui.view
Class ProjectContainerView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.corona.internal.container.project.ui.MultiPageViewPart
                  extended by org.eclipse.corona.container.project.ui.view.ProjectContainerView
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.resources.IResourceChangeListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation, org.osgi.service.event.EventHandler

public class ProjectContainerView
extends org.eclipse.corona.internal.container.project.ui.MultiPageViewPart
implements org.eclipse.core.resources.IResourceChangeListener, org.osgi.service.event.EventHandler

Corona Project Container View Ths class displays all pages defined a extension point org.eclipse.corona.client.project.ui.projectcontainerpage. The pages must extend AbstractProjectContainerPage or ViewPart. Later on fallowing abbervations are used:


Field Summary
static java.lang.String PROJECT_CONTAINER_PAGE_EXTENSIONPOINT
          An identifier of the extension point.
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ProjectContainerView()
          Creates a multi-page editor example.
 
Method Summary
protected  void createPages()
          Creates the pages of the multi-page viewer.
 void dispose()
          The MultiPageViewPart implementation of this IWorkbenchPart method disposes all nested editors.
 ProjectContextContainer getProjectContainer()
          Sets the project container which is the subject of this view.
 void handleEvent(org.osgi.service.event.Event event)
          Handles a collaboration event; in fact it delivers the event to all pages.
 void init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento)
          Initializes this view.
protected  void pageChange(int newPageIndex)
          Notifies this multi-page view that the page with the given id has been activated.
 void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
          Closes all project files on project close.
 void setProjectContainer(ProjectContextContainer container)
          Sets the project container which is the subject of this view.
 void showRegisteredPage(java.lang.String pageName)
          Method shows registered special pages in the project container view.
 void showRepositoryTab(RepositoryDescriptor repository)
          Switches tab to one that displays a given repository.
 
Methods inherited from class org.eclipse.corona.internal.container.project.ui.MultiPageViewPart
addPage, addPage, addPage, addPage, clear, createPageContainer, createPartControl, createSite, getActivePage, getActiveViewer, getAdapter, getContainer, getControl, getPageCount, getPageImage, getPageText, getViewPart, handlePropertyChange, init, removePage, setActivePage, setControl, setFocus, setPageImage, setPageText, setPageToolTip
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 

Field Detail

PROJECT_CONTAINER_PAGE_EXTENSIONPOINT

public static final java.lang.String PROJECT_CONTAINER_PAGE_EXTENSIONPOINT
An identifier of the extension point.

See Also:
Constant Field Values
Constructor Detail

ProjectContainerView

public ProjectContainerView()
Creates a multi-page editor example.

Method Detail

setProjectContainer

public void setProjectContainer(ProjectContextContainer container)
Sets the project container which is the subject of this view.

Parameters:
container - The new project container.

getProjectContainer

public ProjectContextContainer getProjectContainer()
Sets the project container which is the subject of this view.

Returns:
The new project container. Might be null if the project container wasn't set.

init

public void init(org.eclipse.ui.IViewSite site,
                 org.eclipse.ui.IMemento memento)
          throws org.eclipse.ui.PartInitException
Initializes this view.

Specified by:
init in interface org.eclipse.ui.IViewPart
Overrides:
init in class org.eclipse.ui.part.ViewPart
Throws:
org.eclipse.ui.PartInitException
See Also:
ViewPart.init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)

createPages

protected void createPages()
Creates the pages of the multi-page viewer.

Specified by:
createPages in class org.eclipse.corona.internal.container.project.ui.MultiPageViewPart

dispose

public void dispose()
The MultiPageViewPart implementation of this IWorkbenchPart method disposes all nested editors. Subclasses may extend.

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.corona.internal.container.project.ui.MultiPageViewPart

pageChange

protected void pageChange(int newPageIndex)
Description copied from class: org.eclipse.corona.internal.container.project.ui.MultiPageViewPart
Notifies this multi-page view that the page with the given id has been activated. This method is called when the user selects a different tab.

The MultiPageViewPart implementation of this method sets focus to the new page, and notifies the action bar contributor (if there is one). This checks whether the action bar contributor is an instance of MultiPageEditorActionBarContributor, and, if so, calls setActivePage with the active nested editor. This also fires a selection change event if required.

Subclasses may extend this method.

Overrides:
pageChange in class org.eclipse.corona.internal.container.project.ui.MultiPageViewPart
Parameters:
newPageIndex - the index of the activated page

resourceChanged

public void resourceChanged(org.eclipse.core.resources.IResourceChangeEvent event)
Closes all project files on project close.

Specified by:
resourceChanged in interface org.eclipse.core.resources.IResourceChangeListener

handleEvent

public void handleEvent(org.osgi.service.event.Event event)
Handles a collaboration event; in fact it delivers the event to all pages.

Specified by:
handleEvent in interface org.osgi.service.event.EventHandler
Parameters:
event - The collaboration event to be handled.

showRegisteredPage

public void showRegisteredPage(java.lang.String pageName)
Method shows registered special pages in the project container view.

Parameters:
pageName - the id of registered page to be shown in the view.

showRepositoryTab

public void showRepositoryTab(RepositoryDescriptor repository)
Switches tab to one that displays a given repository. If tab was closed add it again and redisplay it.

Parameters:
repository - The repository to switch to.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.