org.eclipse.debug.ui.actions

## Class ImportBreakpointsOperation

- java.lang.Object
- - org.eclipse.debug.ui.actions.ImportBreakpointsOperation

All Implemented Interfaces:
  IRunnableWithProgress

    public class ImportBreakpointsOperation
    extends Object
    implements IRunnableWithProgress

Imports breakpoints from a file or string buffer into the workspace.

This class may be instantiated.

Since:
  3.2
Restriction:
  This class is not intended to be subclassed by clients.

### Constructor Summary

Constructors
Constructor and Description
`ImportBreakpointsOperation(String fileName, boolean overwrite, boolean createWorkingSets)` Constructs an operation to import breakpoints.
`ImportBreakpointsOperation(String fileName, boolean overwrite, boolean createWorkingSets, boolean importBreakpoints)` Constructs an operation to import breakpoints.
`ImportBreakpointsOperation(StringBuffer buffer, boolean overwrite, boolean createWorkingSets)` Constructs an operation to import breakpoints from a string buffer.
`ImportBreakpointsOperation(StringBuffer buffer, boolean overwrite, boolean createWorkingSets, boolean importBreakpoints)` Constructs an operation to import breakpoints from a string buffer.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected Map<String,Object>` `collectBreakpointProperties(IMemento memento)` Collects all of the properties for a breakpoint from the memento describing it.
`protected IMarker` `findExistingMarker(Map<String,Object> attributes, IBreakpointImportParticipant[] participants)` Returns a marker backing an existing breakpoint based on the given set of breakpoint attributes
`IBreakpoint[]` `getImportedBreakpoints()` Returns the breakpoints that were imported by this operation, possibly an empty list.
`protected void` `restoreBreakpoint(IMarker marker, Map<String,Object> attributes, IBreakpointImportParticipant[] participants)` restores all of the attributes back into the given marker, recreates the breakpoint in the breakpoint manager, and optionally recreates any working set(s) the breakpoint belongs to.
`void` `run(IProgressMonitor monitor)` Runs this operation.

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

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

### Constructor Detail

#### ImportBreakpointsOperation

    public ImportBreakpointsOperation(String fileName,
                                      boolean overwrite,
                                      boolean createWorkingSets)

Constructs an operation to import breakpoints.

Parameters:
  `fileName` - the file to read breakpoints from - the file should have been created from an export operation
  `overwrite` - whether imported breakpoints will overwrite existing equivalent breakpoints
  `createWorkingSets` - whether breakpoint working sets should be created. Breakpoints are exported with information about the breakpoint working sets they belong to. Those working sets can be optionally re-created on import if they do not already exist in the workspace.

#### ImportBreakpointsOperation

    public ImportBreakpointsOperation(String fileName,
                                      boolean overwrite,
                                      boolean createWorkingSets,
                                      boolean importBreakpoints)

Constructs an operation to import breakpoints.

Parameters:
  `fileName` - the file to read breakpoints from - the file should have been created from an export operation
  `overwrite` - whether imported breakpoints will overwrite existing equivalent breakpoints
  `createWorkingSets` - whether breakpoint working sets should be created. Breakpoints are exported with information about the breakpoint working sets they belong to. Those working sets can be optionally re-created on import if they do not already exist in the workspace.
  `importBreakpoints` - whether breakpoints should be imported and registered
Since:
  3.9

#### ImportBreakpointsOperation

    public ImportBreakpointsOperation(StringBuffer buffer,
                                      boolean overwrite,
                                      boolean createWorkingSets)

Constructs an operation to import breakpoints from a string buffer. The buffer must contain a memento created an `ExportBreakpointsOperation`.

Parameters:
  `buffer` - the string buffer to read breakpoints from - the file should have been created from an export operation
  `overwrite` - whether imported breakpoints will overwrite existing equivalent breakpoints
  `createWorkingSets` - whether breakpoint working sets should be created. Breakpoints are exported with information about the breakpoint working sets they belong to. Those working sets can be optionally re-created on import if they do not already exist in the workspace.
Since:
  3.5

#### ImportBreakpointsOperation

    public ImportBreakpointsOperation(StringBuffer buffer,
                                      boolean overwrite,
                                      boolean createWorkingSets,
                                      boolean importBreakpoints)

Constructs an operation to import breakpoints from a string buffer. The buffer must contain a memento created an `ExportBreakpointsOperation`.

Parameters:
  `buffer` - the string buffer to read breakpoints from - the file should have been created from an export operation
  `overwrite` - whether imported breakpoints will overwrite existing equivalent breakpoints
  `createWorkingSets` - whether breakpoint working sets should be created. Breakpoints are exported with information about the breakpoint working sets they belong to. Those working sets can be optionally re-created on import if they do not already exist in the workspace.
  `importBreakpoints` - whether breakpoints should be imported and registered
Since:
  3.9

### Method Detail

#### run

    public void run(IProgressMonitor monitor)
             throws InvocationTargetException

Description copied from interface: `IRunnableWithProgress`
Runs this operation. Progress should be reported to the given progress monitor. This method is usually invoked by an `IRunnableContext`'s `run` method, which supplies the progress monitor. A request to cancel the operation should be honored and acknowledged by throwing `InterruptedException`.

Specified by:
  `run` in interface `IRunnableWithProgress`
Parameters:
  `monitor` - the progress monitor to use to display progress and receive requests for cancelation
Throws:
  `InvocationTargetException` - if the run method must propagate a checked exception, it should wrap it inside an `InvocationTargetException`; runtime exceptions are automatically wrapped in an `InvocationTargetException` by the calling context
See Also:
  `IRunnableContext.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)`

#### findExistingMarker

    protected IMarker findExistingMarker(Map<String,Object> attributes,
                                         IBreakpointImportParticipant[] participants)

Returns a marker backing an existing breakpoint based on the given set of breakpoint attributes

Parameters:
  `attributes` - the map of attributes to compare for marker equality
  `participants` - the list of participants to ask if a breakpoint matches the given map of attributes
Returns:
  the marker for an existing breakpoint or `null` if one could not be located
Since:
  3.5

#### collectBreakpointProperties

    protected Map<String,Object> collectBreakpointProperties(IMemento memento)

Collects all of the properties for a breakpoint from the memento describing it. The values in the map will be one of:

- `String`
- `Integer`
- `Boolean`

Parameters:
  `memento` - the memento to read breakpoint attributes from
Returns:
  a new map of all of the breakpoint attributes from the given memento.
Since:
  3.5

#### restoreBreakpoint

    protected void restoreBreakpoint(IMarker marker,
                                     Map<String,Object> attributes,
                                     IBreakpointImportParticipant[] participants)

restores all of the attributes back into the given marker, recreates the breakpoint in the breakpoint manager, and optionally recreates any working set(s) the breakpoint belongs to.

Parameters:
  `marker` - the marker to create the new breakpoint on
  `attributes` - the attributes to set in the new breakpoint
  `participants` - the list of participants used to verify the restored breakpoint
Since:
  3.5

#### getImportedBreakpoints

    public IBreakpoint[] getImportedBreakpoints()

Returns the breakpoints that were imported by this operation, possibly an empty list.

Returns:
  breakpoints imported by this operation
Since:
  3.5