-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sharelatex' of github.com:JabRef/jabref into sharelatex
* 'sharelatex' of github.com:JabRef/jabref: Refactor ShareLatexPreferences
- Loading branch information
Showing
5 changed files
with
119 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/main/java/org/jabref/logic/sharelatex/ShareLatexPreferences.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package org.jabref.logic.sharelatex; | ||
|
||
import java.util.Optional; | ||
import java.util.prefs.BackingStoreException; | ||
|
||
public class ShareLatexPreferences { | ||
|
||
private String defaultNode; | ||
private String parentNode; | ||
private String sharelatexUser; | ||
private String shareLatexUrl; | ||
private String shareLatexPassword; | ||
private boolean shareLatexRememberPassword; | ||
private String shareLatexProject; | ||
|
||
public ShareLatexPreferences(String defaultNode, String parentNode, String getSharelatexUser, String shareLatexUrl, String shareLatexPassword, boolean shareLatexRememberPassword, String shareLatexProject) { | ||
this.defaultNode = defaultNode; | ||
this.parentNode = parentNode; | ||
this.sharelatexUser = getSharelatexUser; | ||
this.shareLatexUrl = shareLatexUrl; | ||
this.shareLatexPassword = shareLatexPassword; | ||
this.shareLatexRememberPassword = shareLatexRememberPassword; | ||
this.shareLatexProject = shareLatexProject; | ||
} | ||
|
||
public String getSharelatexUrl() { | ||
return getOptionalValue(shareLatexUrl).orElse("https://www.sharelatex.com"); | ||
} | ||
|
||
public Optional<String> getUser() { | ||
return getOptionalValue(sharelatexUser); | ||
} | ||
|
||
public Optional<String> getPassword() { | ||
return getOptionalValue(shareLatexPassword); | ||
} | ||
|
||
public Optional<String> getDefaultProject() { | ||
return getOptionalValue(shareLatexProject); | ||
} | ||
|
||
|
||
public String getDefaultNode() { | ||
return defaultNode; | ||
} | ||
|
||
public String getParentNode() { | ||
return parentNode; | ||
} | ||
|
||
public boolean getShareLatexRememberPassword() { | ||
return shareLatexRememberPassword; | ||
} | ||
|
||
|
||
public void setSharelatexUrl(String url) { | ||
this.shareLatexUrl = url; | ||
} | ||
|
||
public void setSharelatexUser(String user) { | ||
this.sharelatexUser = user; | ||
} | ||
|
||
public void setSharelatexPassword(String pwd) { | ||
this.shareLatexPassword = pwd; | ||
} | ||
|
||
public void setSharelatexProject(String project) { | ||
this.shareLatexProject = project; | ||
} | ||
|
||
public void setRememberPassword(boolean rememberPassword) { | ||
this.shareLatexRememberPassword = rememberPassword; | ||
} | ||
|
||
|
||
public void clear() throws BackingStoreException { | ||
} | ||
|
||
private Optional<String> getOptionalValue(String key) { | ||
return Optional.ofNullable(key); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 0 additions & 83 deletions
83
src/main/java/org/jabref/logic/sharelatex/SharelatexPreferences.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters