# Class SameShellProvider

java.lang.Object
org.eclipse.jface.window.SameShellProvider

All Implemented Interfaces:
  `IShellProvider`

public class SameShellProvider extends Object implements IShellProvider
Standard shell provider that always returns the shell containing the given control. This will always return the correct shell for the control, even if the control is reparented.

Since:
  3.1

## Constructor Summary

Constructors
Constructor
Description
`SameShellProvider(Control targetControl)`
Returns a shell provider that always returns the current shell for the given control.

## Method Summary

Modifier and Type
Method
Description
`Shell`
`getShell()`
Returns the current shell (or null if none).

### Methods inherited from class Object

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

## Constructor Details

### SameShellProvider

public SameShellProvider(Control targetControl)
Returns a shell provider that always returns the current shell for the given control.

Parameters:
  `targetControl` - control whose shell will be tracked, or null if getShell() should always return null

## Method Details

### getShell

public Shell getShell()
Description copied from interface: `IShellProvider`
Returns the current shell (or null if none). This return value may change over time, and should not be cached.

Specified by:
  `getShell` in interface `IShellProvider`
Returns:
  the current shell or null if none