org.eclipse.actf.model.ui.util

## Class ModelServiceUtils

- java.lang.Object
- - org.eclipse.actf.model.ui.util.ModelServiceUtils

    public class ModelServiceUtils
    extends Object

Utility class to manage ACTF model services (implementation of `IModelService`)

### Constructor Summary

Constructors
Constructor and Description
`ModelServiceUtils()`

### Method Summary

Methods
`static boolean` `activateEditorPart(String id)` Activate `IEditorPart`
`static IModelService` `getActiveModelService()` Get `IModelService` from the current active `IEditorPart`
`static IModelServiceHolder` `getActiveModelServiceHolder()` Get `IModelServiceHolder` from the current active `IEditorPart`
`static org.eclipse.ui.IEditorPart` `launch(String targetUrl)` Find and launch an Editor associated with the target URL
`static org.eclipse.ui.IEditorPart` `launch(String targetUrl, String id)` Launch an Editor
`static org.eclipse.ui.IEditorPart` `launchNew(String targetUrl)` Find and launch a new Editor associated with the target URL
`static org.eclipse.ui.IEditorPart` `launchNew(String targetUrl, String id)` Launch a new Editor
`static void` `openInExistingEditor(String targetUrl)` Try to open the target URL in existing `IEditorPart`.
`static org.eclipse.ui.IEditorPart` `reopenInACTFBrowser()` Try to open the same URL of the current active WebBrowserEditor by the ACTF Browser.

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

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

### Constructor Detail

#### ModelServiceUtils

    public ModelServiceUtils()

### Method Detail

#### launch

    public static org.eclipse.ui.IEditorPart launch(String targetUrl)

Find and launch an Editor associated with the target URL

Parameters:
  `targetUrl` - target URL
Returns:
  `IEditorPart` implements `IModelServiceHolder`, or null if not available

#### launchNew

    public static org.eclipse.ui.IEditorPart launchNew(String targetUrl)

Find and launch a new Editor associated with the target URL

Parameters:
  `targetUrl` - target URL
Returns:
  `IEditorPart` implements `IModelServiceHolder`, or null if not available

#### launch

    public static org.eclipse.ui.IEditorPart launch(String targetUrl,
                                    String id)

Launch an Editor

Parameters:
  `targetUrl` - target URL
  `id` - ID of target Editor
Returns:
  `IEditorPart`, or null if not available

#### launchNew

    public static org.eclipse.ui.IEditorPart launchNew(String targetUrl,
                                       String id)

Launch a new Editor

Parameters:
  `targetUrl` - target URL
  `id` - ID of target Editor
Returns:
  `IEditorPart`, or null if not available

#### openInExistingEditor

    public static void openInExistingEditor(String targetUrl)

Try to open the target URL in existing `IEditorPart`. If appropriate Editor is not available, launch new `IEditorPart`.

Parameters:
  `targetUrl` - target URL

#### activateEditorPart

    public static boolean activateEditorPart(String id)

Activate `IEditorPart`

Parameters:
  `id` - ID of target `IEditorPart`
Returns:
  true if activation is successfully finished

#### getActiveModelServiceHolder

    public static IModelServiceHolder getActiveModelServiceHolder()

Get `IModelServiceHolder` from the current active `IEditorPart`

Returns:
  active `IModelServiceHolder`

#### getActiveModelService

    public static IModelService getActiveModelService()

Get `IModelService` from the current active `IEditorPart`

Returns:
  active `IModelService`

#### reopenInACTFBrowser

    public static org.eclipse.ui.IEditorPart reopenInACTFBrowser()

Try to open the same URL of the current active WebBrowserEditor by the ACTF Browser.

Returns:
  `IEditorPart` implements `IModelServiceHolder`, or null if not available