Package org.eclipse.graphiti.ui.internal.services.impl

# Class WorkbenchService

java.lang.Object
org.eclipse.graphiti.ui.internal.services.impl.WorkbenchService

All Implemented Interfaces:
  `IWorkbenchService`

public class WorkbenchService extends Object implements IWorkbenchService

## Constructor Summary

Constructors
Constructor
Description
`WorkbenchService()`

## Method Summary

Modifier and Type
Method
Description
`org.eclipse.ui.IWorkbenchWindow`
`getActiveOrFirstWorkbenchWindow()`
`org.eclipse.jface.action.IStatusLineManager`
`getActiveStatusLineManager()`
Method returns the current `StatusLineManager`.
`org.eclipse.swt.widgets.Shell`
`getShell()`
Returns the shell of the active workbench window.
`IDiagramContainer`
`openDiagramEditor(Diagram diagram)`
Opens the given diagram in the diagram editor.
`IDiagramContainer`
`openDiagramEditor(Diagram diagram, String providerId)`
Opens the given diagram in the diagram editor.
`IDiagramContainer`
`openDiagramEditor(Diagram diagram, String providerId, String editorId)`
Opens the given diagram in the diagram editor with the given id.

### Methods inherited from class java.lang.Object

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

## Constructor Details

### WorkbenchService

public WorkbenchService()

## Method Details

### getActiveStatusLineManager

public org.eclipse.jface.action.IStatusLineManager getActiveStatusLineManager()
Description copied from interface: `IWorkbenchService`
Method returns the current `StatusLineManager`. If no StatusLineManager is available, a new StatusLineManager will be created and returned. In most cases this will not have any effect and will not be able to display status info, but it makes null pointer checks when calling the method obsolete

Specified by:
  `getActiveStatusLineManager` in interface `IWorkbenchService`
Returns:
  the status line manager of the active part or a new one if there is no such part

### getActiveOrFirstWorkbenchWindow

public org.eclipse.ui.IWorkbenchWindow getActiveOrFirstWorkbenchWindow()

Specified by:
  `getActiveOrFirstWorkbenchWindow` in interface `IWorkbenchService`
Returns:
  the active workbench window, or the first one if there is no active window

### openDiagramEditor

public IDiagramContainer openDiagramEditor(Diagram diagram)
Opens the given diagram in the diagram editor.

Specified by:
  `openDiagramEditor` in interface `IWorkbenchService`
Parameters:
  `diagram` - which should be opened
  `domain` -
Returns:
  the editor instance

### openDiagramEditor

public IDiagramContainer openDiagramEditor(Diagram diagram, String providerId)
Opens the given diagram in the diagram editor.

Specified by:
  `openDiagramEditor` in interface `IWorkbenchService`
Parameters:
  `diagram` - which should be opened
  `providerId` - the unique provider id of a diagram type provider which will be used by the editor.
  `domain` -
Returns:
  the editor instance

### openDiagramEditor

public IDiagramContainer openDiagramEditor(Diagram diagram, String providerId, String editorId)
Opens the given diagram in the diagram editor with the given id.

Specified by:
  `openDiagramEditor` in interface `IWorkbenchService`
Parameters:
  `diagram` - which should be opened
  `providerId` - the unique provider id of a diagram type provider which will be used by the editor.
  `editorId` - the unique Eclipse editor id of the diagram editor to open. This id must belong to a subclass of `IDiagramContainerUI` .
  `domain` -
Returns:
  the editor instance
Since:
  0.8.0

### getShell

public org.eclipse.swt.widgets.Shell getShell()
Description copied from interface: `IWorkbenchService`
Returns the shell of the active workbench window.

Specified by:
  `getShell` in interface `IWorkbenchService`
Returns:
  the shell