Search in sources :

Example 76 with Preferences

use of java.util.prefs.Preferences in project jgnash by ccavanaugh.

the class AbstractCrosstabReport method refreshReport.

@Override
protected void refreshReport() {
    final Preferences p = getPreferences();
    p.putBoolean(HIDE_ZERO_BALANCE, hideZeroBalanceAccounts.isSelected());
    p.putBoolean(USE_LONG_NAMES, showLongNamesCheckBox.isSelected());
    p.putInt(MONTHS, DateUtils.getLastDayOfTheMonths(startDateField.getLocalDate(), endDateField.getLocalDate()).size());
    super.refreshReport();
}
Also used : Preferences(java.util.prefs.Preferences)

Example 77 with Preferences

use of java.util.prefs.Preferences in project jgnash by ccavanaugh.

the class PortfolioReport method refreshReport.

@Override
protected void refreshReport() {
    Preferences p = getPreferences();
    p.putBoolean(RECURSIVE, subAccountCheckBox.isSelected());
    p.putBoolean(USE_LONG_NAMES, verboseCheckBox.isSelected());
    super.refreshReport();
}
Also used : Preferences(java.util.prefs.Preferences)

Example 78 with Preferences

use of java.util.prefs.Preferences in project ceylon-compiler by ceylon.

the class Launcher method main.

public static void main(String... args) {
    JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
    JFileChooser fileChooser;
    Preferences prefs = Preferences.userNodeForPackage(Launcher.class);
    if (args.length > 0)
        fileChooser = new JFileChooser(args[0]);
    else {
        String fileName = prefs.get("recent.file", null);
        fileChooser = new JFileChooser();
        if (fileName != null) {
            fileChooser = new JFileChooser();
            fileChooser.setSelectedFile(new File(fileName));
        }
    }
    if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
        String fileName = fileChooser.getSelectedFile().getPath();
        prefs.put("recent.file", fileName);
        javac.run(System.in, null, null, "-d", "/tmp", fileName);
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) JavaCompiler(javax.tools.JavaCompiler) Preferences(java.util.prefs.Preferences) File(java.io.File)

Example 79 with Preferences

use of java.util.prefs.Preferences in project jgnash by ccavanaugh.

the class DateUtils method setDateFormatPattern.

public static void setDateFormatPattern(@NotNull final String pattern) throws IllegalArgumentException {
    Objects.requireNonNull(pattern);
    final Preferences preferences = Preferences.userNodeForPackage(DateUtils.class);
    preferences.put(DATE_FORMAT, pattern);
    try {
        shortDateFormatter = DateTimeFormatter.ofPattern(pattern).withResolverStyle(ResolverStyle.SMART);
        shortDateManualEntryFormatter = DateTimeFormatter.ofPattern(getShortDateManualEntryPattern()).withResolverStyle(ResolverStyle.SMART);
    } catch (IllegalArgumentException e) {
        throw new IllegalArgumentException(e);
    }
}
Also used : Preferences(java.util.prefs.Preferences)

Example 80 with Preferences

use of java.util.prefs.Preferences in project jgnash by ccavanaugh.

the class AbstractAuthenticator method setUseProxy.

public static void setUseProxy(boolean use) {
    final Preferences pref = Preferences.userRoot().node(NODEHTTP);
    pref.putBoolean(USEPROXY, use);
}
Also used : Preferences(java.util.prefs.Preferences)

Aggregations

Preferences (java.util.prefs.Preferences)291 BackingStoreException (java.util.prefs.BackingStoreException)49 File (java.io.File)45 ResourceBundle (java.util.ResourceBundle)24 FileChooser (javafx.stage.FileChooser)21 ArrayList (java.util.ArrayList)17 FXML (javafx.fxml.FXML)16 IOException (java.io.IOException)14 JFileChooser (javax.swing.JFileChooser)12 List (java.util.List)8 SwingWorker (javax.swing.SwingWorker)8 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)7 Engine (jgnash.engine.Engine)7 AutoCompletePreferences (org.jabref.logic.autocompleter.AutoCompletePreferences)6 FieldContentParserPreferences (org.jabref.logic.bibtex.FieldContentParserPreferences)6 LatexFieldFormatterPreferences (org.jabref.logic.bibtex.LatexFieldFormatterPreferences)6 BibtexKeyPatternPreferences (org.jabref.logic.bibtexkeypattern.BibtexKeyPatternPreferences)6 CleanupPreferences (org.jabref.logic.cleanup.CleanupPreferences)6 ImportFormatPreferences (org.jabref.logic.importer.ImportFormatPreferences)6 JournalAbbreviationPreferences (org.jabref.logic.journals.JournalAbbreviationPreferences)6