/** * Internally always saved as a string. * * @param property The name of the property to create or update * @param v The new or updated value */ public void setProperty(final String property, final double v) { this.setProperty(property, String.valueOf(v)); }
public void setSortedAscending(boolean sortAscending) { //cache custom sorting preference this.sortAscending = sortAscending; //set default value PreferencesFactory.get().setProperty("browser.sort.ascending", this.sortAscending); }
@Override protected void allow(final String hostname, final PublicKey key, final boolean persist) { if(persist) { preferences.setProperty(this.getFormat(hostname, key), Base64.toBase64String(key.getEncoded())); } } }
@Override public void windowWillClose(final NSNotification notification) { preferences.setProperty("bookmark.toggle.options", toggleOptionsButton.state()); super.windowWillClose(notification); }
@Action public void openUntitledBrowserCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("browser.open.untitled", enabled); }
@Action public void preserveModificationDownloadCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("queue.download.timestamp.change", enabled); }
@Action public void checksumDownloadCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("queue.download.checksum.calculate", enabled); }
@Action public void uploadTemporaryFilenameButtonClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("queue.upload.file.temporary", enabled); }
@Action public void confirmDisconnectCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("browser.disconnect.confirm", enabled); }
@Action public void drawerDidClose(NSNotification notification) { preferences.setProperty("browser.transcript.open", false); transcript.clear(); }
@Action public void bringQueueToBackCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("queue.window.open.transfer.stop", enabled); }
@Override public void callback(final int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("browser.move.confirm", false); } if(returncode == DEFAULT_OPTION) { new OverwriteController(parent).overwrite(new ArrayList<Path>(selected.values()), action); } } });
@Action public void connectionsPopupChanged(final NSMenuItem sender) { final Integer connections = Integer.valueOf(sender.representedObject()); preferences.setProperty("queue.connections.limit", connections); final TransferQueue queue = TransferQueueFactory.get(); queue.resize(connections); }
@Action public void horizontalLinesCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("browser.horizontalLines", enabled); BrowserController.updateBrowserTableAttributes(); }
@Action public void alternatingRowBackgroundCheckboxClicked(final NSButton sender) { boolean enabled = sender.state() == NSCell.NSOnState; preferences.setProperty("browser.alternatingRows", enabled); BrowserController.updateBrowserTableAttributes(); }
@Override public void tabView_didSelectTabViewItem(final NSTabView view, final NSTabViewItem item) { this.setTitle(this.getTitle(item)); this.resize(); preferences.setProperty(String.format("%s.selected", this.getToolbarName()), view.indexOfTabViewItem(item)); }
@Action public void defaultBookmarkComboboxClicked(NSPopUpButton sender) { final String selected = sender.selectedItem().representedObject(); if(null == selected) { preferences.deleteProperty("browser.open.bookmark.default"); } preferences.setProperty("browser.open.bookmark.default", selected); }
@Action public void columnMenuClicked(final NSMenuItem sender) { final String identifier = sender.representedObject(); final boolean enabled = !preferences.getBoolean(identifier); sender.setState(enabled ? NSCell.NSOnState : NSCell.NSOffState); preferences.setProperty(identifier, enabled); BrowserController.updateBrowserTableColumns(); }
@Action public void duplicateDownloadComboboxClicked(NSPopUpButton sender) { preferences.setProperty("queue.download.action", TransferAction.forName(sender.selectedItem().representedObject()).name()); this.duplicateDownloadOverwriteButtonClicked(duplicateDownloadOverwriteButton); }
@Action public void duplicateUploadComboboxClicked(NSPopUpButton sender) { preferences.setProperty("queue.upload.action", TransferAction.forName(sender.selectedItem().representedObject()).name()); this.duplicateUploadOverwriteButtonClicked(duplicateUploadOverwriteButton); }