protected Class<?> getAssociatedClass() { if (associatedClass == null) { UI current = UI.getCurrent(); if (current instanceof LegacyWindow) { LegacyWindow legacyWindow = (LegacyWindow) current; return legacyWindow.getApplication().getClass(); } else { return current.getClass(); } } return associatedClass; }
/** * Gets the full URL of the window. The returned URL is window specific and * can be used to directly refer to the window. * <p> * Note! This method can not be used for portlets. * </p> * * @return the URL of the window or null if the window is not attached to an * application */ public URL getURL() { LegacyApplication application = getApplication(); if (application == null) { return null; } try { return new URL(application.getURL(), getName() + "/"); } catch (MalformedURLException e) { throw new RuntimeException( "Internal problem getting window URL, please report"); } }