org.eclipse.ease.modules.platform

## Class UIModelManipulator

- java.lang.Object
- - org.eclipse.ease.modules.platform.UIModelManipulator

    public class UIModelManipulator
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`UIModelManipulator()`

### Method Summary

All Methods Static Methods Concrete Methods
`static MUIElement` `findElement(java.lang.String id)` Find the UI element for a given id.
`static MPerspective` `getCurrentPerspective()` Get the currently active perspective.
`static java.lang.String` `getIDForName(java.lang.String name)` Find ID for a given view name.
`static void` `move(MUIElement uiElement, MElementContainer<MUIElement> targetContainer)` Move a UI element to another container.
`static void` `reconcileContainer(MElementContainer<MUIElement> container)` Remove empty containers if there are any.
`static MPartSashContainer` `splitPartStack(MElementContainer<MUIElement> stack, int position)` Split a given `MPartStack`.

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

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

### Constructor Detail

#### UIModelManipulator

    public UIModelManipulator()

### Method Detail

#### getIDForName

    public static java.lang.String getIDForName(java.lang.String name)

Find ID for a given view name. If name already contains a valid id, it will be returned.

Parameters:
  `name` - name of view
Returns:
  view ID or `null`

#### findElement

    public static MUIElement findElement(java.lang.String id)

Find the UI element for a given id.

Parameters:
  `id` - id to look for
Returns:
  UI element instance or `null`

#### getCurrentPerspective

    public static MPerspective getCurrentPerspective()

Get the currently active perspective.

Returns:
  active perspective instance

#### splitPartStack

    public static MPartSashContainer splitPartStack(MElementContainer<MUIElement> stack,
                                                    int position)

Split a given `MPartStack`. Effectively we replace the part stack with a sash container and put the old part stack into the sash container.

Parameters:
  `stack` - stack to split
  `position` - where to put the existing stack within the sash. One of `SWT.TOP`, `SWT.BOTTOM`, `SWT.LEFT`, `SWT.RIGHT`
Returns:
  newly created sash container

#### move

    public static void move(MUIElement uiElement,
                            MElementContainer<MUIElement> targetContainer)

Move a UI element to another container.

Parameters:
  `uiElement` - element to move
  `targetContainer` - target container to move to

#### reconcileContainer

    public static void reconcileContainer(MElementContainer<MUIElement> container)

Remove empty containers if there are any.

Parameters:
  `container` - container to reconcile