@Override public void change(final Host bookmark) { encodingPopup.setEnabled(bookmark.getProtocol().isEncodingConfigurable()); if(!bookmark.getProtocol().isEncodingConfigurable()) { encodingPopup.selectItemWithTitle(DEFAULT); } else { if(null == bookmark.getEncoding()) { encodingPopup.selectItemWithTitle(DEFAULT); } else { encodingPopup.selectItemAtIndex(encodingPopup.indexOfItemWithRepresentedObject(bookmark.getEncoding())); } } } });
public void setEncodingCombobox(NSPopUpButton b) { this.encodingCombobox = b; this.encodingCombobox.setTarget(this.id()); this.encodingCombobox.setAction(Foundation.selector("encodingComboboxClicked:")); this.encodingCombobox.removeAllItems(); this.encodingCombobox.addItemsWithTitles(NSArray.arrayWithObjects(new DefaultCharsetProvider().availableCharsets())); this.encodingCombobox.selectItemWithTitle(preferences.getProperty("browser.charset.encoding")); }
public void setLanguagePopup(NSPopUpButton b) { this.languagePopup = b; this.languagePopup.removeAllItems(); this.languagePopup.setTarget(this.id()); this.languagePopup.setAction(Foundation.selector("languagePopupClicked:")); this.languagePopup.addItemWithTitle(LocaleFactory.localizedString("Default")); this.languagePopup.menu().addItem(NSMenuItem.separatorItem()); String custom = null; if(preferences.systemLocales().size() > 1) { // No user default application scope single value of AppleLanguages property is set but a list // of preferred languages from system preferences is returned. this.languagePopup.selectItemWithTitle(LocaleFactory.localizedString("Default")); } else { // Custom language set for this application identifier custom = preferences.locale(); } for(String identifier : preferences.applicationLocales()) { this.languagePopup.addItemWithTitle(preferences.getDisplayName(identifier)); this.languagePopup.lastItem().setRepresentedObject(identifier); if(identifier.equals(custom)) { this.languagePopup.selectItem(this.languagePopup.lastItem()); } } }
public void setDefaultBucketLocation(NSPopUpButton b) { this.defaultBucketLocation = b; this.defaultBucketLocation.setAutoenablesItems(false); this.defaultBucketLocation.removeAllItems(); for(Location.Name location : new S3Protocol().getRegions()) { this.defaultBucketLocation.addItemWithTitle(location.toString()); this.defaultBucketLocation.lastItem().setRepresentedObject(location.getIdentifier()); } this.defaultBucketLocation.setTarget(this.id()); this.defaultBucketLocation.setAction(Foundation.selector("defaultBucketLocationClicked:")); this.defaultBucketLocation.selectItemWithTitle(LocaleFactory.localizedString(preferences.getProperty("s3.location"), "S3")); }
distributionLoggingPopup.selectItemWithTitle(distribution.getLoggingContainer()); distributionLoggingPopup.selectItemWithTitle(containerService.getContainer(file).getName()); distributionLoggingPopup.selectItemWithTitle(LocaleFactory.localizedString("None")); distributionDefaultRootPopup.addItemWithTitle(distribution.getIndexDocument()); distributionDefaultRootPopup.selectItemWithTitle(distribution.getIndexDocument()); distributionDefaultRootPopup.selectItemWithTitle(LocaleFactory.localizedString("None"));
distributionDeliveryPopup.selectItemWithTitle(selected); if(null == distributionDeliveryPopup.selectedItem()) { distributionDeliveryPopup.selectItemWithTitle(method.toString());
@Override public void change(final Host bookmark) { certificatePopup.setEnabled(options.certificate); certificatePopup.removeAllItems(); certificatePopup.addItemWithTitle(LocaleFactory.localizedString("None")); if(options.certificate) { certificatePopup.menu().addItem(NSMenuItem.separatorItem()); for(String certificate : new KeychainX509KeyManager(bookmark).list()) { certificatePopup.addItemWithTitle(certificate); certificatePopup.lastItem().setRepresentedObject(certificate); } } if(credentials.isCertificateAuthentication()) { certificatePopup.selectItemAtIndex(certificatePopup.indexOfItemWithRepresentedObject(credentials.getCertificate())); } else { certificatePopup.selectItemWithTitle(LocaleFactory.localizedString("None")); } } });
@Override public void change(final Host bookmark) { privateKeyPopup.setEnabled(options.publickey); if(credentials.isPublicKeyAuthentication()) { privateKeyPopup.selectItemAtIndex(privateKeyPopup.indexOfItemWithRepresentedObject(credentials.getIdentity().getAbsolute())); } else { privateKeyPopup.selectItemWithTitle(LocaleFactory.localizedString("None")); } if(credentials.isPublicKeyAuthentication()) { final Local key = credentials.getIdentity(); if(-1 == privateKeyPopup.indexOfItemWithRepresentedObject(key.getAbsolute()).intValue()) { final NSInteger index = new NSInteger(0); privateKeyPopup.insertItemWithTitle_atIndex(key.getAbbreviatedPath(), index); privateKeyPopup.itemAtIndex(index).setRepresentedObject(key.getAbsolute()); } } } });
public void setDefaultEncryptionPopup(NSPopUpButton b) { this.defaultEncryptionPopup = b; this.defaultEncryptionPopup.setAutoenablesItems(false); this.defaultEncryptionPopup.removeAllItems(); this.defaultEncryptionPopup.addItemWithTitle(LocaleFactory.localizedString("None")); this.defaultEncryptionPopup.lastItem().setRepresentedObject(S3EncryptionFeature.Algorithm.NONE.toString()); this.defaultEncryptionPopup.addItemWithTitle(LocaleFactory.localizedString(S3EncryptionFeature.SSE_AES256.getDescription(), "S3")); this.defaultEncryptionPopup.lastItem().setRepresentedObject(S3EncryptionFeature.SSE_AES256.toString()); this.defaultEncryptionPopup.addItemWithTitle(LocaleFactory.localizedString(KMSEncryptionFeature.SSE_KMS_DEFAULT.getDescription(), "S3")); this.defaultEncryptionPopup.lastItem().setRepresentedObject(KMSEncryptionFeature.SSE_KMS_DEFAULT.toString()); this.defaultEncryptionPopup.setTarget(this.id()); this.defaultEncryptionPopup.setAction(Foundation.selector("defaultEncryptionPopupClicked:")); if(StringUtils.isEmpty(preferences.getProperty("s3.encryption.algorithm"))) { this.defaultEncryptionPopup.selectItemWithTitle(LocaleFactory.localizedString("None")); } else { this.defaultEncryptionPopup.selectItemAtIndex(this.defaultEncryptionPopup.indexOfItemWithRepresentedObject(preferences.getProperty("s3.encryption.algorithm"))); } }
public void setDefaultStorageClassPopup(NSPopUpButton b) { this.defaultStorageClassPopup = b; this.defaultStorageClassPopup.setAutoenablesItems(false); this.defaultStorageClassPopup.removeAllItems(); this.defaultStorageClassPopup.addItemWithTitle(LocaleFactory.localizedString(S3Object.STORAGE_CLASS_STANDARD, "S3")); this.defaultStorageClassPopup.lastItem().setRepresentedObject(S3Object.STORAGE_CLASS_STANDARD); this.defaultStorageClassPopup.addItemWithTitle(LocaleFactory.localizedString(S3Object.STORAGE_CLASS_INFREQUENT_ACCESS, "S3")); this.defaultStorageClassPopup.lastItem().setRepresentedObject(S3Object.STORAGE_CLASS_INFREQUENT_ACCESS); this.defaultStorageClassPopup.addItemWithTitle(LocaleFactory.localizedString("ONEZONE_IA", "S3")); this.defaultStorageClassPopup.lastItem().setRepresentedObject("ONEZONE_IA"); this.defaultStorageClassPopup.addItemWithTitle(LocaleFactory.localizedString(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY, "S3")); this.defaultStorageClassPopup.lastItem().setRepresentedObject(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); this.defaultStorageClassPopup.setTarget(this.id()); this.defaultStorageClassPopup.setAction(Foundation.selector("defaultStorageClassPopupClicked:")); this.defaultStorageClassPopup.selectItemWithTitle(LocaleFactory.localizedString(preferences.getProperty("s3.storage.class"), "S3")); }
bucketLoggingPopup.selectItemWithTitle(logging.getLoggingTarget());
public void setDuplicateUploadCombobox(NSPopUpButton b) { this.duplicateUploadCombobox = b; this.duplicateUploadCombobox.setAutoenablesItems(false); this.duplicateUploadCombobox.setTarget(this.id()); this.duplicateUploadCombobox.setAction(Foundation.selector("duplicateUploadComboboxClicked:")); this.duplicateUploadCombobox.removeAllItems(); for(TransferAction action : new TransferAction[]{ TransferAction.callback, TransferAction.overwrite, TransferAction.resume, TransferAction.rename, TransferAction.renameexisting, TransferAction.comparison, TransferAction.skip}) { this.duplicateUploadCombobox.addItemWithTitle(action.getTitle()); this.duplicateUploadCombobox.lastItem().setRepresentedObject(action.name()); this.duplicateUploadCombobox.addItemWithTitle(action.getDescription()); this.duplicateUploadCombobox.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.duplicateUploadCombobox.lastItem().setEnabled(false); } this.duplicateUploadCombobox.selectItemWithTitle( TransferAction.forName(preferences.getProperty("queue.upload.action")).getTitle()); }
public void setDuplicateDownloadCombobox(NSPopUpButton b) { this.duplicateDownloadCombobox = b; this.duplicateDownloadCombobox.setAutoenablesItems(false); this.duplicateDownloadCombobox.setTarget(this.id()); this.duplicateDownloadCombobox.setAction(Foundation.selector("duplicateDownloadComboboxClicked:")); this.duplicateDownloadCombobox.removeAllItems(); for(TransferAction action : new TransferAction[]{ TransferAction.callback, TransferAction.overwrite, TransferAction.resume, TransferAction.rename, TransferAction.renameexisting, TransferAction.comparison, TransferAction.skip}) { this.duplicateDownloadCombobox.addItemWithTitle(action.getTitle()); this.duplicateDownloadCombobox.lastItem().setRepresentedObject(action.name()); this.duplicateDownloadCombobox.addItemWithTitle(action.getDescription()); this.duplicateDownloadCombobox.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.duplicateDownloadCombobox.lastItem().setEnabled(false); } this.duplicateDownloadCombobox.selectItemWithTitle( TransferAction.forName(preferences.getProperty("queue.download.action")).getTitle()); }