onDoubleClick Extension Function

Java’s SwingUtilities can help. Place the following in a script module, shared.swing, perhaps:

from javax.swing import SwingUtilities
from com.inductiveautomation.factorypmi.application import FPMIWindow

def getParentWindow(component):
    return SwingUtilities.getAncestorOfClass(FPMIWindow, component)

Then in your extension function, you can do:

w = shared.swing.getParentWindow(self)
v = w.rootContainer.customProperty
4 Likes