Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Removed all Markdown options.

Authordjarvis <email>
Date2016-12-09 20:54:28 GMT-0800
Commiteaf59c3413d766f89103398f5c0b23cc1ecdfe14
Parent59fbdea
Delta12 lines added, 43 lines removed, 31-line decrease
src/main/java/com/scrivenvar/service/impl/DefaultOptions.java
import com.scrivenvar.service.Options;
import static com.scrivenvar.util.Utils.putPrefs;
-import static com.scrivenvar.util.Utils.putPrefsInt;
import java.util.prefs.Preferences;
import static java.util.prefs.Preferences.userRoot;
-import javafx.beans.property.IntegerProperty;
-import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
-import org.pegdown.Extensions;
/**
* Persistent options user can change at runtime.
*
* @author Karl Tauber and White Magic Software, Ltd.
*/
public class DefaultOptions implements Options {
private final StringProperty LINE_SEPARATOR = new SimpleStringProperty();
private final StringProperty ENCODING = new SimpleStringProperty();
- private final IntegerProperty MARKDOWN_EXTENSIONS = new SimpleIntegerProperty();
private Preferences preferences;
setLineSeparator( options.get( "lineSeparator", null ) );
setEncoding( options.get( "encoding", null ) );
- setMarkdownExtensions( options.getInt( "markdownExtensions", Extensions.ALL ) );
}
@Override
public void save() {
final Preferences prefs = getPreferences();
putPrefs( prefs, "lineSeparator", getLineSeparator(), null );
putPrefs( prefs, "encoding", getEncoding(), null );
- putPrefsInt( prefs, "markdownExtensions", getMarkdownExtensions(), Extensions.ALL );
}
public StringProperty encodingProperty() {
return ENCODING;
- }
-
- @Override
- public int getMarkdownExtensions() {
- return MARKDOWN_EXTENSIONS.get();
- }
-
- @Override
- public void setMarkdownExtensions( int markdownExtensions ) {
- MARKDOWN_EXTENSIONS.set( markdownExtensions );
- }
-
- @Override
- public IntegerProperty markdownExtensionsProperty() {
- return MARKDOWN_EXTENSIONS;
}
}
src/main/java/com/scrivenvar/options/OptionsDialog.java
/*
- * Copyright (c) 2015 Karl Tauber <karl at jformdesigner dot com>
+ * Copyright 2016 Karl Tauber and White Magic Software, Ltd.
+ *
* All rights reserved.
*
package com.scrivenvar.options;
+import com.scrivenvar.Messages;
+import com.scrivenvar.Services;
+import com.scrivenvar.service.Options;
+import com.scrivenvar.service.events.impl.ButtonOrderPane;
import java.util.prefs.Preferences;
import javafx.event.ActionEvent;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
import javafx.scene.control.DialogPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Window;
-import com.scrivenvar.Messages;
-import com.scrivenvar.Services;
-import com.scrivenvar.service.Options;
/**
- * Options dialog
+ * Options dialog.
*
- * @author Karl Tauber
+ * @author Karl Tauber and White Magic Software, Ltd.
*/
public class OptionsDialog extends Dialog<Void> {
tabPane.getStyleClass().add( TabPane.STYLE_CLASS_FLOATING );
- DialogPane dialogPane = getDialogPane();
+ setDialogPane( new ButtonOrderPane() );
+
+ final DialogPane dialogPane = getDialogPane();
dialogPane.setContent( tabPane );
dialogPane.getButtonTypes().addAll( ButtonType.OK, ButtonType.CANCEL );
- // save options on OK clicked
dialogPane.lookupButton( ButtonType.OK ).addEventHandler( ActionEvent.ACTION, e -> {
save();
private void load() {
generalOptionsPane.load();
- markdownOptionsPane.load();
}
private void save() {
generalOptionsPane.save();
- markdownOptionsPane.save();
Services.load( Options.class ).save();
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
tabPane = new TabPane();
generalTab = new Tab();
generalOptionsPane = new GeneralOptionsPane();
- markdownTab = new Tab();
- markdownOptionsPane = new MarkdownOptionsPane();
//======== tabPane ========
{
tabPane.setTabClosingPolicy( TabPane.TabClosingPolicy.UNAVAILABLE );
//======== generalTab ========
{
generalTab.setText( Messages.get( "OptionsDialog.generalTab.text" ) );
generalTab.setContent( generalOptionsPane );
- }
-
- //======== markdownTab ========
- {
- markdownTab.setText( Messages.get( "OptionsDialog.markdownTab.text" ) );
- markdownTab.setContent( markdownOptionsPane );
}
- tabPane.getTabs().addAll( generalTab, markdownTab );
+ tabPane.getTabs().addAll( generalTab );
}
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private TabPane tabPane;
private Tab generalTab;
private GeneralOptionsPane generalOptionsPane;
- private Tab markdownTab;
- private MarkdownOptionsPane markdownOptionsPane;
// JFormDesigner - End of variables declaration //GEN-END:variables
}