Search in sources :

Example 1 with WorkerBackgroundAction

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();
            }
        }));
    }
}
Also used : NSMutableAttributedString(ch.cyberduck.binding.foundation.NSMutableAttributedString) NSString(ch.cyberduck.binding.foundation.NSString) NSAttributedString(ch.cyberduck.binding.foundation.NSAttributedString) Action(ch.cyberduck.binding.Action) RegistryBackgroundAction(ch.cyberduck.core.threading.RegistryBackgroundAction) WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) WorkerBackgroundAction(ch.cyberduck.core.threading.WorkerBackgroundAction)

Example 2 with WorkerBackgroundAction

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();
            }
        }));
    }
}
Also used : LifecycleConfiguration(ch.cyberduck.core.lifecycle.LifecycleConfiguration) Action(ch.cyberduck.binding.Action) RegistryBackgroundAction(ch.cyberduck.core.threading.RegistryBackgroundAction) WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) WorkerBackgroundAction(ch.cyberduck.core.threading.WorkerBackgroundAction)

Example 3 with WorkerBackgroundAction

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();
            }
        }));
    }
}
Also used : NSMutableAttributedString(ch.cyberduck.binding.foundation.NSMutableAttributedString) NSString(ch.cyberduck.binding.foundation.NSString) NSAttributedString(ch.cyberduck.binding.foundation.NSAttributedString) Encryption(ch.cyberduck.core.features.Encryption) Action(ch.cyberduck.binding.Action) RegistryBackgroundAction(ch.cyberduck.core.threading.RegistryBackgroundAction) WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) WorkerBackgroundAction(ch.cyberduck.core.threading.WorkerBackgroundAction)

Example 4 with WorkerBackgroundAction

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();
            }
        }));
    }
}
Also used : LoggingConfiguration(ch.cyberduck.core.logging.LoggingConfiguration) Action(ch.cyberduck.binding.Action) RegistryBackgroundAction(ch.cyberduck.core.threading.RegistryBackgroundAction) WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) WorkerBackgroundAction(ch.cyberduck.core.threading.WorkerBackgroundAction)

Example 5 with WorkerBackgroundAction

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);
                    }
                });
            }
        }));
    }
}
Also used : WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) Action(ch.cyberduck.binding.Action) RegistryBackgroundAction(ch.cyberduck.core.threading.RegistryBackgroundAction) WindowMainAction(ch.cyberduck.core.threading.WindowMainAction) WorkerBackgroundAction(ch.cyberduck.core.threading.WorkerBackgroundAction)

Aggregations

WorkerBackgroundAction (ch.cyberduck.core.threading.WorkerBackgroundAction)16 Action (ch.cyberduck.binding.Action)14 WindowMainAction (ch.cyberduck.core.threading.WindowMainAction)14 RegistryBackgroundAction (ch.cyberduck.core.threading.RegistryBackgroundAction)8 BackgroundAction (ch.cyberduck.core.threading.BackgroundAction)6 BrowserTransferBackgroundAction (ch.cyberduck.core.threading.BrowserTransferBackgroundAction)6 DefaultMainAction (ch.cyberduck.core.threading.DefaultMainAction)6 DisconnectBackgroundAction (ch.cyberduck.core.threading.DisconnectBackgroundAction)6 TransferAction (ch.cyberduck.core.transfer.TransferAction)6 NSAttributedString (ch.cyberduck.binding.foundation.NSAttributedString)5 NSString (ch.cyberduck.binding.foundation.NSString)5 NSMutableAttributedString (ch.cyberduck.binding.foundation.NSMutableAttributedString)2 AclPermission (ch.cyberduck.core.features.AclPermission)2 Location (ch.cyberduck.core.features.Location)2 UnixPermission (ch.cyberduck.core.features.UnixPermission)2 AlertController (ch.cyberduck.binding.AlertController)1 NSObject (ch.cyberduck.binding.foundation.NSObject)1 AttributedList (ch.cyberduck.core.AttributedList)1 Distribution (ch.cyberduck.core.cdn.Distribution)1 Encryption (ch.cyberduck.core.features.Encryption)1