Interface IRepositoryService
public interface IRepositoryService
Global service to register user scripts and to query for registered scripts. To get the service instance use
final IRepositoryService repositoryService = (IRepositoryService) PlatformUI.getWorkbench().getService(IRepositoryService.class);
-
Field Summary
Fields Modifier and Type Field Description static StringBROKER_CHANNEL_SCRIPT_KEYWORDSChannel to promote all keyword changes from user scripts.static StringBROKER_CHANNEL_SCRIPTS_BASEBase channel for all script events.static StringBROKER_CHANNEL_SCRIPTS_NEWChannel to promote new detected user scripts.static StringBROKER_CHANNEL_SCRIPTS_REMOVEDChannel to promote when user scripts are removed.static StringBROKER_CHANNEL_SCRIPTS_RUNChannel to promote script executions on.static booleanTRACE_REPOSITORY_SERVICETrace enablement for the repository service. -
Method Summary
Modifier and Type Method Description voidaddLocation(String locationURI, boolean defaultLocation, boolean recursive)Add a new script location to the repository.Collection<IScriptLocation>getLocations()Get all script locations currently registered.IScriptgetScript(String name)Get a script by providing its full name.Collection<IScript>getScripts()Get all scripts registered with this service.voidremoveLocation(String locationURI)Remove a give location from the repository.voidupdate(boolean force)Trigger an immediate refresh of all script sources and contained scripts.voidupdateLocation(IScriptLocation location, String scriptURI, long lastChanged)
-
Field Details
-
BROKER_CHANNEL_SCRIPTS_BASE
Base channel for all script events.- See Also:
- Constant Field Values
-
BROKER_CHANNEL_SCRIPTS_NEW
Channel to promote new detected user scripts.- See Also:
- Constant Field Values
-
BROKER_CHANNEL_SCRIPTS_RUN
Channel to promote script executions on.- See Also:
- Constant Field Values
-
BROKER_CHANNEL_SCRIPTS_REMOVED
Channel to promote when user scripts are removed.- See Also:
- Constant Field Values
-
BROKER_CHANNEL_SCRIPT_KEYWORDS
Channel to promote all keyword changes from user scripts.- See Also:
- Constant Field Values
-
TRACE_REPOSITORY_SERVICE
static final boolean TRACE_REPOSITORY_SERVICETrace enablement for the repository service.
-
-
Method Details
-
update
void update(boolean force)Trigger an immediate refresh of all script sources and contained scripts.- Parameters:
force- force the update when set totrue
-
updateLocation
-
getScripts
Collection<IScript> getScripts()Get all scripts registered with this service.- Returns:
- collection of scripts
-
getScript
Get a script by providing its full name.- Parameters:
name- full name of script (including path)- Returns:
- script instance
-
getLocations
Collection<IScriptLocation> getLocations()Get all script locations currently registered.- Returns:
- registered script locations
-
addLocation
Add a new script location to the repository. Takes care that the same location is not registered yet. If a location with the same URI is already registered, we update its flags (defaultLocation, recursive).- Parameters:
locationURI- location URI to registerdefaultLocation- set to true to be the default location for scriptsrecursive-trueto parse subfolders of location
-
removeLocation
Remove a give location from the repository. Removes the location and all scripts registered under that location.- Parameters:
locationURI- location URI to unregister
-