Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Dec 22, 2024
1 parent 4c94d76 commit ec3c6f9
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import ch.cyberduck.core.features.Delete;
import ch.cyberduck.core.features.Directory;
import ch.cyberduck.core.features.Move;
import ch.cyberduck.core.features.Share;
import ch.cyberduck.core.features.Restore;
import ch.cyberduck.core.features.Share;
import ch.cyberduck.core.features.Symlink;
import ch.cyberduck.core.features.Touch;
import ch.cyberduck.core.features.Versioning;
Expand Down Expand Up @@ -100,7 +100,7 @@ public boolean validate(final NSToolbarItem item) {
case encoding: {
final NSPopUpButton popup = Rococoa.cast(item.view(), NSPopUpButton.class);
popup.selectItemAtIndex(popup.indexOfItemWithRepresentedObject(controller.isMounted() ?
controller.getSession().getHost().getEncoding() : PreferencesFactory.get().getProperty("browser.charset.encoding")));
controller.getSession().getHost().getEncoding() : PreferencesFactory.get().getProperty("browser.charset.encoding")));
}
case cryptomator: {
final Path selected = new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath());
Expand Down Expand Up @@ -162,21 +162,21 @@ else if(action.equals(addbookmark.action())) {
else if(action.equals(Foundation.selector("deleteBookmarkButtonClicked:"))) {
if(this.isBookmarks()) {
return controller.getBookmarkModel().getSource().allowsDelete()
&& controller.getBookmarkTable().selectedRow().intValue() != -1;
&& controller.getBookmarkTable().selectedRow().intValue() != -1;
}
return false;
}
else if(action.equals(Foundation.selector("duplicateBookmarkButtonClicked:"))) {
if(this.isBookmarks()) {
return controller.getBookmarkModel().getSource().allowsEdit()
&& controller.getBookmarkTable().numberOfSelectedRows().intValue() == 1;
&& controller.getBookmarkTable().numberOfSelectedRows().intValue() == 1;
}
return false;
}
else if(action.equals(Foundation.selector("editBookmarkButtonClicked:"))) {
if(this.isBookmarks()) {
return controller.getBookmarkModel().getSource().allowsEdit()
&& controller.getBookmarkTable().numberOfSelectedRows().intValue() == 1;
&& controller.getBookmarkTable().numberOfSelectedRows().intValue() == 1;
}
return false;
}
Expand Down Expand Up @@ -235,9 +235,9 @@ else if(action.equals(info.action())) {
}
else if(action.equals(newfolder.action())) {
return this.isBrowser() && controller.isMounted() &&
controller.getSession().getFeature(Directory.class).isSupported(
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()), StringUtils.EMPTY
);
controller.getSession().getFeature(Directory.class).isSupported(
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()), StringUtils.EMPTY
);
}
else if(action.equals(Foundation.selector("createEncryptedVaultButtonClicked:"))) {
return this.isBrowser() && controller.isMounted() && controller.getSession().getVaultRegistry() != VaultRegistry.DISABLED &&
Expand All @@ -248,21 +248,21 @@ else if(action.equals(Foundation.selector("createEncryptedVaultButtonClicked:"))
}
else if(action.equals(Foundation.selector("createFileButtonClicked:"))) {
return this.isBrowser() && controller.isMounted() && controller.getSession().getFeature(Touch.class).isSupported(
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()), StringUtils.EMPTY
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()), StringUtils.EMPTY
);
}
else if(action.equals(upload.action())) {
return this.isBrowser() && controller.isMounted() && controller.getSession().getFeature(Touch.class).isSupported(
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()),
StringUtils.EMPTY);
new UploadTargetFinder(controller.workdir()).find(controller.getSelectedPath()),
StringUtils.EMPTY);
}
else if(action.equals(Foundation.selector("createSymlinkButtonClicked:"))) {
return this.isBrowser() && controller.isMounted() && controller.getSession().getFeature(Symlink.class) != null
&& controller.getSelectionCount() == 1;
&& controller.getSelectionCount() == 1;
}
else if(action.equals(Foundation.selector("duplicateFileButtonClicked:"))) {
return this.isBrowser() && controller.isMounted() && controller.getSession().getFeature(Copy.class) != null
&& controller.getSelectionCount() == 1;
&& controller.getSelectionCount() == 1;
}
else if(action.equals(Foundation.selector("renameFileButtonClicked:"))) {
if(this.isBrowser() && controller.isMounted() && controller.getSelectionCount() == 1) {
Expand All @@ -289,7 +289,7 @@ else if(action.equals(share.action())) {
if(this.isBrowser() && controller.isMounted()) {
final Path selected = null != controller.getSelectedPath() ? controller.getSelectedPath() : controller.workdir();
return controller.getSession().getFeature(Share.class) != null &&
controller.getSession().getFeature(Share.class).isSupported(selected, Share.Type.download);
controller.getSession().getFeature(Share.class).isSupported(selected, Share.Type.download);
}
return false;
}
Expand Down Expand Up @@ -368,8 +368,8 @@ else if(action.equals(Foundation.selector("gotofolderButtonClicked:"))) {
}
else if(action.equals(terminal.action())) {
return this.isBrowser() && controller.isMounted()
&& controller.getSession().getHost().getProtocol().getType() == Protocol.Type.sftp
&& TerminalServiceFactory.get() != null;
&& controller.getSession().getHost().getProtocol().getType() == Protocol.Type.sftp
&& TerminalServiceFactory.get() != null;
}
else if(action.equals(archive.action()) || action.equals(Foundation.selector("archiveMenuClicked:"))) {
if(this.isBrowser() && controller.isMounted()) {
Expand Down Expand Up @@ -417,8 +417,8 @@ else if(action.equals(cryptomator.action())) {
}
final AttributedList<Path> cache = controller.getCache().get(controller.workdir());
return null != cache.find(new SimplePathPredicate(Path.Type.file,
String.format("%s%s%s", controller.workdir().getAbsolute(), Path.DELIMITER,
new HostPreferences(controller.getSession().getHost()).getProperty("cryptomator.vault.masterkey.filename"))));
String.format("%s%s%s", controller.workdir().getAbsolute(), Path.DELIMITER,
new HostPreferences(controller.getSession().getHost()).getProperty("cryptomator.vault.masterkey.filename"))));
}
return false;
}
Expand Down

0 comments on commit ec3c6f9

Please sign in to comment.