public void setEditorCombobox(NSPopUpButton b) { this.editorCombobox = b; this.editorCombobox.setAutoenablesItems(false); }
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")); }
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 setActionPopup(final NSPopUpButton actionPopup) { this.actionPopup = actionPopup; this.actionPopup.removeAllItems(); this.actionPopup.setAutoenablesItems(false); final TransferAction defaultAction = TransferAction.forName(preferences.getProperty(String.format("queue.prompt.%s.action.default", transfer.getType().name()))); for(TransferAction action : TransferAction.forTransfer(transfer.getType())) { this.actionPopup.addItemWithTitle(action.getTitle()); this.actionPopup.lastItem().setRepresentedObject(action.name()); if(action.equals(defaultAction)) { this.actionPopup.selectItem(actionPopup.lastItem()); } this.actionPopup.addItemWithTitle(action.getDescription()); this.actionPopup.lastItem().setAttributedTitle(NSAttributedString.attributedStringWithAttributes(action.getDescription(), MENU_HELP_FONT_ATTRIBUTES)); this.actionPopup.lastItem().setEnabled(false); } this.actionPopup.setTarget(this.id()); this.actionPopup.setAction(Foundation.selector("actionPopupClicked:")); }
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")); }
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()); }