public abstract class Console
extends org.lsst.ccs.Subsystem
| Modifier and Type | Class and Description |
|---|---|
static interface |
Console.PropertyListener |
| Modifier | Constructor and Description |
|---|---|
protected |
Console() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addMenu(Action action,
String owner,
String... locations)
Adds an item to the graphical console menu bar.
|
abstract void |
addPreference(String[] path,
String group,
String format)
Adds a setter for one or more previously defined properties to the preferences menu.
|
abstract Object |
addProperty(String key,
Object defaultValue)
Defines a console property with the specified default value.
|
abstract void |
addPropertyListener(Console.PropertyListener listener,
String filter)
Registers a listener that will be notified of property changes.
|
void |
afterStart() |
abstract void |
error(String message)
Notifies the user of an application error.
|
abstract void |
error(String message,
Exception x)
Notifies the user of an application error.
|
static Console |
getConsole()
Returns the singleton instance of
Console. |
abstract org.freehep.util.FreeHEPLookup |
getConsoleLookup()
Returns a lookup instance that can be used objects registered by various
components of the graphical console.
|
abstract Path |
getHomeDirectory()
Returns the path to the graphical console home directory.
|
org.lsst.ccs.utilities.logging.Logger |
getLoggerUI()
Returns the default logger associated with the graphical console.
|
LsstOptionalPageService |
getOptionalPageService() |
abstract PanelManager |
getPanelManager()
Returns the instance of
PanelManager that can be used to create and manage GUI panels. |
abstract Object |
getProperty(String key)
Returns the value of the property with the specified key.
|
<T> T |
getSingleton(Class<T> clazz)
Returns a singleton instance of the specified type registered with this console.
|
AgentStatusAggregator |
getStatusAggregator()
Returns the status aggregator maintained by this console.
|
abstract Window |
getWindow()
Returns the root component for the main Graphical Console window.
|
abstract void |
insertStatusBarComponent(JComponent component,
int position) |
abstract void |
insertToolbarAction(Action action,
int position)
Inserts an action to the LSST CCS tool bar.
|
void |
preShutdown() |
void |
preStart() |
abstract boolean |
removeMenu(String... locations)
Removes the specified menu item and its descendents.
|
abstract Object |
removeProperty(String key)
Removes a console property.
|
abstract boolean |
removePropertyListener(Console.PropertyListener listener)
Removes the specified property listener.
|
abstract void |
removeStatusBarComponent(JComponent component) |
abstract void |
restore()
Restores console session from the default location.
|
abstract void |
restoreFrom()
Restores console session, prompting the user to specify location.
|
abstract void |
save()
Saves current session to the default location.
|
abstract void |
saveAs()
Saves current session, prompting the user to specify location.
|
abstract void |
setBlockInput(boolean blocked)
Blocks and unblocks mouse and key input to the console.
|
void |
setProperties(Map<String,Object> properties)
Sets values of a set of properties.
|
abstract Object |
setProperty(String key,
Object value)
Sets the value of the specified property.
|
abstract void |
setStatusMessage(String message)
Sets the message in the graphical console status bar.
|
int |
setStatusMessage(String message,
int id)
Sets the message in the graphical console status bar.
|
abstract void |
showInBrowser(String url)
Display the specified web site in a browser.
|
getLogHandler, getNumberCommandThreads, ping, printRunningCommands, setLogFormat, setLogHandlerLevel, setLogLevel, setStackTraceDepthcreateHelper, executeCommandRequest, getAgentInfo, getAgentPersistenceService, getAgentService, getAgentServices, getCommandCount, getComponentConfigurationEnvironment, getComponentConfigurationEnvironmentByName, getComponentLookup, getCurrentAction, getDescription, getEnvironmentLockService, getEnvironmentMessagingAccess, getLogger, getMessagingAccess, getName, getScheduler, helper, initAgent, initLogBusHandler, isInEngineeringMode, populateComponentLookup, preInit, printComponentNodeTree, publishSubsystemDataOnStatusBus, sendAck, sendNack, sendStatusMessage, setAgentName, shutdownAgent, shutdownAgent, startAgent, vetoTransitionToNormalModepublic void preStart()
preStart in interface org.lsst.ccs.ServiceLifecyclepreStart in class org.lsst.ccs.Agentpublic void afterStart()
public void preShutdown()
public static Console getConsole()
Console.
Implementation note: At the moment, this method returns an instance of
Jas3Console created when this class is loaded, breaking abstraction
from the Console implementation. This should be fixed once the freehep-application
framework initialization have been reworked to make them thread-safe and more flexible,
so that Jas3Console can be loaded as a service.
Console.public <T> T getSingleton(Class<T> clazz)
T - Type of the singleton.clazz - Class instance corresponding to the singleton type.null if it does not exist.public abstract org.freehep.util.FreeHEPLookup getConsoleLookup()
public abstract Window getWindow()
null
if the root component is not a Window.public org.lsst.ccs.utilities.logging.Logger getLoggerUI()
public abstract Path getHomeDirectory()
public abstract PanelManager getPanelManager()
PanelManager that can be used to create and manage GUI panels.public AgentStatusAggregator getStatusAggregator()
public abstract void error(String message)
message - Message to be displayed.public abstract void error(String message, Exception x)
message - Message to be displayed.x - Exception to be reported.public abstract void showInBrowser(String url)
url - URL of the site to be displayed.public abstract void setStatusMessage(String message)
setStatusMessage(String, int) method.message - The message to display; if null, the current message is cleared.public int setStatusMessage(String message, int id)
If a message is submitted with zero ID, it is displayed immediately, and this method returns its newly assigned ID. If a message is submitted with non-zero ID, it replaces any previous messages with the same ID, but it is only displayed if or when the message it replaces would be displayed. The message keeps the ID of the message it replaces.
Calling this method with message == null clears the set of messages
submitted with the same ID. If there is another set with a different ID that
has not been cleared, the latest message of that set will be displayed. If
this method is called with message == null and zero ID, all message sets are cleared.
Typically, this machinery is used when some graphical console component needs
to display a status message temporarily. It first calls this method with zero
ID to display the message, and then calls it with the ID returned by the first
call and null message to clear the status bar.
message - The message to display, or null to clear the status bar.id - The ID of the previously posted message this message should replace,
or zero if this message is not associated with any of the previous messages.public abstract void setBlockInput(boolean blocked)
blocked - true if input should be blocked.public LsstOptionalPageService getOptionalPageService()
public abstract Object addProperty(String key, Object defaultValue)
setProperty(String, Object) method.
Properties that have been modified from their default values are saved between the graphical console sessions.
If a property with the specified key already exists:
String but can be converted to the type of the newly specified
default value, the existing default value is retained but the type of object returned by subsequent calls to
getProperty(String) method is modified;
IllegalArgumentException is thrown;
getProperty(String) method, the type of the
returned object is determined by the type of the default value supplied when the property was defined.key - Property key. Can be used to retrieve the property value.defaultValue - Default value for the property.
Must be of type Boolean, Enum, Integer, Long, Double, String,
or an array containing objects of these types.IllegalArgumentException - If the specified key already exists, and its default value is incompatible with defaultValue;
if either key or defaultValue is null;
if the type of defaultValue is not supported.public abstract Object removeProperty(String key)
key - Property key.null if there was no such property.public abstract Object getProperty(String key)
addProperty(String, Object)
but exists in the console storage, it will be returned as a String.key - Property key.null if the property does not exist.public abstract Object setProperty(String key, Object value)
addProperty(String, Object) method, the value will be converted
to a String and stored. Such keys cannot be used in setter format
strings passed to addPreference(String[], String, String) method.
If the property value is set to null, it is removed from storage, so
subsequent calls to getProperty(String) will return the default
value, if it has been set.
key - Property key.value - Property value, or null if the property is being reset to its default value.null if the property did not exist.IllegalArgumentException - If the specified value is not type-compatible with the default value for the specified key.public void setProperties(Map<String,Object> properties)
setProperty(String, Object) for details on setting properties.properties - public abstract void addPropertyListener(Console.PropertyListener listener, String filter)
listener - The listener to be notified.filter - Regular expression the property key has to match to trigger notification.public abstract boolean removePropertyListener(Console.PropertyListener listener)
listener - Listener to be removed.True if the specified listener was registered with this console.public abstract void addPreference(String[] path, String group, String format)
format string contains one or more property references in the ${key#qualifiers} form.
Qualifiers are separated by "#". At the moment, the only supported qualifier is "history=N".path - Path in the preferences tree to the page where the property setter should be displayed.group - Group inside the preferences page. If null, the property setter is displayed in the default group.format - Specifies the format of the property setter.IllegalArgumentException - If a property with the specified key already exists, and its value is incompatible with the provided default.public abstract void addMenu(Action action, String owner, String... locations)
The location strings specify a hierarchy of menus above the added item. Each
string should be in the name[[:group]:position] format, where
name is the text label of the menu the item should be added to,
group is the ordinal number of the item group inside the menu, and
position is the position inside the group.
The first location string can also be prefixed with the desired location
on the menu bar: [barPosition:]name[[:group]:position].
The menu is divided into groups by separators.
If the group number is negative, items added with the same group number but
different owners are put into the same group. If the group is not specified
or is equal to 0, the item is added to the default group. The default group
is shared by all owners. Items added with the same non-zero position to the
same group are sorted alphabetically.
action - Action for the menu item to be added.owner - Owner of the added menu item.locations - Strings that specifies locations of the added item at all levels in the menu hierarchy.public abstract boolean removeMenu(String... locations)
locations - Hierarchy of menu item names, starting from the top level menu.true is some items have been removed.public abstract void insertToolbarAction(Action action, int position)
action - Action to insert.position - Buttons are inserted in the increasing position order.public abstract void insertStatusBarComponent(JComponent component, int position)
public abstract void removeStatusBarComponent(JComponent component)
public abstract void restore()
public abstract void restoreFrom()
public abstract void save()
public abstract void saveAs()
Copyright © 2023 LSST. All rights reserved.