public class RefreshUtil extends Object
Modifier and Type | Field and 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 and Description |
---|
RefreshUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRefreshRecursive(ILaunchConfiguration configuration)
Returns whether the refresh scope specified by the given launch
configuration is recursive.
|
static void |
refreshResources(ILaunchConfiguration configuration,
IProgressMonitor monitor)
Refreshes the resources as specified by the given launch configuration via its
ATTR_REFRESH_SCOPE and ATTR_REFRESH_RECURSIVE attributes. |
static void |
refreshResources(IResource[] resources,
int depth,
IProgressMonitor monitor)
Refreshes the resources as specified by the given launch configuration.
|
static String |
toMemento(IResource[] resources)
Returns a memento for a collection of resources that can be restored
via
toResources(String) . |
static IResource[] |
toResources(String memento)
Returns a collection of resources referred to by the specified
memento generated via
toMemento(IResource[]) . |
public static final String ATTR_REFRESH_SCOPE
toMemento(IResource[])
, null
, indicating no
refresh.public static final String ATTR_REFRESH_RECURSIVE
true
. When a refresh is recursive, resources are
refreshed to an infinite depth, otherwise they are refreshed to a depth
of one.public static final String MEMENTO_SELECTED_PROJECT
toResources(String)
,
Constant Field Valuespublic static final String MEMENTO_SELECTED_CONTAINER
toResources(String)
,
Constant Field Valuespublic static final String MEMENTO_SELECTED_RESOURCE
toResources(String)
,
Constant Field Valuespublic static final String MEMENTO_WORKSPACE
toResources(String)
,
Constant Field Valuespublic static void refreshResources(IResource[] resources, int depth, IProgressMonitor monitor) throws CoreException
resources
- resources to refreshdepth
- one of IResource.DEPTH_INFINITE
, IResource.DEPTH_ONE
,
or IResource.DEPTH_ZERO
monitor
- progress monitor which may be null
CoreException
- if an exception occurs while refreshing resourcespublic static IResource[] toResources(String memento) throws CoreException
toMemento(IResource[])
.memento
- resource memento generated by this managerCoreException
- if unable to resolve a set of resourcespublic static String toMemento(IResource[] resources)
toResources(String)
.resources
- resources to create a memento forpublic static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException
configuration
- the ILaunchConfiguration
CoreException
- if unable to access the associated attributepublic static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException
ATTR_REFRESH_SCOPE
and ATTR_REFRESH_RECURSIVE
attributes.configuration
- launch configurationmonitor
- progress monitor which may be null
CoreException
- if an exception occurs while refreshing resources or accessing launch
configuration attributes
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.