diff --git a/pom.xml b/pom.xml index 81e950cc..7cfbabf2 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ 11 11 UTF-8 + 1.18.12 @@ -140,6 +141,11 @@ 5.5.0 + + org.projectlombok + lombok + ${lombok.version} + diff --git a/src/main/java/snowflake/common/GlobalSettings.java b/src/main/java/snowflake/common/GlobalSettings.java index 02b6f629..8ccd24a5 100644 --- a/src/main/java/snowflake/common/GlobalSettings.java +++ b/src/main/java/snowflake/common/GlobalSettings.java @@ -1,33 +1,11 @@ package snowflake.common; +import lombok.Getter; +import lombok.Setter; + +@Getter @Setter public class GlobalSettings { private boolean showMessage; private String openMode; //DEFAULT_APP, INTERNAL_EDITOR, EXTERNAL_EDITOR private String externalEditor; - - public String getExternalEditor() { - return externalEditor; - } - - public void setExternalEditor(String externalEditor) { - this.externalEditor = externalEditor; - } - - public String getOpenMode() { - return openMode; - } - - public void setOpenMode(String openMode) { - this.openMode = openMode; - } - - public boolean isShowMessage() { - return showMessage; - } - - public void setShowMessage(boolean showMessage) { - this.showMessage = showMessage; - } - - } diff --git a/src/main/java/snowflake/common/Settings.java b/src/main/java/snowflake/common/Settings.java index 916c7ac5..fedf852f 100644 --- a/src/main/java/snowflake/common/Settings.java +++ b/src/main/java/snowflake/common/Settings.java @@ -1,5 +1,9 @@ package snowflake.common; +import lombok.Getter; +import lombok.Setter; + +@Getter @Setter public class Settings { private boolean confirmBeforeDelete = true; private boolean confirmBeforeMoveOrCopy = true; @@ -10,127 +14,12 @@ public class Settings { private boolean confirmBeforeTerminalClosing = true; private boolean useDarkThemeForTerminal = false; private boolean showMessagePrompt = false; - private boolean puttyLikeCopyPaste = false; - private int defaultOpenAction = 0 + private int defaultOpenAction = 0; // 0 Open with default application // 1 Open with default editor // 2 Open with internal editor - , numberOfSimultaneousConnection = 3; + private int numberOfSimultaneousConnection = 3; private String terminalType = "xterm-256color"; private String defaultPanel = SnowFlakePanel.FILES.getName(); - - public boolean isConfirmBeforeDelete() { - return confirmBeforeDelete; - } - - public void setConfirmBeforeDelete(boolean confirmBeforeDelete) { - this.confirmBeforeDelete = confirmBeforeDelete; - } - - public boolean isConfirmBeforeMoveOrCopy() { - return confirmBeforeMoveOrCopy; - } - - public void setConfirmBeforeMoveOrCopy(boolean confirmBeforeMoveOrCopy) { - this.confirmBeforeMoveOrCopy = confirmBeforeMoveOrCopy; - } - - public boolean isShowHiddenFilesByDefault() { - return showHiddenFilesByDefault; - } - - public void setShowHiddenFilesByDefault(boolean showHiddenFilesByDefault) { - this.showHiddenFilesByDefault = showHiddenFilesByDefault; - } - - public boolean isPromptForSudo() { - return promptForSudo; - } - - public void setPromptForSudo(boolean promptForSudo) { - this.promptForSudo = promptForSudo; - } - - public boolean isDirectoryCache() { - return directoryCache; - } - - public void setDirectoryCache(boolean directoryCache) { - this.directoryCache = directoryCache; - } - - public boolean isShowPathBar() { - return showPathBar; - } - - public void setShowPathBar(boolean showPathBar) { - this.showPathBar = showPathBar; - } - - public boolean isConfirmBeforeTerminalClosing() { - return confirmBeforeTerminalClosing; - } - - public void setConfirmBeforeTerminalClosing( - boolean confirmBeforeTerminalClosing) { - this.confirmBeforeTerminalClosing = confirmBeforeTerminalClosing; - } - - public boolean isUseDarkThemeForTerminal() { - return useDarkThemeForTerminal; - } - - public void setUseDarkThemeForTerminal(boolean useDarkThemeForTerminal) { - this.useDarkThemeForTerminal = useDarkThemeForTerminal; - } - - public boolean isShowMessagePrompt() { - return showMessagePrompt; - } - - public void setShowMessagePrompt(boolean showMessagePrompt) { - this.showMessagePrompt = showMessagePrompt; - } - - public int getDefaultOpenAction() { - return defaultOpenAction; - } - - public void setDefaultOpenAction(int defaultOpenAction) { - this.defaultOpenAction = defaultOpenAction; - } - - public int getNumberOfSimultaneousConnection() { - return numberOfSimultaneousConnection; - } - - public void setNumberOfSimultaneousConnection( - int numberOfSimultaneousConnection) { - this.numberOfSimultaneousConnection = numberOfSimultaneousConnection; - } - - public String getTerminalType() { - return terminalType; - } - - public void setTerminalType(String terminalType) { - this.terminalType = terminalType; - } - - public boolean isPuttyLikeCopyPaste() { - return puttyLikeCopyPaste; - } - - public void setPuttyLikeCopyPaste(boolean puttyLikeCopyPaste) { - this.puttyLikeCopyPaste = puttyLikeCopyPaste; - } - - public void setDefaultPanel(String defaultPanel) { - this.defaultPanel = defaultPanel; - } - - public String getDefaultPanel() { - return defaultPanel; - } } diff --git a/src/main/java/snowflake/common/SnowFlakePanel.java b/src/main/java/snowflake/common/SnowFlakePanel.java index d5c725e5..46d5c00b 100644 --- a/src/main/java/snowflake/common/SnowFlakePanel.java +++ b/src/main/java/snowflake/common/SnowFlakePanel.java @@ -1,5 +1,7 @@ package snowflake.common; +import lombok.Getter; + import java.util.Arrays; public enum SnowFlakePanel { @@ -7,7 +9,9 @@ public enum SnowFlakePanel { DISK_SPACE_ANALYZER("Disk space analyzer", "\uf1fe"), ACTIVE_TRANSFERS("Active transfers", "\uf252"), LINUX_TOOLS("Linux tools", "\uf085"), SSH_KEYS("SSH keys", "\uf084"), NETWORK_TOOLS("Network tools", "\uf0b1"); + @Getter private String name; + @Getter private String icon; SnowFlakePanel(String name, String icon) { @@ -15,14 +19,6 @@ public enum SnowFlakePanel { this.icon = icon; } - public String getName() { - return name; - } - - public String getIcon() { - return icon; - } - public static SnowFlakePanel fromName(String name) { return Arrays.stream(values()).filter(it -> it.getName().equals(name)).findFirst().get(); }