
from org.gvsig.andami.ui.mdiManager import IWindow
from javax.swing import JInternalFrame

def __getJInternalFrame(self):
  x = self.getParent()
  for n in xrange(200):
    #print "x: ", x
    if isinstance(x,JInternalFrame):
      return x
    x = x.getParent()
  return None
  
IWindow.getJInternalFrame = __getJInternalFrame

