org.scijava
Interface Contextual

All Known Subinterfaces:
App, AppEventService, AppService, ButtonWidget<U>, ChoiceWidget<U>, ColorWidget<U>, CommandService, ConsoleArgument, ConsoleService, Converter<I,O>, ConvertService, DateWidget<U>, Display<T>, DisplayService, DisplayViewer<T>, DragAndDropHandler<D>, DragAndDropService, EventHistory, EventService, FileWidget<U>, Gateway, HandlerPlugin<D>, HandlerService<DT,PT>, IconService, InputService, InputWidget<T,W>, IOPlugin<D>, IOService, LogService, MenuService, MessageWidget<U>, ModuleService, NumberWidget<U>, ObjectService, ObjectWidget<U>, OptionsService, PlatformService, PluginService, PostprocessorPlugin, PrefService, PreprocessorPlugin, PTService<PT>, RecentFileService, RichPlugin, SciJavaService, ScriptHeader, ScriptHeaderService, ScriptLanguage, ScriptService, Service, SingletonService<PT>, StatusService, TextDisplay, TextDisplayViewer, TextFormat, TextService, TextWidget<U>, ThreadService, ToggleWidget<U>, Tool, ToolService, TypedPlugin<D>, TypedService<DT,PT>, UIService, UserInterface, WelcomeService, WidgetService, WrapperPlugin<D>, WrapperService<DT,PT>
All Known Implementing Classes:
AbstractApp, AbstractConsoleArgument, AbstractContextual, AbstractConverter, AbstractConvertService, AbstractDisplay, AbstractDisplayViewer, AbstractDragAndDropData, AbstractDragAndDropHandler, AbstractGateway, AbstractHandlerPlugin, AbstractHandlerService, AbstractInputHarvester, AbstractInputHarvesterPlugin, AbstractInputWidget, AbstractIOPlugin, AbstractLogService, AbstractPostprocessorPlugin, AbstractPrefService, AbstractPreprocessorPlugin, AbstractPTService, AbstractRichPlugin, AbstractScriptHeader, AbstractScriptLanguage, AbstractService, AbstractSingletonService, AbstractTextDisplayViewer, AbstractTextFormat, AbstractTool, AbstractTypedPlugin, AbstractTypedService, AbstractUIInputWidget, AbstractUserInterface, AbstractWrapperPlugin, AbstractWrapperService, ActiveDisplayPreprocessor, AdaptedScriptLanguage, AppAboutEvent, AppFocusEvent, ApplicationEvent, AppMenusCreatedEvent, AppOpenFilesEvent, AppPreferencesEvent, AppPrintEvent, AppQuitEvent, AppReOpenEvent, AppScreenSleepEvent, AppSleepEvent, AppSystemSleepEvent, AppUserSessionEvent, AppVisibleEvent, CheckInputsPreprocessor, CommandModule, ContextCommand, ContextDisposingEvent, DataOpenedEvent, DataSavedEvent, DebugPostprocessor, DebugPreprocessor, DefaultAppEventService, DefaultAppService, DefaultCommandService, DefaultConsoleService, DefaultConverter, DefaultConvertService, DefaultDisplay, DefaultDisplayService, DefaultDragAndDropData, DefaultDragAndDropService, DefaultEventHistory, DefaultEventService, DefaultInputService, DefaultIOService, DefaultMenuService, DefaultModuleService, DefaultObjectService, DefaultOptionsService, DefaultPlatformService, DefaultPluginService, DefaultPrefService, DefaultRecentFileService, DefaultScriptHeaderService, DefaultScriptService, DefaultStatusService, DefaultTextDisplay, DefaultTextService, DefaultThreadService, DefaultToolService, DefaultUIService, DefaultWelcomeService, DefaultWidgetService, DisplayActivatedEvent, DisplayCreatedEvent, DisplayDeletedEvent, DisplayEvent, DisplayPostprocessor, DisplayUpdatedEvent, DragAndDropEvent, DragEnterEvent, DragExitEvent, DragOverEvent, DropEvent, DummyTool, DynamicCommand, FileDragAndDropHandler, FilePreprocessor, GatewayPreprocessor, InitPreprocessor, InputEvent, InteractiveCommand, IOEvent, KyEvent, KyPressedEvent, KyReleasedEvent, KyTypedEvent, ListDragAndDropHandler, ListEvent, LoadInputsPreprocessor, MenuEvent, MenusAddedEvent, MenusRemovedEvent, MenusUpdatedEvent, ModuleCanceledEvent, ModuleCommand, ModuleEvent, ModuleExecutedEvent, ModuleExecutingEvent, ModuleExecutionEvent, ModuleFinishedEvent, ModulePostprocessEvent, ModulePreprocessEvent, ModuleProcessEvent, ModuleRunner, ModulesAddedEvent, ModulesListEvent, ModulesRemovedEvent, ModuleStartedEvent, ModulesUpdatedEvent, MsButtonEvent, MsClickedEvent, MsDraggedEvent, MsEnteredEvent, MsEvent, MsExitedEvent, MsMovedEvent, MsPressedEvent, MsReleasedEvent, MsWheelEvent, NullConverter, ObjectCreatedEvent, ObjectDeletedEvent, ObjectEvent, ObjectModifiedEvent, ObjectsAddedEvent, ObjectsListEvent, ObjectsRemovedEvent, OpenArgument, OptionsEvent, OptionsPlugin, PluginsAddedEvent, PluginsListEvent, PluginsRemovedEvent, RunArgument, SaveInputsPreprocessor, SciJava, SciJavaApp, SciJavaEvent, ScriptFileDragAndDropHandler, ScriptFinder, ScriptInfo, ScriptIOPlugin, ScriptModule, ServiceHelper, ServicePreprocessor, ServicesLoadedEvent, ShadowMenu, SortablePlugin, StatusEvent, StderrLogService, TextIOPlugin, ToolActivatedEvent, ToolDeactivatedEvent, ToolEvent, UIArgument, UIEvent, UIPreprocessor, UIShownEvent, UnimplementedCommand, ValidityPreprocessor, WelcomeEvent, WidgetModel, WinActivatedEvent, WinClosedEvent, WinClosingEvent, WinDeactivatedEvent, WinDeiconifiedEvent, WinEvent, WinIconifiedEvent, WinOpenedEvent

public interface Contextual

An object that belongs to a SciJava application context.

Author:
Lee Kamentsky, Curtis Rueden

Method Summary
 Context context()
          Gets the application context to which the object belongs.
 Context getContext()
          Gets the application context to which the object belongs, or null if setContext(Context) has not yet been called on this object.
 void setContext(Context context)
          Sets the application context to which the object belongs.
 

Method Detail

context

Context context()
Gets the application context to which the object belongs.

Throws:
NullContextException - if the context has not yet been set via setContext(Context).
See Also:
getContext()

getContext

Context getContext()
Gets the application context to which the object belongs, or null if setContext(Context) has not yet been called on this object.

See Also:
context()

setContext

void setContext(Context context)
Sets the application context to which the object belongs.

Typically this method simply delegates to Context.inject(Object), and should be called only once to populate the context. Most contextual objects do not support later alteration of the context, and will throw IllegalStateException if this method is invoked again.

Throws:
IllegalStateException - If the object already has a context.
IllegalArgumentException - If the object has a required Service parameter (see Parameter.required()) which is not available from the context.
See Also:
Context.inject(Object), for an example of how to implement this interface


Copyright © 2009–2014 SciJava. All rights reserved.