Class WindowInfo
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.model.TopLevelContainerInfoBase
-
- com.inductiveautomation.factorypmi.application.model.WindowInfo
-
public class WindowInfo extends TopLevelContainerInfoBase
WindowInfo is a wrapper type that contains an FPMIWindow. The serialized bytes inside a "window" project resource are actually a serialized WindowInfo, not a direct FPMIWindow. In this way, the client app can deserialize all of the WindowInfos upon startup, and know information about them (such as their thumbnail, whether they should open on startup, etc) without incurring the cost of deserializing the whole window. They also hold a reference to the FPMIWindow itself when it is open or cached.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ABOUT_WINDOW_KEY
static int
CURRENT_XML_FORMAT_VERSION
static java.lang.String
OPEN_ON_START_KEY
static java.lang.String
PARAMETER_NAMES_KEY
static java.lang.String
PERMISSIONS_KEY
static ResourceType
RESOURCE_TYPE
static java.lang.String
WINDOW_BINARY_KEY
static java.lang.String
XML_FORMAT_VERSION_KEY
-
Fields inherited from class com.inductiveautomation.factorypmi.application.model.TopLevelContainerInfoBase
PROJECT_RESOURCE_8_VERSION, PROJECT_RESOURCE_LEGACY_VERSION, THUMBNAIL_KEY, windowThumbnail, windowThumbnailBytes
-
-
Constructor Summary
Constructors Constructor Description WindowInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FPMIWindow
_getWindow()
Retrieves the FPMIWindow for this WindowInfo.WindowInfo
duplicate()
Creates a duplicate of this Window Info, but not the currently opened window (if any).java.lang.String[]
getParameters()
ComponentPermissions
getPermissions()
ResourcePath
getResourcePath()
byte[]
getSerializedCode()
java.util.List<FPMIWindow>
getWindowInstances()
Returns any window instances that are currently open.java.lang.String
getWindowName()
int
getXmlFormatVersion()
boolean
isAboutWindow()
boolean
isOpenOnStart()
boolean
isWindowOpen()
void
notifyWindowClosed(FPMIWindow window)
void
notifyWindowOpened(FPMIWindow window)
Adds this window to the list of opened windows, and clears any cached copy of the window.void
setAboutWindow(boolean aboutWindow)
void
setOpenOnStart(boolean b)
void
setParameters(java.lang.String[] parameters)
void
setPermissions(ComponentPermissions permissions)
void
setResourcePath(ResourcePath resourcePath)
void
setSecuritySettings(SecuritySettings settings)
void
setSerializedBase64(java.lang.String base64)
Deprecated.void
setSerializedCode(byte[] compressedXml)
Sets the code of this window to 'code', which is a GZipped version of the xml string which will recreate this window.void
setWindow(FPMIWindow window)
Deprecated.void
setWindowName(java.lang.String string)
void
setWindowThumbnailBase64(java.lang.String windowThumbnailBase64)
Deprecated.void
setXmlFormatVersion(int xmlFormatVersion)
-
Methods inherited from class com.inductiveautomation.factorypmi.application.model.TopLevelContainerInfoBase
getWindowThumbnail, getWindowThumbnailBytes, setWindowThumbnail, setWindowThumbnailBytes
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final ResourceType RESOURCE_TYPE
-
CURRENT_XML_FORMAT_VERSION
public static final int CURRENT_XML_FORMAT_VERSION
- See Also:
- Constant Field Values
-
OPEN_ON_START_KEY
public static final java.lang.String OPEN_ON_START_KEY
- See Also:
- Constant Field Values
-
ABOUT_WINDOW_KEY
public static final java.lang.String ABOUT_WINDOW_KEY
- See Also:
- Constant Field Values
-
XML_FORMAT_VERSION_KEY
public static final java.lang.String XML_FORMAT_VERSION_KEY
- See Also:
- Constant Field Values
-
PARAMETER_NAMES_KEY
public static final java.lang.String PARAMETER_NAMES_KEY
- See Also:
- Constant Field Values
-
WINDOW_BINARY_KEY
public static final java.lang.String WINDOW_BINARY_KEY
- See Also:
- Constant Field Values
-
PERMISSIONS_KEY
public static final java.lang.String PERMISSIONS_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
duplicate
public WindowInfo duplicate()
Creates a duplicate of this Window Info, but not the currently opened window (if any). Relies on the commited values. Sets modified=false and newWindow=true
-
isOpenOnStart
public boolean isOpenOnStart()
-
setOpenOnStart
public void setOpenOnStart(boolean b)
-
setSerializedCode
public void setSerializedCode(byte[] compressedXml)
Sets the code of this window to 'code', which is a GZipped version of the xml string which will recreate this window. This just BASE64s the bytes. This is the method that should be used to save a window.
-
getSerializedCode
public byte[] getSerializedCode()
-
setSerializedBase64
@Deprecated public void setSerializedBase64(java.lang.String base64)
Deprecated.
-
notifyWindowOpened
public void notifyWindowOpened(FPMIWindow window)
Adds this window to the list of opened windows, and clears any cached copy of the window.
-
notifyWindowClosed
public void notifyWindowClosed(FPMIWindow window)
-
_getWindow
public FPMIWindow _getWindow()
Retrieves the FPMIWindow for this WindowInfo. If the window is open, this will return it directly. If the window is in the cache, it will return the cached (but closed) window.
-
isWindowOpen
public boolean isWindowOpen()
-
getWindowInstances
public java.util.List<FPMIWindow> getWindowInstances()
Returns any window instances that are currently open.
-
setWindow
@Deprecated public void setWindow(FPMIWindow window)
Deprecated.Old function name now renamed to _setWindow() to avoid serializing the live window instance.
-
setSecuritySettings
public void setSecuritySettings(SecuritySettings settings)
-
getPermissions
public ComponentPermissions getPermissions()
-
setPermissions
public void setPermissions(ComponentPermissions permissions)
-
getWindowName
public java.lang.String getWindowName()
-
setWindowName
public void setWindowName(java.lang.String string)
-
getParameters
public java.lang.String[] getParameters()
-
setParameters
public void setParameters(java.lang.String[] parameters)
-
isAboutWindow
public boolean isAboutWindow()
- Returns:
- Returns the aboutWindow.
-
setAboutWindow
public void setAboutWindow(boolean aboutWindow)
- Parameters:
aboutWindow
- The aboutWindow to set.
-
getXmlFormatVersion
public int getXmlFormatVersion()
-
setXmlFormatVersion
public void setXmlFormatVersion(int xmlFormatVersion)
-
getResourcePath
public ResourcePath getResourcePath()
-
setResourcePath
public void setResourcePath(ResourcePath resourcePath)
-
setWindowThumbnailBase64
@Deprecated public void setWindowThumbnailBase64(java.lang.String windowThumbnailBase64)
Deprecated.
-
-