@Override public void awakeFromNib() { super.awakeFromNib(); if(options.user) { window.makeFirstResponder(usernameField); } if(options.password && !org.apache.commons.lang3.StringUtils.isBlank(credentials.getUsername())) { window.makeFirstResponder(passwordField); } }
/** * Change focus to filter field * * @param sender Search field */ @Action public void searchButtonClicked(final ID sender) { window.makeFirstResponder(this.filterField); }
@Override public void awakeFromNib() { super.awakeFromNib(); window.makeFirstResponder(hostField); }
@Action public void searchButtonClicked(final ID sender) { this.window().makeFirstResponder(searchField); }
@Override public void awakeFromNib() { super.awakeFromNib(); if(bookmark.getProtocol().isHostnameConfigurable()) { window.makeFirstResponder(hostField); } else { if(options.user) { window.makeFirstResponder(usernameField); } } this.update(); }
/** * Marks the current browser as the first responder */ private void getFocus() { NSView view; if(this.getSelectedTabView() == BrowserTab.bookmarks) { window.makeFirstResponder(bookmarkTable); } else { if(this.isMounted()) { window.makeFirstResponder(this.getSelectedBrowserView()); } } this.setStatus(); }
@Override protected void focus(final NSAlert alert) { super.focus(alert); alert.window().makeFirstResponder(inputField); inputField.selectText(null); }
protected void focus(final NSAlert alert) { NSEnumerator buttons = alert.buttons().objectEnumerator(); NSObject button; while(((button = buttons.nextObject()) != null)) { final NSButton b = Rococoa.cast(button, NSButton.class); b.setTarget(this.id()); b.setAction(Foundation.selector("closeSheet:")); } final NSView accessory = this.getAccessoryView(alert); if(accessory != null) { final NSRect frame = this.getFrame(alert, accessory); accessory.setFrameSize(frame.size); alert.setAccessoryView(accessory); alert.window().makeFirstResponder(accessory); } // First call layout and then do any special positioning and sizing of the accessory view prior to running the alert alert.layout(); alert.window().recalculateKeyViewLoop(); }