Dave Jarvis' Repositories

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

Replace tie with underscore, move component listener

AuthorDaveJarvis <email>
Date2021-05-18 19:26:02 GMT-0700
Commit1bf3a7c6ea573192bb8066a79384120ec4d0b884
Parent7a6dd50
Delta501 lines added, 502 lines removed, 1-line decrease
src/main/java/com/keenwrite/ui/actions/ApplicationActions.java
* using their respective syntax.
*/
-@SuppressWarnings( "NonAsciiCharacters" )
-public final class ApplicationActions {
- private static final ExecutorService sExecutor = newFixedThreadPool( 1 );
-
- private static final String STYLE_SEARCH = "search";
-
- /**
- * Sci-fi genres, which are can be longer than other genres, typically fall
- * below 150,000 words at 6 chars per word. This reduces re-allocations of
- * memory when concatenating files together when exporting novels.
- */
- private static final int DOCUMENT_LENGTH = 150_000 * 6;
-
- /**
- * When an action is executed, this is one of the recipients.
- */
- private final MainPane mMainPane;
-
- private final MainScene mMainScene;
-
- private final LogView mLogView;
-
- /**
- * Tracks finding text in the active document.
- */
- private final SearchModel mSearchModel;
-
- public ApplicationActions( final MainScene scene, final MainPane pane ) {
- mMainScene = scene;
- mMainPane = pane;
- mLogView = new LogView();
- mSearchModel = new SearchModel();
- mSearchModel.matchOffsetProperty().addListener( ( c, o, n ) -> {
- final var editor = getActiveTextEditor();
-
- // Clear highlighted areas before highlighting a new region.
- if( o != null ) {
- editor.unstylize( STYLE_SEARCH );
- }
-
- if( n != null ) {
- editor.moveTo( n.getStart() );
- editor.stylize( n, STYLE_SEARCH );
- }
- } );
-
- // When the active text editor changes, update the haystack.
- mMainPane.activeTextEditorProperty().addListener(
- ( c, o, n ) -> mSearchModel.search( getActiveTextEditor().getText() )
- );
- }
-
- public void file‿new() {
- getMainPane().newTextEditor();
- }
-
- public void file‿open() {
- pickFiles( FILE_OPEN_MULTIPLE ).ifPresent( l -> getMainPane().open( l ) );
- }
-
- public void file‿close() {
- getMainPane().close();
- }
-
- public void file‿close_all() {
- getMainPane().closeAll();
- }
-
- public void file‿save() {
- getMainPane().save();
- }
-
- public void file‿save_as() {
- pickFiles( FILE_SAVE_AS ).ifPresent( l -> getMainPane().saveAs( l ) );
- }
-
- public void file‿save_all() {
- getMainPane().saveAll();
- }
-
- /**
- * Converts the actively edited file in the given file format.
- *
- * @param format The destination file format.
- */
- private void file‿export( final ExportFormat format ) {
- file‿export( format, false );
- }
-
- /**
- * Converts one or more files into the given file format. If {@code dir}
- * is set to true, this will first append all files in the same directory
- * as the actively edited file.
- *
- * @param format The destination file format.
- * @param dir Export all files in the actively edited file's directory.
- */
- private void file‿export( final ExportFormat format, final boolean dir ) {
- final var main = getMainPane();
- final var editor = main.getActiveTextEditor();
- final var filename = format.toExportFilename( editor.getPath() );
- final var selection = pickFiles( filename, FILE_EXPORT );
-
- selection.ifPresent( ( files ) -> {
- final var file = files.get( 0 );
- final var path = file.toPath();
- final var document = dir ? append( editor ) : editor.getText();
- final var context = main.createProcessorContext( path, format );
-
- final var task = new Task<Path>() {
- @Override
- protected Path call() throws Exception {
- final var chain = createProcessors( context );
- final var export = chain.apply( document );
-
- // Processors can export binary files. In such cases, processors
- // return null to prevent further processing.
- return export == null ? null : writeString( path, export );
- }
- };
-
- task.setOnSucceeded(
- e -> {
- final var result = task.getValue();
-
- // Binary formats must notify users of success independently.
- if( result != null ) {
- clue( "Main.status.export.success", result );
- }
- }
- );
-
- task.setOnFailed( e -> {
- final var ex = task.getException();
- clue( ex );
-
- if( ex instanceof TypeNotPresentException ) {
- fireExportFailedEvent();
- }
- } );
-
- sExecutor.execute( task );
- } );
- }
-
- /**
- * @param dir {@code true} means to export all files in the active file
- * editor's directory; {@code false} means to export only the
- * actively edited file.
- */
- private void file‿export‿pdf( final boolean dir ) {
- final var workspace = getWorkspace();
- final var themes = workspace.toFile( KEY_TYPESET_CONTEXT_THEMES_PATH );
- final var theme = workspace.stringProperty(
- KEY_TYPESET_CONTEXT_THEME_SELECTION );
-
- if( Typesetter.canRun() ) {
- // If the typesetter is installed, allow the user to select a theme. If
- // the themes aren't installed, a status message will appear.
- if( ThemePicker.choose( themes, theme ) ) {
- file‿export( APPLICATION_PDF, dir );
- }
- }
- else {
- fireExportFailedEvent();
- }
- }
-
- public void file‿export‿pdf() {
- file‿export‿pdf( false );
- }
-
- public void file‿export‿pdf‿dir() {
- file‿export‿pdf( true );
- }
-
- public void file‿export‿html_svg() {
- file‿export( HTML_TEX_SVG );
- }
-
- public void file‿export‿html_tex() {
- file‿export( HTML_TEX_DELIMITED );
- }
-
- public void file‿export‿xhtml_tex() {
- file‿export( XHTML_TEX );
- }
-
- public void file‿export‿markdown() {
- file‿export( MARKDOWN_PLAIN );
- }
-
- private void fireExportFailedEvent() {
- runLater( ExportFailedEvent::fireExportFailedEvent );
- }
-
- public void file‿exit() {
- final var window = getWindow();
- fireEvent( window, new WindowEvent( window, WINDOW_CLOSE_REQUEST ) );
- }
-
- public void edit‿undo() {
- getActiveTextEditor().undo();
- }
-
- public void edit‿redo() {
- getActiveTextEditor().redo();
- }
-
- public void edit‿cut() {
- getActiveTextEditor().cut();
- }
-
- public void edit‿copy() {
- getActiveTextEditor().copy();
- }
-
- public void edit‿paste() {
- getActiveTextEditor().paste();
- }
-
- public void edit‿select_all() {
- getActiveTextEditor().selectAll();
- }
-
- public void edit‿find() {
- final var nodes = getMainScene().getStatusBar().getLeftItems();
-
- if( nodes.isEmpty() ) {
- final var searchBar = new SearchBar();
-
- searchBar.matchIndexProperty().bind( mSearchModel.matchIndexProperty() );
- searchBar.matchCountProperty().bind( mSearchModel.matchCountProperty() );
-
- searchBar.setOnCancelAction( ( event ) -> {
- final var editor = getActiveTextEditor();
- nodes.remove( searchBar );
- editor.unstylize( STYLE_SEARCH );
- editor.getNode().requestFocus();
- } );
-
- searchBar.addInputListener( ( c, o, n ) -> {
- if( n != null && !n.isEmpty() ) {
- mSearchModel.search( n, getActiveTextEditor().getText() );
- }
- } );
-
- searchBar.setOnNextAction( ( event ) -> edit‿find_next() );
- searchBar.setOnPrevAction( ( event ) -> edit‿find_prev() );
-
- nodes.add( searchBar );
- searchBar.requestFocus();
- }
- else {
- nodes.clear();
- }
- }
-
- public void edit‿find_next() {
- mSearchModel.advance();
- }
-
- public void edit‿find_prev() {
- mSearchModel.retreat();
- }
-
- public void edit‿preferences() {
- try {
- new PreferencesController( getWorkspace() ).show();
- } catch( final Exception ex ) {
- clue( ex );
- }
- }
-
- public void format‿bold() {
- getActiveTextEditor().bold();
- }
-
- public void format‿italic() {
- getActiveTextEditor().italic();
- }
-
- public void format‿monospace() {
- getActiveTextEditor().monospace();
- }
-
- public void format‿superscript() {
- getActiveTextEditor().superscript();
- }
-
- public void format‿subscript() {
- getActiveTextEditor().subscript();
- }
-
- public void format‿strikethrough() {
- getActiveTextEditor().strikethrough();
- }
-
- public void insert‿blockquote() {
- getActiveTextEditor().blockquote();
- }
-
- public void insert‿code() {
- getActiveTextEditor().code();
- }
-
- public void insert‿fenced_code_block() {
- getActiveTextEditor().fencedCodeBlock();
- }
-
- public void insert‿link() {
- insertObject( createLinkDialog() );
- }
-
- public void insert‿image() {
- insertObject( createImageDialog() );
- }
-
- private void insertObject( final Dialog<String> dialog ) {
- final var textArea = getActiveTextEditor().getTextArea();
- dialog.showAndWait().ifPresent( textArea::replaceSelection );
- }
-
- private Dialog<String> createLinkDialog() {
- return new LinkDialog( getWindow(), createHyperlinkModel() );
- }
-
- private Dialog<String> createImageDialog() {
- final var path = getActiveTextEditor().getPath();
- final var parentDir = path.getParent();
- return new ImageDialog( getWindow(), parentDir );
- }
-
- /**
- * Returns one of: selected text, word under cursor, or parsed hyperlink from
- * the Markdown AST.
- *
- * @return An instance containing the link URL and display text.
- */
- private HyperlinkModel createHyperlinkModel() {
- final var context = getMainPane().createProcessorContext();
- final var editor = getActiveTextEditor();
- final var textArea = editor.getTextArea();
- final var selectedText = textArea.getSelectedText();
-
- // Convert current paragraph to Markdown nodes.
- final var mp = MarkdownProcessor.create( context );
- final var p = textArea.getCurrentParagraph();
- final var paragraph = textArea.getText( p );
- final var node = mp.toNode( paragraph );
- final var visitor = new LinkVisitor( textArea.getCaretColumn() );
- final var link = visitor.process( node );
-
- if( link != null ) {
- textArea.selectRange( p, link.getStartOffset(), p, link.getEndOffset() );
- }
-
- return createHyperlinkModel( link, selectedText );
- }
-
- private HyperlinkModel createHyperlinkModel(
- final Link link, final String selection ) {
-
- return link == null
- ? new HyperlinkModel( selection, "https://localhost" )
- : new HyperlinkModel( link );
- }
-
- public void insert‿heading_1() {
- insert‿heading( 1 );
- }
-
- public void insert‿heading_2() {
- insert‿heading( 2 );
- }
-
- public void insert‿heading_3() {
- insert‿heading( 3 );
- }
-
- private void insert‿heading( final int level ) {
- getActiveTextEditor().heading( level );
- }
-
- public void insert‿unordered_list() {
- getActiveTextEditor().unorderedList();
- }
-
- public void insert‿ordered_list() {
- getActiveTextEditor().orderedList();
- }
-
- public void insert‿horizontal_rule() {
- getActiveTextEditor().horizontalRule();
- }
-
- public void definition‿create() {
- getActiveTextDefinition().createDefinition();
- }
-
- public void definition‿rename() {
- getActiveTextDefinition().renameDefinition();
- }
-
- public void definition‿delete() {
- getActiveTextDefinition().deleteDefinitions();
- }
-
- public void definition‿autoinsert() {
- getMainPane().autoinsert();
- }
-
- public void view‿refresh() {
- getMainPane().viewRefresh();
- }
-
- public void view‿preview() {
- getMainPane().viewPreview();
- }
-
- public void view‿outline() {
- getMainPane().viewOutline();
- }
-
- public void view‿files() { getMainPane().viewFiles(); }
-
- public void view‿statistics() {
- getMainPane().viewStatistics();
- }
-
- public void view‿menubar() {
- getMainScene().toggleMenuBar();
- }
-
- public void view‿toolbar() {
- getMainScene().toggleToolBar();
- }
-
- public void view‿statusbar() {
- getMainScene().toggleStatusBar();
- }
-
- public void view‿log() {
- mLogView.view();
- }
-
- public void help‿about() {
+public final class ApplicationActions {
+ private static final ExecutorService sExecutor = newFixedThreadPool( 1 );
+
+ private static final String STYLE_SEARCH = "search";
+
+ /**
+ * Sci-fi genres, which are can be longer than other genres, typically fall
+ * below 150,000 words at 6 chars per word. This reduces re-allocations of
+ * memory when concatenating files together when exporting novels.
+ */
+ private static final int DOCUMENT_LENGTH = 150_000 * 6;
+
+ /**
+ * When an action is executed, this is one of the recipients.
+ */
+ private final MainPane mMainPane;
+
+ private final MainScene mMainScene;
+
+ private final LogView mLogView;
+
+ /**
+ * Tracks finding text in the active document.
+ */
+ private final SearchModel mSearchModel;
+
+ public ApplicationActions( final MainScene scene, final MainPane pane ) {
+ mMainScene = scene;
+ mMainPane = pane;
+ mLogView = new LogView();
+ mSearchModel = new SearchModel();
+ mSearchModel.matchOffsetProperty().addListener( ( c, o, n ) -> {
+ final var editor = getActiveTextEditor();
+
+ // Clear highlighted areas before highlighting a new region.
+ if( o != null ) {
+ editor.unstylize( STYLE_SEARCH );
+ }
+
+ if( n != null ) {
+ editor.moveTo( n.getStart() );
+ editor.stylize( n, STYLE_SEARCH );
+ }
+ } );
+
+ // When the active text editor changes, update the haystack.
+ mMainPane.activeTextEditorProperty().addListener(
+ ( c, o, n ) -> mSearchModel.search( getActiveTextEditor().getText() )
+ );
+ }
+
+ public void file_new() {
+ getMainPane().newTextEditor();
+ }
+
+ public void file_open() {
+ pickFiles( FILE_OPEN_MULTIPLE ).ifPresent( l -> getMainPane().open( l ) );
+ }
+
+ public void file_close() {
+ getMainPane().close();
+ }
+
+ public void file_close_all() {
+ getMainPane().closeAll();
+ }
+
+ public void file_save() {
+ getMainPane().save();
+ }
+
+ public void file_save_as() {
+ pickFiles( FILE_SAVE_AS ).ifPresent( l -> getMainPane().saveAs( l ) );
+ }
+
+ public void file_save_all() {
+ getMainPane().saveAll();
+ }
+
+ /**
+ * Converts the actively edited file in the given file format.
+ *
+ * @param format The destination file format.
+ */
+ private void file_export( final ExportFormat format ) {
+ file_export( format, false );
+ }
+
+ /**
+ * Converts one or more files into the given file format. If {@code dir}
+ * is set to true, this will first append all files in the same directory
+ * as the actively edited file.
+ *
+ * @param format The destination file format.
+ * @param dir Export all files in the actively edited file's directory.
+ */
+ private void file_export( final ExportFormat format, final boolean dir ) {
+ final var main = getMainPane();
+ final var editor = main.getActiveTextEditor();
+ final var filename = format.toExportFilename( editor.getPath() );
+ final var selection = pickFiles( filename, FILE_EXPORT );
+
+ selection.ifPresent( ( files ) -> {
+ final var file = files.get( 0 );
+ final var path = file.toPath();
+ final var document = dir ? append( editor ) : editor.getText();
+ final var context = main.createProcessorContext( path, format );
+
+ final var task = new Task<Path>() {
+ @Override
+ protected Path call() throws Exception {
+ final var chain = createProcessors( context );
+ final var export = chain.apply( document );
+
+ // Processors can export binary files. In such cases, processors
+ // return null to prevent further processing.
+ return export == null ? null : writeString( path, export );
+ }
+ };
+
+ task.setOnSucceeded(
+ e -> {
+ final var result = task.getValue();
+
+ // Binary formats must notify users of success independently.
+ if( result != null ) {
+ clue( "Main.status.export.success", result );
+ }
+ }
+ );
+
+ task.setOnFailed( e -> {
+ final var ex = task.getException();
+ clue( ex );
+
+ if( ex instanceof TypeNotPresentException ) {
+ fireExportFailedEvent();
+ }
+ } );
+
+ sExecutor.execute( task );
+ } );
+ }
+
+ /**
+ * @param dir {@code true} means to export all files in the active file
+ * editor's directory; {@code false} means to export only the
+ * actively edited file.
+ */
+ private void file_export_pdf( final boolean dir ) {
+ final var workspace = getWorkspace();
+ final var themes = workspace.toFile( KEY_TYPESET_CONTEXT_THEMES_PATH );
+ final var theme = workspace.stringProperty(
+ KEY_TYPESET_CONTEXT_THEME_SELECTION );
+
+ if( Typesetter.canRun() ) {
+ // If the typesetter is installed, allow the user to select a theme. If
+ // the themes aren't installed, a status message will appear.
+ if( ThemePicker.choose( themes, theme ) ) {
+ file_export( APPLICATION_PDF, dir );
+ }
+ }
+ else {
+ fireExportFailedEvent();
+ }
+ }
+
+ public void file_export_pdf() {
+ file_export_pdf( false );
+ }
+
+ public void file_export_pdf_dir() {
+ file_export_pdf( true );
+ }
+
+ public void file_export_html_svg() {
+ file_export( HTML_TEX_SVG );
+ }
+
+ public void file_export_html_tex() {
+ file_export( HTML_TEX_DELIMITED );
+ }
+
+ public void file_export_xhtml_tex() {
+ file_export( XHTML_TEX );
+ }
+
+ public void file_export_markdown() {
+ file_export( MARKDOWN_PLAIN );
+ }
+
+ private void fireExportFailedEvent() {
+ runLater( ExportFailedEvent::fireExportFailedEvent );
+ }
+
+ public void file_exit() {
+ final var window = getWindow();
+ fireEvent( window, new WindowEvent( window, WINDOW_CLOSE_REQUEST ) );
+ }
+
+ public void edit_undo() {
+ getActiveTextEditor().undo();
+ }
+
+ public void edit_redo() {
+ getActiveTextEditor().redo();
+ }
+
+ public void edit_cut() {
+ getActiveTextEditor().cut();
+ }
+
+ public void edit_copy() {
+ getActiveTextEditor().copy();
+ }
+
+ public void edit_paste() {
+ getActiveTextEditor().paste();
+ }
+
+ public void edit_select_all() {
+ getActiveTextEditor().selectAll();
+ }
+
+ public void edit_find() {
+ final var nodes = getMainScene().getStatusBar().getLeftItems();
+
+ if( nodes.isEmpty() ) {
+ final var searchBar = new SearchBar();
+
+ searchBar.matchIndexProperty().bind( mSearchModel.matchIndexProperty() );
+ searchBar.matchCountProperty().bind( mSearchModel.matchCountProperty() );
+
+ searchBar.setOnCancelAction( ( event ) -> {
+ final var editor = getActiveTextEditor();
+ nodes.remove( searchBar );
+ editor.unstylize( STYLE_SEARCH );
+ editor.getNode().requestFocus();
+ } );
+
+ searchBar.addInputListener( ( c, o, n ) -> {
+ if( n != null && !n.isEmpty() ) {
+ mSearchModel.search( n, getActiveTextEditor().getText() );
+ }
+ } );
+
+ searchBar.setOnNextAction( ( event ) -> edit_find_next() );
+ searchBar.setOnPrevAction( ( event ) -> edit_find_prev() );
+
+ nodes.add( searchBar );
+ searchBar.requestFocus();
+ }
+ else {
+ nodes.clear();
+ }
+ }
+
+ public void edit_find_next() {
+ mSearchModel.advance();
+ }
+
+ public void edit_find_prev() {
+ mSearchModel.retreat();
+ }
+
+ public void edit_preferences() {
+ try {
+ new PreferencesController( getWorkspace() ).show();
+ } catch( final Exception ex ) {
+ clue( ex );
+ }
+ }
+
+ public void format_bold() {
+ getActiveTextEditor().bold();
+ }
+
+ public void format_italic() {
+ getActiveTextEditor().italic();
+ }
+
+ public void format_monospace() {
+ getActiveTextEditor().monospace();
+ }
+
+ public void format_superscript() {
+ getActiveTextEditor().superscript();
+ }
+
+ public void format_subscript() {
+ getActiveTextEditor().subscript();
+ }
+
+ public void format_strikethrough() {
+ getActiveTextEditor().strikethrough();
+ }
+
+ public void insert_blockquote() {
+ getActiveTextEditor().blockquote();
+ }
+
+ public void insert_code() {
+ getActiveTextEditor().code();
+ }
+
+ public void insert_fenced_code_block() {
+ getActiveTextEditor().fencedCodeBlock();
+ }
+
+ public void insert_link() {
+ insertObject( createLinkDialog() );
+ }
+
+ public void insert_image() {
+ insertObject( createImageDialog() );
+ }
+
+ private void insertObject( final Dialog<String> dialog ) {
+ final var textArea = getActiveTextEditor().getTextArea();
+ dialog.showAndWait().ifPresent( textArea::replaceSelection );
+ }
+
+ private Dialog<String> createLinkDialog() {
+ return new LinkDialog( getWindow(), createHyperlinkModel() );
+ }
+
+ private Dialog<String> createImageDialog() {
+ final var path = getActiveTextEditor().getPath();
+ final var parentDir = path.getParent();
+ return new ImageDialog( getWindow(), parentDir );
+ }
+
+ /**
+ * Returns one of: selected text, word under cursor, or parsed hyperlink from
+ * the Markdown AST.
+ *
+ * @return An instance containing the link URL and display text.
+ */
+ private HyperlinkModel createHyperlinkModel() {
+ final var context = getMainPane().createProcessorContext();
+ final var editor = getActiveTextEditor();
+ final var textArea = editor.getTextArea();
+ final var selectedText = textArea.getSelectedText();
+
+ // Convert current paragraph to Markdown nodes.
+ final var mp = MarkdownProcessor.create( context );
+ final var p = textArea.getCurrentParagraph();
+ final var paragraph = textArea.getText( p );
+ final var node = mp.toNode( paragraph );
+ final var visitor = new LinkVisitor( textArea.getCaretColumn() );
+ final var link = visitor.process( node );
+
+ if( link != null ) {
+ textArea.selectRange( p, link.getStartOffset(), p, link.getEndOffset() );
+ }
+
+ return createHyperlinkModel( link, selectedText );
+ }
+
+ private HyperlinkModel createHyperlinkModel(
+ final Link link, final String selection ) {
+
+ return link == null
+ ? new HyperlinkModel( selection, "https://localhost" )
+ : new HyperlinkModel( link );
+ }
+
+ public void insert_heading_1() {
+ insert_heading( 1 );
+ }
+
+ public void insert_heading_2() {
+ insert_heading( 2 );
+ }
+
+ public void insert_heading_3() {
+ insert_heading( 3 );
+ }
+
+ private void insert_heading( final int level ) {
+ getActiveTextEditor().heading( level );
+ }
+
+ public void insert_unordered_list() {
+ getActiveTextEditor().unorderedList();
+ }
+
+ public void insert_ordered_list() {
+ getActiveTextEditor().orderedList();
+ }
+
+ public void insert_horizontal_rule() {
+ getActiveTextEditor().horizontalRule();
+ }
+
+ public void definition_create() {
+ getActiveTextDefinition().createDefinition();
+ }
+
+ public void definition_rename() {
+ getActiveTextDefinition().renameDefinition();
+ }
+
+ public void definition_delete() {
+ getActiveTextDefinition().deleteDefinitions();
+ }
+
+ public void definition_autoinsert() {
+ getMainPane().autoinsert();
+ }
+
+ public void view_refresh() {
+ getMainPane().viewRefresh();
+ }
+
+ public void view_preview() {
+ getMainPane().viewPreview();
+ }
+
+ public void view_outline() {
+ getMainPane().viewOutline();
+ }
+
+ public void view_files() { getMainPane().viewFiles(); }
+
+ public void view_statistics() {
+ getMainPane().viewStatistics();
+ }
+
+ public void view_menubar() {
+ getMainScene().toggleMenuBar();
+ }
+
+ public void view_toolbar() {
+ getMainScene().toggleToolBar();
+ }
+
+ public void view_statusbar() {
+ getMainScene().toggleStatusBar();
+ }
+
+ public void view_log() {
+ mLogView.view();
+ }
+
+ public void help_about() {
final var alert = new Alert( INFORMATION );
final var prefix = "Dialog.about.";
src/main/java/com/keenwrite/ui/actions/ApplicationBars.java
createMenu(
get( "Main.menu.file" ),
- addAction( "file.new", e -> actions.file‿new() ),
- addAction( "file.open", e -> actions.file‿open() ),
+ addAction( "file.new", e -> actions.file_new() ),
+ addAction( "file.open", e -> actions.file_open() ),
SEPARATOR_ACTION,
- addAction( "file.close", e -> actions.file‿close() ),
- addAction( "file.close_all", e -> actions.file‿close_all() ),
+ addAction( "file.close", e -> actions.file_close() ),
+ addAction( "file.close_all", e -> actions.file_close_all() ),
SEPARATOR_ACTION,
- addAction( "file.save", e -> actions.file‿save() ),
- addAction( "file.save_as", e -> actions.file‿save_as() ),
- addAction( "file.save_all", e -> actions.file‿save_all() ),
+ addAction( "file.save", e -> actions.file_save() ),
+ addAction( "file.save_as", e -> actions.file_save_as() ),
+ addAction( "file.save_all", e -> actions.file_save_all() ),
SEPARATOR_ACTION,
addAction( "file.export", e -> {} )
.addSubActions(
- addAction( "file.export.pdf", e -> actions.file‿export‿pdf() ),
- addAction( "file.export.pdf.dir", e -> actions.file‿export‿pdf‿dir() ),
- addAction( "file.export.html_svg", e -> actions.file‿export‿html_svg() ),
- addAction( "file.export.html_tex", e -> actions.file‿export‿html_tex() ),
- addAction( "file.export.xhtml_tex", e -> actions.file‿export‿xhtml_tex() ),
- addAction( "file.export.markdown", e -> actions.file‿export‿markdown() )
+ addAction( "file.export.pdf", e -> actions.file_export_pdf() ),
+ addAction( "file.export.pdf.dir", e -> actions.file_export_pdf_dir() ),
+ addAction( "file.export.html_svg", e -> actions.file_export_html_svg() ),
+ addAction( "file.export.html_tex", e -> actions.file_export_html_tex() ),
+ addAction( "file.export.xhtml_tex", e -> actions.file_export_xhtml_tex() ),
+ addAction( "file.export.markdown", e -> actions.file_export_markdown() )
),
SEPARATOR_ACTION,
- addAction( "file.exit", e -> actions.file‿exit() )
+ addAction( "file.exit", e -> actions.file_exit() )
),
createMenu(
get( "Main.menu.edit" ),
SEPARATOR_ACTION,
- addAction( "edit.undo", e -> actions.edit‿undo() ),
- addAction( "edit.redo", e -> actions.edit‿redo() ),
+ addAction( "edit.undo", e -> actions.edit_undo() ),
+ addAction( "edit.redo", e -> actions.edit_redo() ),
SEPARATOR_ACTION,
- addAction( "edit.cut", e -> actions.edit‿cut() ),
- addAction( "edit.copy", e -> actions.edit‿copy() ),
- addAction( "edit.paste", e -> actions.edit‿paste() ),
- addAction( "edit.select_all", e -> actions.edit‿select_all() ),
+ addAction( "edit.cut", e -> actions.edit_cut() ),
+ addAction( "edit.copy", e -> actions.edit_copy() ),
+ addAction( "edit.paste", e -> actions.edit_paste() ),
+ addAction( "edit.select_all", e -> actions.edit_select_all() ),
SEPARATOR_ACTION,
- addAction( "edit.find", e -> actions.edit‿find() ),
- addAction( "edit.find_next", e -> actions.edit‿find_next() ),
- addAction( "edit.find_prev", e -> actions.edit‿find_prev() ),
+ addAction( "edit.find", e -> actions.edit_find() ),
+ addAction( "edit.find_next", e -> actions.edit_find_next() ),
+ addAction( "edit.find_prev", e -> actions.edit_find_prev() ),
SEPARATOR_ACTION,
- addAction( "edit.preferences", e -> actions.edit‿preferences() )
+ addAction( "edit.preferences", e -> actions.edit_preferences() )
),
createMenu(
get( "Main.menu.format" ),
- addAction( "format.bold", e -> actions.format‿bold() ),
- addAction( "format.italic", e -> actions.format‿italic() ),
- addAction( "format.monospace", e -> actions.format‿monospace() ),
- addAction( "format.superscript", e -> actions.format‿superscript() ),
- addAction( "format.subscript", e -> actions.format‿subscript() ),
- addAction( "format.strikethrough", e -> actions.format‿strikethrough() )
+ addAction( "format.bold", e -> actions.format_bold() ),
+ addAction( "format.italic", e -> actions.format_italic() ),
+ addAction( "format.monospace", e -> actions.format_monospace() ),
+ addAction( "format.superscript", e -> actions.format_superscript() ),
+ addAction( "format.subscript", e -> actions.format_subscript() ),
+ addAction( "format.strikethrough", e -> actions.format_strikethrough() )
),
createMenu(
get( "Main.menu.insert" ),
- addAction( "insert.blockquote", e -> actions.insert‿blockquote() ),
- addAction( "insert.code", e -> actions.insert‿code() ),
- addAction( "insert.fenced_code_block", e -> actions.insert‿fenced_code_block() ),
+ addAction( "insert.blockquote", e -> actions.insert_blockquote() ),
+ addAction( "insert.code", e -> actions.insert_code() ),
+ addAction( "insert.fenced_code_block", e -> actions.insert_fenced_code_block() ),
SEPARATOR_ACTION,
- addAction( "insert.link", e -> actions.insert‿link() ),
- addAction( "insert.image", e -> actions.insert‿image() ),
+ addAction( "insert.link", e -> actions.insert_link() ),
+ addAction( "insert.image", e -> actions.insert_image() ),
SEPARATOR_ACTION,
- addAction( "insert.heading_1", e -> actions.insert‿heading_1() ),
- addAction( "insert.heading_2", e -> actions.insert‿heading_2() ),
- addAction( "insert.heading_3", e -> actions.insert‿heading_3() ),
+ addAction( "insert.heading_1", e -> actions.insert_heading_1() ),
+ addAction( "insert.heading_2", e -> actions.insert_heading_2() ),
+ addAction( "insert.heading_3", e -> actions.insert_heading_3() ),
SEPARATOR_ACTION,
- addAction( "insert.unordered_list", e -> actions.insert‿unordered_list() ),
- addAction( "insert.ordered_list", e -> actions.insert‿ordered_list() ),
- addAction( "insert.horizontal_rule", e -> actions.insert‿horizontal_rule() )
+ addAction( "insert.unordered_list", e -> actions.insert_unordered_list() ),
+ addAction( "insert.ordered_list", e -> actions.insert_ordered_list() ),
+ addAction( "insert.horizontal_rule", e -> actions.insert_horizontal_rule() )
),
createMenu(
get( "Main.menu.definition" ),
- addAction( "definition.insert", e -> actions.definition‿autoinsert() ),
+ addAction( "definition.insert", e -> actions.definition_autoinsert() ),
SEPARATOR_ACTION,
- addAction( "definition.create", e -> actions.definition‿create() ),
- addAction( "definition.rename", e -> actions.definition‿rename() ),
- addAction( "definition.delete", e -> actions.definition‿delete() )
+ addAction( "definition.create", e -> actions.definition_create() ),
+ addAction( "definition.rename", e -> actions.definition_rename() ),
+ addAction( "definition.delete", e -> actions.definition_delete() )
),
createMenu(
get( "Main.menu.view" ),
- addAction( "view.refresh", e -> actions.view‿refresh() ),
+ addAction( "view.refresh", e -> actions.view_refresh() ),
SEPARATOR_ACTION,
- addAction( "view.preview", e -> actions.view‿preview() ),
- addAction( "view.outline", e -> actions.view‿outline() ),
- addAction( "view.statistics", e-> actions.view‿statistics() ),
- addAction( "view.files", e-> actions.view‿files() ),
+ addAction( "view.preview", e -> actions.view_preview() ),
+ addAction( "view.outline", e -> actions.view_outline() ),
+ addAction( "view.statistics", e-> actions.view_statistics() ),
+ addAction( "view.files", e-> actions.view_files() ),
SEPARATOR_ACTION,
- addAction( "view.menubar", e -> actions.view‿menubar() ),
- addAction( "view.toolbar", e -> actions.view‿toolbar() ),
- addAction( "view.statusbar", e -> actions.view‿statusbar() ),
+ addAction( "view.menubar", e -> actions.view_menubar() ),
+ addAction( "view.toolbar", e -> actions.view_toolbar() ),
+ addAction( "view.statusbar", e -> actions.view_statusbar() ),
SEPARATOR_ACTION,
- addAction( "view.log", e -> actions.view‿log() )
+ addAction( "view.log", e -> actions.view_log() )
),
createMenu(
get( "Main.menu.help" ),
- addAction( "help.about", e -> actions.help‿about() )
+ addAction( "help.about", e -> actions.help_about() )
) );
//@formatter:on