public abstract class DevModeUI extends Object
Sequence of calls:
#initialize(Type)
getTopLogger()
getWebServerLogger(String, byte[])
setStartupUrls(Map)
moduleLoadComplete(boolean)
or
getModuleLogger(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, byte[], com.google.gwt.core.ext.TreeLogger.Type)
setCallback(com.google.gwt.dev.ui.UiEvent.Type, UiCallback)
may be
interspersed among these calls after #initialize(Type)
is called.Constructor and Description |
---|
DevModeUI() |
Modifier and Type | Method and Description |
---|---|
protected <C extends UiCallback> |
getCallback(UiEvent.Type<?> eventType)
Call callback for a given event.
|
protected TreeLogger |
getConsoleLogger() |
protected TreeLogger.Type |
getLogLevel() |
abstract ModuleHandle |
getModuleLogger(String userAgent,
String remoteSocket,
String url,
String tabKey,
String moduleName,
String sessionKey,
String agentTag,
byte[] agentIcon,
TreeLogger.Type logLevel)
Show that a module is loaded in the UI.
|
TreeLogger |
getTopLogger()
Create a top-level logger for messages which are not associated with the
web server or any module.
|
abstract TreeLogger |
getWebServerLogger(String serverName,
byte[] serverIcon)
Create the web server portion of the UI if not already created, and
return its TreeLogger instance.
|
protected boolean |
hasCallback(UiEvent.Type<? extends UiCallback> eventType)
Returns true if a callback has been registered for an event.
|
void |
initialize(TreeLogger.Type logLevel)
Initialize the UI - must be called exactly once and before any other method
on this class.
|
void |
moduleLoadComplete(boolean success)
Indicates that all modules have been loaded (loading the XML, not
completing onModuleLoad), and that URLs previously specified in
setStartupUrls(Map) may be launched if successful. |
<C extends UiCallback> |
setCallback(UiEvent.Type<C> type,
C callback)
Sets the callback for a given event type..
|
void |
setStartupUrls(Map<String,URL> urls)
Set the URLs that should be available to start.
|
void |
setWebServerSecure(TreeLogger serverLogger)
Show in the UI that the web server, identified by the logger returned from
getWebServerLogger(String, byte[]) , is operating in a secure
fashion. |
public abstract ModuleHandle getModuleLogger(String userAgent, String remoteSocket, String url, String tabKey, String moduleName, String sessionKey, String agentTag, byte[] agentIcon, TreeLogger.Type logLevel)
Note that the CloseModuleEvent
should already have a callback
registered when this is called if needed -- the UI is not required to
change the UI if it is registered later.
userAgent
- full user agent nameremoteSocket
- name of remote socket endpoint in host:port formaturl
- URL of top-level windowtabKey
- stable browser tab identifier, or the empty string if no
such identifier is availablemoduleName
- the name of the module loadedsessionKey
- a unique session keyagentTag
- short-form user agent identifier, suitable for use in
a label for this connectionagentIcon
- icon to use for the user agent (fits inside 24x24) or
null if unavailablelogLevel
- logging detail requestedpublic TreeLogger getTopLogger()
public abstract TreeLogger getWebServerLogger(String serverName, byte[] serverIcon)
Note that the RestartServerEvent
should already have a callback
registered when this is called -- the UI is not required to change the
UI if it is registered later.
serverName
- short name of the web server or null if only the icon
should be usedserverIcon
- byte array containing an icon (fitting into 24x24) to
use for the server, or null if only the name should be usedpublic void initialize(TreeLogger.Type logLevel)
Subclasses should call super.initialize(logLevel).
logLevel
- log level for all loggingpublic void moduleLoadComplete(boolean success)
setStartupUrls(Map)
may be launched if successful.success
- true if all modules were successfully loadedpublic final <C extends UiCallback> void setCallback(UiEvent.Type<C> type, C callback)
C
- callback typetype
- UI event type tokencallback
- event callback, or null to clear the callbackpublic void setStartupUrls(Map<String,URL> urls)
urls
- map of URLs -- the key is the name supplied with -startupUrls,
and the value is the mapped URL with all parameters includedpublic void setWebServerSecure(TreeLogger serverLogger)
getWebServerLogger(String, byte[])
, is operating in a secure
fashion.serverLogger
- protected final <C extends UiCallback> C getCallback(UiEvent.Type<?> eventType)
eventType
- type of eventprotected final TreeLogger getConsoleLogger()
protected final TreeLogger.Type getLogLevel()
protected final boolean hasCallback(UiEvent.Type<? extends UiCallback> eventType)
eventType
- type of eventCopyright © 2018. All rights reserved.