Package org.eclipse.debug.core
Class RefreshUtil
- java.lang.Object
-
- org.eclipse.debug.core.RefreshUtil
-
public class RefreshUtil extends Object
Utilities for launch configurations that persist, restore, and refresh collections of resources.- Since:
- 3.6
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_REFRESH_RECURSIVE
Boolean attribute indicating if a refresh scope is recursive.static String
ATTR_REFRESH_SCOPE
String attribute identifying a scope of resources that should be refreshed - for example, after an external tool is run.static String
MEMENTO_SELECTED_CONTAINER
Resource memento referring to the selected resource's container.static String
MEMENTO_SELECTED_PROJECT
Resource memento referring to the selected resource's project.static String
MEMENTO_SELECTED_RESOURCE
Resource memento referring to the selected resource.static String
MEMENTO_WORKSPACE
Resource memento referring to the workspace root.
-
Constructor Summary
Constructors Constructor Description RefreshUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isRefreshRecursive(ILaunchConfiguration configuration)
Returns whether the refresh scope specified by the given launch configuration is recursive.static void
refreshResources(IResource[] resources, int depth, IProgressMonitor monitor)
Refreshes the resources as specified by the given launch configuration.static void
refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor)
Refreshes the resources as specified by the given launch configuration via itsATTR_REFRESH_SCOPE
andATTR_REFRESH_RECURSIVE
attributes.static String
toMemento(IResource[] resources)
Returns a memento for a collection of resources that can be restored viatoResources(String)
.static IResource[]
toResources(String memento)
Returns a collection of resources referred to by the specified memento generated viatoMemento(IResource[])
.
-
-
-
Field Detail
-
ATTR_REFRESH_SCOPE
public static final String ATTR_REFRESH_SCOPE
String attribute identifying a scope of resources that should be refreshed - for example, after an external tool is run. The value is either a resource memento constant by this class, a resource memento created viatoMemento(IResource[])
,null
, indicating no refresh.
-
ATTR_REFRESH_RECURSIVE
public static final String ATTR_REFRESH_RECURSIVE
Boolean attribute indicating if a refresh scope is recursive. Default value istrue
. When a refresh is recursive, resources are refreshed to an infinite depth, otherwise they are refreshed to a depth of one.
-
MEMENTO_SELECTED_PROJECT
public static final String MEMENTO_SELECTED_PROJECT
Resource memento referring to the selected resource's project. Only works when the debug user interface is running.- See Also:
toResources(String)
, Constant Field Values
-
MEMENTO_SELECTED_CONTAINER
public static final String MEMENTO_SELECTED_CONTAINER
Resource memento referring to the selected resource's container. Only works when the debug user interface is running.- See Also:
toResources(String)
, Constant Field Values
-
MEMENTO_SELECTED_RESOURCE
public static final String MEMENTO_SELECTED_RESOURCE
Resource memento referring to the selected resource. Only works when the debug user interface is running.- See Also:
toResources(String)
, Constant Field Values
-
MEMENTO_WORKSPACE
public static final String MEMENTO_WORKSPACE
Resource memento referring to the workspace root.- See Also:
toResources(String)
, Constant Field Values
-
-
Method Detail
-
refreshResources
public static void refreshResources(IResource[] resources, int depth, IProgressMonitor monitor) throws CoreException
Refreshes the resources as specified by the given launch configuration.- Parameters:
resources
- resources to refreshdepth
- one ofIResource.DEPTH_INFINITE
,IResource.DEPTH_ONE
, orIResource.DEPTH_ZERO
monitor
- progress monitor which may benull
- Throws:
CoreException
- if an exception occurs while refreshing resources
-
toResources
public static IResource[] toResources(String memento) throws CoreException
Returns a collection of resources referred to by the specified memento generated viatoMemento(IResource[])
.- Parameters:
memento
- resource memento generated by this manager- Returns:
- collection of resources referred to by the memento
- Throws:
CoreException
- if unable to resolve a set of resources
-
toMemento
public static String toMemento(IResource[] resources)
Returns a memento for a collection of resources that can be restored viatoResources(String)
.- Parameters:
resources
- resources to create a memento for- Returns:
- memento for the given resources
-
isRefreshRecursive
public static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException
Returns whether the refresh scope specified by the given launch configuration is recursive.- Parameters:
configuration
- theILaunchConfiguration
- Returns:
- whether the refresh scope is recursive
- Throws:
CoreException
- if unable to access the associated attribute
-
refreshResources
public static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException
Refreshes the resources as specified by the given launch configuration via itsATTR_REFRESH_SCOPE
andATTR_REFRESH_RECURSIVE
attributes.- Parameters:
configuration
- launch configurationmonitor
- progress monitor which may benull
- Throws:
CoreException
- if an exception occurs while refreshing resources or accessing launch configuration attributes
-
-