use of ch.cyberduck.core.threading.WorkerBackgroundAction in project cyberduck by iterate-ch.
the class InfoController method storageClassPopupClicked.
@Action
public void storageClassPopupClicked(final NSPopUpButton sender) {
if (this.toggleS3Settings(false)) {
final String redundancy = sender.selectedItem().representedObject();
this.background(new WorkerBackgroundAction<>(controller, session, new WriteRedundancyWorker(files, redundancy, new PromptRecursiveCallback<>(this), controller) {
@Override
public void cleanup(final Boolean v) {
toggleS3Settings(true);
initS3();
}
}));
}
}
use of ch.cyberduck.core.threading.WorkerBackgroundAction in project cyberduck by iterate-ch.
the class InfoController method lifecyclePopupClicked.
@Action
public void lifecyclePopupClicked(final NSButton sender) {
if (this.toggleS3Settings(false)) {
final LifecycleConfiguration configuration = new LifecycleConfiguration(lifecycleTransitionCheckbox.state() == NSCell.NSOnState ? Integer.valueOf(lifecycleTransitionPopup.selectedItem().representedObject()) : null, lifecycleDeleteCheckbox.state() == NSCell.NSOnState ? Integer.valueOf(lifecycleDeletePopup.selectedItem().representedObject()) : null);
this.background(new WorkerBackgroundAction<>(controller, session, new WriteLifecycleWorker(files, configuration) {
@Override
public void cleanup(final Boolean result) {
toggleS3Settings(true);
initS3();
}
}));
}
}
use of ch.cyberduck.core.threading.WorkerBackgroundAction in project cyberduck by iterate-ch.
the class InfoController method encryptionPopupClicked.
@Action
public void encryptionPopupClicked(final NSPopUpButton sender) {
final String algorithm = sender.selectedItem().representedObject();
if (null != algorithm && this.toggleS3Settings(false)) {
final Encryption.Algorithm encryption = Encryption.Algorithm.fromString(algorithm);
this.background(new WorkerBackgroundAction<>(controller, session, new WriteEncryptionWorker(files, encryption, new PromptRecursiveCallback<>(this), controller) {
@Override
public void cleanup(final Boolean v) {
toggleS3Settings(true);
initS3();
}
}));
}
}
use of ch.cyberduck.core.threading.WorkerBackgroundAction in project cyberduck by iterate-ch.
the class InfoController method bucketLoggingButtonClicked.
@Action
public void bucketLoggingButtonClicked(final NSButton sender) {
if (this.toggleS3Settings(false)) {
final LoggingConfiguration configuration = new LoggingConfiguration(bucketLoggingButton.state() == NSCell.NSOnState, null == bucketLoggingPopup.selectedItem() ? null : bucketLoggingPopup.selectedItem().representedObject());
this.background(new WorkerBackgroundAction<>(controller, session, new WriteLoggingWorker(files, configuration) {
@Override
public void cleanup(final Boolean result) {
toggleS3Settings(true);
initS3();
}
}));
}
}
use of ch.cyberduck.core.threading.WorkerBackgroundAction in project cyberduck by iterate-ch.
the class InfoController method calculateSizeButtonClicked.
@Action
public void calculateSizeButtonClicked(final ID sender) {
if (this.toggleSizeSettings(false)) {
this.background(new WorkerBackgroundAction<>(controller, session, new CalculateSizeWorker(files, controller) {
@Override
public void cleanup(final Long size) {
setSize(size);
toggleSizeSettings(true);
}
@Override
protected void update(final long size) {
invoke(new WindowMainAction(InfoController.this) {
@Override
public void run() {
setSize(size);
}
});
}
}));
}
}
Aggregations