/** * Override this method if the controller should not be invalidated after its window closes */ @Override public void windowWillClose(final NSNotification notification) { window.endEditingFor(null); if(log.isDebugEnabled()) { log.debug(String.format("Window will close %s", notification)); } for(WindowListener listener : listeners.toArray(new WindowListener[listeners.size()])) { listener.windowWillClose(); } if(!this.isSingleton()) { //If the window is closed it is assumed the controller object is no longer used this.invalidate(); } }
/** * Called by the runtime after a sheet has been dismissed. Ends any modal session and * sends the returncode to the callback implementation. Also invalidates this controller to be * garbage collected and notifies the lock object * * @param sheet Sheet window * @param returncode Identifier for the button clicked by the user * @param contextInfo Not used */ public void sheetDidClose_returnCode_contextInfo(final NSWindow sheet, final int returncode, final ID contextInfo) { sheet.endEditingFor(null); sheet.orderOut(contextInfo); this.returncode = returncode; callback.callback(returncode); signal.countDown(); }
/** * Sets the current working directory. This will update the path selection menu and also add this path to the browsing history. * * @param directory The new working directory to display or null to detach any working directory from the browser * @param selected Selected files in browser */ public void setWorkdir(final Path directory, final List<Path> selected) { if(log.isDebugEnabled()) { log.debug(String.format("Set working directory to %s", directory)); } // Remove any custom file filter this.setFilter(SearchFilterFactory.create(showHiddenFiles)); final NSTableView browser = this.getSelectedBrowserView(); window.endEditingFor(browser); if(null == directory) { this.reload(null, Collections.emptySet(), selected, false); } else { this.reload(directory, Collections.singleton(directory), selected, false); } }
/** * This must be the target action for any button in the sheet dialog. Will validate the input * and close the sheet; #sheetDidClose will be called afterwards * * @param sender A button in the sheet dialog */ @Action public void closeSheet(final NSButton sender) { if(log.isDebugEnabled()) { log.debug(String.format("Close sheet with button %s", sender.title())); } final int option = new AlertSheetReturnCodeMapper().getOption(sender); if(option == SheetCallback.DEFAULT_OPTION || option == SheetCallback.ALTERNATE_OPTION) { window.endEditingFor(null); if(!this.validate()) { AppKitFunctionsLibrary.beep(); return; } } callback.callback(option); application.endSheet(window, option); }
/** * @param stop Enable controls and stop progress spinner * @return True if progress animation has started and settings are toggled */ private boolean toggleSizeSettings(final boolean stop) { this.window().endEditingFor(null); sizeButton.setEnabled(false); for(Path next : files) { if(next.isDirectory()) { sizeButton.setEnabled(stop); break; } } if(stop) { sizeProgress.stopAnimation(null); } else { sizeProgress.startAnimation(null); } return true; }
/** * Toggle settings before and after update * * @param stop Enable controls and stop progress spinner * @return True if progress animation has started and settings are toggled */ private boolean toggleAclSettings(final boolean stop) { this.window().endEditingFor(null); final Credentials credentials = session.getHost().getCredentials(); boolean enable = !credentials.isAnonymousLogin() && session.getFeature(AclPermission.class) != null; aclTable.setEnabled(stop && enable); aclAddButton.setEnabled(stop && enable); boolean selection = aclTable.selectedRowIndexes().count().intValue() > 0; aclRemoveButton.setEnabled(stop && enable && selection); if(stop) { aclProgress.stopAnimation(null); } else if(enable) { aclProgress.startAnimation(null); } return enable; }
/** * Toggle settings before and after update * * @param stop Enable controls and stop progress spinner * @return True if progress animation has started and settings are toggled */ private boolean toggleMetadataSettings(final boolean stop) { this.window().endEditingFor(null); final Credentials credentials = session.getHost().getCredentials(); boolean enable = !credentials.isAnonymousLogin() && session.getFeature(Metadata.class) != null; metadataTable.setEnabled(stop && enable); metadataAddButton.setEnabled(stop && enable); boolean selection = metadataTable.selectedRowIndexes().count().intValue() > 0; metadataRemoveButton.setEnabled(stop && enable && selection); if(stop) { metadataProgress.stopAnimation(null); } else if(enable) { metadataProgress.startAnimation(null); } return enable; }
this.window().endEditingFor(null); final Credentials credentials = session.getHost().getCredentials(); boolean enable = !credentials.isAnonymousLogin() && session.getFeature(UnixPermission.class) != null;
this.window().endEditingFor(null); final Credentials credentials = session.getHost().getCredentials(); final DistributionConfiguration cdn = session.getFeature(DistributionConfiguration.class);
this.window().endEditingFor(null); final Credentials credentials = session.getHost().getCredentials(); boolean enable = session.getHost().getProtocol().getType() == Protocol.Type.s3