Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.ui.part
Class IntroPart

java.lang.Object
  extended byorg.eclipse.ui.part.IntroPart

All Implemented Interfaces:
IAdaptable, IExecutableExtension, IIntroPart

Direct Known Subclasses:
CustomizableIntroPart


public abstract class IntroPart
extends Object
implements IIntroPart, IExecutableExtension

Abstract base implementation of an intro part.

Subclasses must implement the following methods:

Subclasses may extend or reimplement the following methods as required:

Since:
3.0


Field Summary
 
Fields inherited from interface org.eclipse.ui.intro.IIntroPart
PROP_TITLE
 
Constructor Summary
protected IntroPart()
          Creates a new intro part.
 
Method Summary
 void addPropertyListener(IPropertyListener l)
          Adds a listener for changes to properties of this intro part.
abstract  void createPartControl(Composite parent)
          Creates the SWT controls for this intro part.
 void dispose()
          The IntroPart implementation of this IIntroPart method disposes the title image loaded by setInitializationData.
protected  void firePropertyChange(int propertyId)
          Fires a property changed event.
 Object getAdapter(Class adapter)
          This implementation of the method declared by IAdaptable passes the request along to the platform's adapter manager; roughly Platform.getAdapterManager().getAdapter(this, adapter).
protected  IConfigurationElement getConfigurationElement()
          Returns the configuration element for this part.
protected  Image getDefaultImage()
          Returns the default title image.
 IIntroSite getIntroSite()
          Returns the site for this intro part.
 Image getTitleImage()
          Returns the title image of this intro part.
 void init(IIntroSite site, IMemento memento)
          The base implementation of this IIntroPartmethod ignores the memento and initializes the part in a fresh state.
 void removePropertyListener(IPropertyListener l)
          Removes the given property listener from this intro part.
 void saveState(IMemento memento)
          The base implementation of this IIntroPart method does nothing.
abstract  void setFocus()
          Asks this part to take focus within the workbench.
 void setInitializationData(IConfigurationElement cfig, String propertyName, Object data)
          The IntroPart implementation of this IExecutableExtension records the configuration element in and internal state variable (accessible via getConfigElement).
protected  void setSite(IIntroSite site)
          Sets the part site.
protected  void setTitleImage(Image titleImage)
          Sets or clears the title image of this part.
 
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.intro.IIntroPart
standbyStateChanged
 

Constructor Detail

 

 

IntroPart

protected IntroPart()

Creates a new intro part.

Method Detail

 

 

addPropertyListener

public void addPropertyListener(IPropertyListener l)

Description copied from interface: IIntroPart
Adds a listener for changes to properties of this intro part. Has no effect if an identical listener is already registered.

The properties ids are as follows:

Specified by:
addPropertyListener in interface IIntroPart

Parameters:
l - a property listener


 

 

createPartControl

public abstract void createPartControl(Composite parent)

Description copied from interface: IIntroPart
Creates the SWT controls for this intro part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the IActionService.
  4. Register any popup menus with the IActionService.
  5. Register a selection provider with the ISelectionService (optional).

Specified by:
createPartControl in interface IIntroPart

Parameters:
parent - the parent control


 

 

dispose

public void dispose()

The IntroPart implementation of this IIntroPart method disposes the title image loaded by setInitializationData. Subclasses may extend.

Specified by:
dispose in interface IIntroPart


 

 

firePropertyChange

protected void firePropertyChange(int propertyId)

Fires a property changed event.

Parameters:
propertyId - the id of the property that changed


 

 

getAdapter

public Object getAdapter(Class adapter)

This implementation of the method declared by IAdaptable passes the request along to the platform's adapter manager; roughly Platform.getAdapterManager().getAdapter(this, adapter). Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).

Specified by:
getAdapter in interface IAdaptable

Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class


 

 

getConfigurationElement

protected IConfigurationElement getConfigurationElement()

Returns the configuration element for this part. The configuration element comes from the plug-in registry entry for the extension defining this part.

Returns:
the configuration element for this part


 

 

getDefaultImage

protected Image getDefaultImage()

Returns the default title image.

Returns:
the default image


 

 

getIntroSite

public final IIntroSite getIntroSite()

Description copied from interface: IIntroPart
Returns the site for this intro part.

Specified by:
getIntroSite in interface IIntroPart

Returns:
the intro site


 

 

getTitleImage

public Image getTitleImage()

Description copied from interface: IIntroPart
Returns the title image of this intro part. If this value changes the part must fire a property listener event with IIntroPart.PROP_TITLE.

The title image is usually used to populate the title bar of this part's visual container. Since this image is managed by the part itself, callers must not dispose the returned image.

Specified by:
getTitleImage in interface IIntroPart

Returns:
the title image


 

 

init

public void init(IIntroSite site,
                 IMemento memento)
          throws PartInitException

The base implementation of this IIntroPartmethod ignores the memento and initializes the part in a fresh state. Subclasses may extend to perform any state restoration, but must call the super method.

Specified by:
init in interface IIntroPart

Parameters:
site - the intro site
memento - the intro part state or null if there is no previous saved state
Throws:
PartInitException - if this part was not initialized successfully


 

 

setSite

protected void setSite(IIntroSite site)

Sets the part site.

Subclasses must invoke this method from IIntroPart.init(IIntroSite, IMemento).

Parameters:
site - the intro part site


 

 

removePropertyListener

public void removePropertyListener(IPropertyListener l)

Description copied from interface: IIntroPart
Removes the given property listener from this intro part. Has no affect if an identical listener is not registered.

Specified by:
removePropertyListener in interface IIntroPart

Parameters:
l - a property listener


 

 

saveState

public void saveState(IMemento memento)

The base implementation of this IIntroPart method does nothing. Subclasses may override.

Specified by:
saveState in interface IIntroPart

Parameters:
memento - a memento to receive the object state


 

 

setFocus

public abstract void setFocus()

Description copied from interface: IIntroPart
Asks this part to take focus within the workbench.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IIntroManager.showIntro(IWorkbenchWindow, boolean).

Specified by:
setFocus in interface IIntroPart


 

 

setInitializationData

public void setInitializationData(IConfigurationElement cfig,
                                  String propertyName,
                                  Object data)

The IntroPart implementation of this IExecutableExtension records the configuration element in and internal state variable (accessible via getConfigElement). It also loads the title image, if one is specified in the configuration element. Subclasses may extend. Should not be called by clients. It is called by the core plugin when creating this executable extension.

Specified by:
setInitializationData in interface IExecutableExtension

Parameters:
cfig - the configuration element used to trigger this execution. It can be queried by the executable extension for specific configuration properties
propertyName - the name of an attribute of the configuration element used on the createExecutableExtension(String) call. This argument can be used in the cases where a single configuration element is used to define multiple executable extensions.
data - adapter data in the form of a String, a Hashtable, or null.
See Also:
IConfigurationElement.createExecutableExtension(String)


 

 

setTitleImage

protected void setTitleImage(Image titleImage)

Sets or clears the title image of this part.

Parameters:
titleImage - the title image, or null to clear


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.