diff --git a/changes.txt b/changes.txt index 9577efde..6894b7ab 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,4 @@ -0.2.10 +0.2.10 (2024-04-08) - Added support for language switching (zh, jp, ko) - Added support for basic macro - Reworked search toolbar UI diff --git a/src/main/java/org/exbin/bined/intellij/BinEdFileSystem.java b/src/main/java/org/exbin/bined/intellij/BinEdFileSystem.java index e04af093..47b400ce 100644 --- a/src/main/java/org/exbin/bined/intellij/BinEdFileSystem.java +++ b/src/main/java/org/exbin/bined/intellij/BinEdFileSystem.java @@ -40,7 +40,7 @@ public class BinEdFileSystem extends VirtualFileSystem implements DumbAware { private List fileListeners = new ArrayList<>(); private static class SingletonHelper { - private static final BinEdFileSystem INSTANCE = new BinEdFileSystem(); + static final BinEdFileSystem INSTANCE = new BinEdFileSystem(); } @Nonnull diff --git a/src/main/java/org/exbin/bined/intellij/debug/gui/DebugViewPanel.java b/src/main/java/org/exbin/bined/intellij/debug/gui/DebugViewPanel.java index 66a978bb..e44782bc 100644 --- a/src/main/java/org/exbin/bined/intellij/debug/gui/DebugViewPanel.java +++ b/src/main/java/org/exbin/bined/intellij/debug/gui/DebugViewPanel.java @@ -45,10 +45,6 @@ public class DebugViewPanel extends javax.swing.JPanel { public DebugViewPanel() { binEdEditorComponent = new BinEdEditorComponent(); - BinEdManager binEdManager = BinEdManager.getInstance(); - BinEdFileManager fileManager = binEdManager.getFileManager(); - fileManager.initComponentPanel(binEdEditorComponent.getComponentPanel()); - binEdManager.initEditorComponent(binEdEditorComponent); initComponents(); init(); diff --git a/src/main/java/org/exbin/bined/intellij/main/BinEdManager.java b/src/main/java/org/exbin/bined/intellij/main/BinEdManager.java index 59683c9a..5c34a49a 100644 --- a/src/main/java/org/exbin/bined/intellij/main/BinEdManager.java +++ b/src/main/java/org/exbin/bined/intellij/main/BinEdManager.java @@ -654,47 +654,52 @@ public void createContextMenu(BinEdEditorComponent editorComponent, @Nullable Fi menu.add(ActionUtils.actionToMenuItem(createEditSelectionAction(codeArea))); - menu.add(ActionUtils.actionToMenuItem(createInsertDataAction(editorComponent))); - menu.add(ActionUtils.actionToMenuItem(createConvertDataAction(editorComponent))); + if (fileHandler != null) { + menu.add(ActionUtils.actionToMenuItem(createInsertDataAction(editorComponent))); + menu.add(ActionUtils.actionToMenuItem(createConvertDataAction(editorComponent))); + } menu.addSeparator(); menu.add(ActionUtils.actionToMenuItem(createGoToAction(codeArea))); - findReplaceActions.resetActions(); - menu.add(ActionUtils.actionToMenuItem(findReplaceActions.getEditFindAction())); - menu.add(ActionUtils.actionToMenuItem(findReplaceActions.getEditReplaceAction())); - - bookmarksManager.resetBookmarksMenu(); - JMenu bookmarksMenu = bookmarksManager.getBookmarksMenu(); - bookmarksManager.updateBookmarksMenu(); - menu.add(bookmarksMenu); - - macroManager.resetMacrosMenu(); - macroManager.setEditorProvider(editorProvider); - JMenu macrosMenu = macroManager.getMacrosMenu(); - macroManager.updateMacrosMenu(); - macroManager.notifyMacroRecordingChange(codeArea); - menu.add(macrosMenu); + if (fileHandler != null) { + // TODO Make available in next version + findReplaceActions.resetActions(); + menu.add(ActionUtils.actionToMenuItem(findReplaceActions.getEditFindAction())); + menu.add(ActionUtils.actionToMenuItem(findReplaceActions.getEditReplaceAction())); + + bookmarksManager.resetBookmarksMenu(); + JMenu bookmarksMenu = bookmarksManager.getBookmarksMenu(); + bookmarksManager.updateBookmarksMenu(); + menu.add(bookmarksMenu); + + macroManager.resetMacrosMenu(); + macroManager.setEditorProvider(editorProvider); + JMenu macrosMenu = macroManager.getMacrosMenu(); + macroManager.updateMacrosMenu(); + macroManager.notifyMacroRecordingChange(codeArea); + menu.add(macrosMenu); + } } } menu.addSeparator(); JMenu toolsMenu = new JMenu(frameResourceBundle.getString("toolsMenu.text")); - toolsMenu.add(ActionUtils.actionToMenuItem(createCompareFilesAction(codeArea))); + if (fileHandler != null) { + toolsMenu.add(ActionUtils.actionToMenuItem(createCompareFilesAction(codeArea))); + } toolsMenu.add(ActionUtils.actionToMenuItem(createClipboardContentAction())); toolsMenu.add(ActionUtils.actionToMenuItem(createDragDropContentAction())); menu.add(toolsMenu); - if (editorComponent != null) { - if (fileHandler instanceof BinEdFileHandler || fileHandler instanceof BinEdNativeFile) { - JMenuItem reloadFileMenuItem = createReloadFileMenuItem(fileHandler); - menu.add(reloadFileMenuItem); - } + if (fileHandler instanceof BinEdFileHandler || fileHandler instanceof BinEdNativeFile) { + JMenuItem reloadFileMenuItem = createReloadFileMenuItem(fileHandler); + menu.add(reloadFileMenuItem); } - if (editorComponent != null) { + if (fileHandler != null) { final JMenuItem optionsMenuItem = new JMenuItem(optionsResourceBundle.getString("optionsAction.text") + "..."); optionsMenuItem.setToolTipText(optionsResourceBundle.getString("optionsAction.shortDescription")); optionsMenuItem.setIcon(new ImageIcon(getClass().getResource( diff --git a/src/main/java/org/exbin/bined/intellij/search/gui/BinarySearchPanel.java b/src/main/java/org/exbin/bined/intellij/search/gui/BinarySearchPanel.java index 58bf2544..9629554d 100644 --- a/src/main/java/org/exbin/bined/intellij/search/gui/BinarySearchPanel.java +++ b/src/main/java/org/exbin/bined/intellij/search/gui/BinarySearchPanel.java @@ -541,7 +541,7 @@ public void updateMatchStatus(boolean hasMatches, boolean prevMatchAvailable, bo prevMatchAction.setEnabled(prevMatchAvailable); nextMatchAction.setEnabled(nextMatchAvailable); replaceButton.setEnabled(hasMatches); - replaceAllButton.setEnabled(hasMatches); +// replaceAllButton.setEnabled(hasMatches); } public void setSearchHistory(List history) { diff --git a/src/main/java/org/exbin/framework/bined/BinEdFileManager.java b/src/main/java/org/exbin/framework/bined/BinEdFileManager.java index f2cbdcc3..dcd740a1 100644 --- a/src/main/java/org/exbin/framework/bined/BinEdFileManager.java +++ b/src/main/java/org/exbin/framework/bined/BinEdFileManager.java @@ -70,7 +70,7 @@ public void initComponentPanel(BinEdComponentPanel componentPanel) { for (BinEdFileExtension fileExtension : binEdComponentExtensions) { Optional componentExtension = fileExtension.createComponentExtension(componentPanel); - componentExtension.ifPresent((extension) -> { + componentExtension.ifPresent(extension -> { extension.setApplication(application); extension.onCreate(componentPanel); componentPanel.addComponentExtension(extension); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index bd96481c..54722836 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -5,7 +5,7 @@ BinEd - Binary/Hex Editor - 0.2.10.snapshot + 0.2.10 ExBin Project diff --git a/src/main/resources/org/exbin/bined/intellij/resources/Bundle.properties b/src/main/resources/org/exbin/bined/intellij/resources/Bundle.properties index afda05be..098a4070 100644 --- a/src/main/resources/org/exbin/bined/intellij/resources/Bundle.properties +++ b/src/main/resources/org/exbin/bined/intellij/resources/Bundle.properties @@ -1,9 +1,9 @@ Application.name = BinEd Application.title = BinEd Binary/Hex Editor Application.release = 0.2.10 -Application.mode = DEV -Application.version = 0.2.10 DEV -Application.product= BinEd Binary/Hex Editor 0.2.10 DEV +Application.mode = +Application.version = 0.2.10 +Application.product= BinEd Binary/Hex Editor 0.2.10 Application.vendor = ExBin Project Application.homepage = https://bined.exbin.org/intellij-plugin/ Application.vendorId = ExBin Project