# Class E4PartWrapper

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
org.eclipse.ui.internal.E4PartWrapper

All Implemented Interfaces:
  `IAdaptable, IExecutableExtension, IPersistable, IViewPart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation`

public class E4PartWrapper extends ViewPart

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`E4_WRAPPER_KEY`

### Fields inherited from interface IWorkbenchPart

`PROP_TITLE`

## Method Summary

Modifier and Type
Method
Description
`void`
`createPartControl(Composite parent)`
Creates the SWT controls for this workbench part.
`<T> T`
`getAdapter(Class<T> adapter)`
Returns an object which is an instance of the given class associated with this object.
`static E4PartWrapper`
`getE4PartWrapper(MPart part)`
`void`
`notifyPartDirtyStatus()`
`void`
`setFocus()`
Asks this part to take focus within the workbench.

### Methods inherited from class ViewPart

`checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName`

### Methods inherited from class WorkbenchPart

`addPartPropertyListener, addPropertyListener, dispose, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy`

### Methods inherited from class EventManager

`addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface IWorkbenchPart

`addPropertyListener, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener`

## Field Details

### E4_WRAPPER_KEY

public static final String E4_WRAPPER_KEY

See Also:
  - Constant Field Values

## Method Details

### getE4PartWrapper

public static E4PartWrapper getE4PartWrapper(MPart part)

### createPartControl

public void createPartControl(Composite parent)
Description copied from interface: `IWorkbenchPart`
Creates the SWT controls for this workbench 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 site's `IActionBars`.
4. Register any context menus with the site.
5. Register a selection provider with the site, to make it available to the workbench's `ISelectionService` (optional).

Specified by:
  `createPartControl` in interface `IWorkbenchPart`
Specified by:
  `createPartControl` in class `WorkbenchPart`
Parameters:
  `parent` - the parent control

### notifyPartDirtyStatus

public void notifyPartDirtyStatus()

### setFocus

public void setFocus()
Description copied from interface: `IWorkbenchPart`
Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use `IWorkbenchPage.activate(IWorkbenchPart) instead`.

Specified by:
  `setFocus` in interface `IWorkbenchPart`
Specified by:
  `setFocus` in class `WorkbenchPart`

### getAdapter

public <T> T getAdapter(Class<T> adapter)
Description copied from class: `WorkbenchPart`
Returns an object which is an instance of the given class associated with this object. Returns `null` if no such object can be found.

Clients may implement this method but should generally call `Adapters.adapt(Object, Class, boolean)` rather than invoking it directly. 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`
Overrides:
  `getAdapter` in class `WorkbenchPart`
Type Parameters:
  `T` - the class type
Parameters:
  `adapter` - the adapter class to look up
Returns:
  a object of the given class, or `null` if this object does not have an adapter for the given class