Package de.mid.innovator.client
Class InoClientContext
- java.lang.Object
-
- de.mid.innovator.client.InoClientContext
-
public class InoClientContext extends java.lang.Object
The class represents a context that will be created if the JVM is started by an Innovator client.The context can be used for data exchange with the client applications. It contains all kinds of information concerning the selected elements, the actual repository server, the model and the client program. If the JVM was not started directly from the model browser, the context also contains an instance of the
presentation context
.The class was designed using the singleton pattern and, therefore, provides the
getInstance()
method for finding the instance. ThehasContext()
method can be used to check if a program was started from Innovator clients.if (InoClientContext.hasContext()) { InoClientContext ctx = InoClientContext.getInstance(); // use data from ctx rep = ctx.getRepositoryServer(); model = ctx.getModel(); } else { // no context available }
- Author:
- borschet
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Cloning is not allowed for Inovator Context; this is a singleton object.InoClientProgram
getClientProgram()
Gets the client program that started the JVM.static InoClientContext
getInstance()
Retrieves the singleton instance of the client context.ExcellenceModel
getModel()
PRPresContext
getPRPresContext()
Gets the presentation context which should be a diagram or table that is displayed by the client.java.util.List<ELElement>
getReplySelection()
Gets a synchronized list that can be used to tell the client about elements that have to be shown after the execution of the Java application.RepositoryServer
getRepositoryServer()
java.util.List<ELElement>
getSelection()
Gets the selected items of an Innovator client.SrvContext
getSrvContext()
Gets the (valid) server context of the client application.static boolean
hasContext()
Checks if a client context is available or not.void
setReplySelection(java.util.List<ELElement> replySelection)
A synchronized setter to replace the complete list of elements.
-
-
-
Method Detail
-
hasContext
public static boolean hasContext()
Checks if a client context is available or not.- Returns:
- true, if
getInstance()
returns a value not equal to null, otherwise false
-
getInstance
public static InoClientContext getInstance()
Retrieves the singleton instance of the client context.- Returns:
- the singleton instance or null
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloning is not allowed for Inovator Context; this is a singleton object.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
getReplySelection
public java.util.List<ELElement> getReplySelection()
Gets a synchronized list that can be used to tell the client about elements that have to be shown after the execution of the Java application. All kinds of Innovator repository elements can be added or removed during runtime using the standardList
methods.- Returns:
- a list of Innovator elements
-
setReplySelection
public void setReplySelection(java.util.List<ELElement> replySelection)
A synchronized setter to replace the complete list of elements.- Parameters:
replySelection
- a list of elements that should be shown.
-
getSelection
public java.util.List<ELElement> getSelection()
Gets the selected items of an Innovator client.- Returns:
- an unmodifiable list containing (modifiable) instances or null if no elements have been selected.
-
getModel
public ExcellenceModel getModel()
- Returns:
- the model to which the client is connected, if any.
-
getRepositoryServer
public RepositoryServer getRepositoryServer()
- Returns:
- the repository server to which the client is connected, if any.
-
getSrvContext
public SrvContext getSrvContext()
Gets the (valid) server context of the client application. The method encapsulates all Innovator clients transparently, regardless of whether they work on a model or not.- Returns:
- an instance of
Model
orRepositoryServer
which implements the interfaceSrvContext
.
-
getPRPresContext
public PRPresContext getPRPresContext()
Gets the presentation context which should be a diagram or table that is displayed by the client.- Returns:
- a presentation context
-
getClientProgram
public InoClientProgram getClientProgram()
Gets the client program that started the JVM.- Returns:
- a specialization of
InoClientProgram
or null if no such information is available.
-
-