| | /* |
| | - * 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 |
| | } |