/** * @return True if the controller window is on screen. */ public boolean isVisible() { if(null == window) { return false; } return window.isVisible(); }
@Override public void layoutManager_didCompleteLayoutForTextContainer_atEnd(NSLayoutManager layoutManager, NSObject textContainer, boolean finished) { if(finished && this.responseField.window().isVisible()) { this.responseField.scrollRangeToVisible( NSRange.NSMakeRange(this.responseField.textStorage().length(), new NSUInteger(0)) ); } }
/** * Resize window frame to fit the content view of the currently selected tab. */ private void resize() { final NSRect windowFrame = NSWindow.contentRectForFrameRect_styleMask(window.frame(), window.styleMask()); final double height = this.getMinWindowHeight(); final NSRect frameRect = new NSRect( new NSPoint(windowFrame.origin.x.doubleValue(), windowFrame.origin.y.doubleValue() + windowFrame.size.height.doubleValue() - height), new NSSize(windowFrame.size.width.doubleValue(), height) ); window.setFrame_display_animate(NSWindow.frameRectForContentRect_styleMask(frameRect, window.styleMask()), true, window.isVisible()); }