Search in sources :

Example 1 with FileViewer

use of com.mucommander.viewer.FileViewer in project mucommander by mucommander.

the class FileViewerPresenter method show.

@Override
protected void show(AbstractFile file) throws IOException {
    setCurrentFile(file);
    if (fileViewer == null) {
        MnemonicHelper menuItemMnemonicHelper = new MnemonicHelper();
        viewerMenu.addSeparator();
        closeMenuItem = MenuToolkit.addMenuItem(viewerMenu, Translator.get("file_viewer.close"), menuItemMnemonicHelper, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), (e) -> {
            fileViewer.close();
            getFrame().dispose();
        });
        viewerMenu.add(closeMenuItem);
        switchFileViewer(0);
    }
}
Also used : Cursor(java.awt.Cursor) ViewerPresenter(com.mucommander.viewer.ViewerPresenter) MenuToolkit(com.mucommander.commons.util.ui.helper.MenuToolkit) Function(java.util.function.Function) WarnUserException(com.mucommander.viewer.WarnUserException) FileViewerService(com.mucommander.viewer.FileViewerService) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) JMenuItem(javax.swing.JMenuItem) MnemonicHelper(com.mucommander.commons.util.ui.helper.MnemonicHelper) JFrame(javax.swing.JFrame) Translator(com.mucommander.text.Translator) JComponent(javax.swing.JComponent) JMenuBar(javax.swing.JMenuBar) KeyStroke(javax.swing.KeyStroke) FileTable(com.mucommander.ui.main.table.FileTable) ButtonGroup(javax.swing.ButtonGroup) JMenu(javax.swing.JMenu) IOException(java.io.IOException) KeyEvent(java.awt.event.KeyEvent) Logger(java.util.logging.Logger) List(java.util.List) FileViewer(com.mucommander.viewer.FileViewer) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) AbstractFile(com.mucommander.commons.file.AbstractFile) MnemonicHelper(com.mucommander.commons.util.ui.helper.MnemonicHelper)

Aggregations

AbstractFile (com.mucommander.commons.file.AbstractFile)1 MenuToolkit (com.mucommander.commons.util.ui.helper.MenuToolkit)1 MnemonicHelper (com.mucommander.commons.util.ui.helper.MnemonicHelper)1 Translator (com.mucommander.text.Translator)1 FileTable (com.mucommander.ui.main.table.FileTable)1 FileViewer (com.mucommander.viewer.FileViewer)1 FileViewerService (com.mucommander.viewer.FileViewerService)1 ViewerPresenter (com.mucommander.viewer.ViewerPresenter)1 WarnUserException (com.mucommander.viewer.WarnUserException)1 Cursor (java.awt.Cursor)1 KeyEvent (java.awt.event.KeyEvent)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Function (java.util.function.Function)1 Level (java.util.logging.Level)1 Logger (java.util.logging.Logger)1 ButtonGroup (javax.swing.ButtonGroup)1 JComponent (javax.swing.JComponent)1 JFrame (javax.swing.JFrame)1