org.scijava.platform
Class DefaultPlatformService
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.plugin.AbstractPTService<PT>
org.scijava.plugin.AbstractSingletonService<Platform>
org.scijava.platform.DefaultPlatformService
- All Implemented Interfaces:
- Comparable<Prioritized>, Contextual, Disposable, PlatformService, HasPluginInfo, PTService<Platform>, RichPlugin, SciJavaPlugin, SingletonService<Platform>, Prioritized, SciJavaService, Service
public final class DefaultPlatformService
- extends AbstractSingletonService<Platform>
- implements PlatformService
Default service for handling platform-specific deployment issues.
- Author:
- Curtis Rueden
DefaultPlatformService
public DefaultPlatformService()
getEventService
public EventService getEventService()
- Specified by:
getEventService
in interface PlatformService
getCommandService
public CommandService getCommandService()
- Specified by:
getCommandService
in interface PlatformService
getAppEventService
public AppEventService getAppEventService()
- Specified by:
getAppEventService
in interface PlatformService
getTargetPlatforms
public List<Platform> getTargetPlatforms()
- Description copied from interface:
PlatformService
- Gets the platform handlers applicable to this platform.
- Specified by:
getTargetPlatforms
in interface PlatformService
open
public void open(URL url)
throws IOException
- Description copied from interface:
PlatformService
- Opens a URL in a platform-dependent way. Typically the URL is opened in an
external web browser instance, but the behavior is ultimately defined by
the available platform handler implementations.
- Specified by:
open
in interface PlatformService
- Throws:
IOException
exec
public int exec(String... args)
throws IOException
- Description copied from interface:
PlatformService
- Executes a native program and waits for it to return.
- Specified by:
exec
in interface PlatformService
- Returns:
- the exit code of the execution.
- Throws:
IOException
registerAppMenus
public boolean registerAppMenus(Object menus)
- Description copied from interface:
PlatformService
- Informs the active platform handlers of a UI's newly created application
menu structure. Each active platform handler may choose to do something
platform-specific with the menus.
- Specified by:
registerAppMenus
in interface PlatformService
- Parameters:
menus
- The UI's newly created menu structure
- Returns:
- true iff the menus should not be added to the UI as normal because
a platform handler did something platform-specific with them
instead.
filterInstances
public List<? extends Platform> filterInstances(List<Platform> list)
- Description copied from class:
AbstractSingletonService
- Allows subclasses to exclude instances.
- Overrides:
filterInstances
in class AbstractSingletonService<Platform>
- Parameters:
list
- the initial list of instances
- Returns:
- the filtered list of instances
getPluginType
public Class<Platform> getPluginType()
- Description copied from interface:
PTService
- Gets the type of plugins managed by this service.
- Specified by:
getPluginType
in interface PTService<Platform>
initialize
public void initialize()
- Description copied from interface:
Service
- Performs any needed initialization when the service is first loaded.
NB: This method is not intended to be called directly. It is called by
the service framework itself (specifically by the ServiceHelper
)
when initializing the service. It should not be called a second time.
- Specified by:
initialize
in interface Service
- Overrides:
initialize
in class AbstractSingletonService<Platform>
dispose
public void dispose()
- Description copied from interface:
Disposable
- Performs any needed cleanup of the object's services, in preparation for
the object being retired (e.g., to make garbage collection possible).
- Specified by:
dispose
in interface Disposable
- Overrides:
dispose
in class AbstractService
onEvent
protected void onEvent(AppMenusCreatedEvent event)
Copyright © 2009–2014 SciJava. All rights reserved.