Skip to content

Commit 50b4461

Browse files
committed
Release 0.2.0
1 parent 77e3a73 commit 50b4461

15 files changed

Lines changed: 87 additions & 90 deletions

File tree

changes.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
0.2.0
1+
0.2.0 (2019-04-13)
22
- Renamed to BinEd
33
- Updated to newer version of library
44
- Support for half-size space
55
- Support for layout, theme and colors profiles
6-
- Added support for different numerical types in status bar (issue #13)
7-
- Context aware popup menu (issue #12)
8-
- Fixed issue with copy as code for debug view (issue #10)
6+
- Added support for different numerical bases in status bar (issue #13)
7+
- Configurable address margin (issue #12)
8+
- Fixed issue with copy as code for debug view (issue #20)
99

1010
0.1.7 (2018-08-24)
1111
- Fixed issue with debugging in CLion (issue #4)

images/intellij-screenshot.png

-6.5 KB
Loading

resources/META-INF/plugin.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin version="2" url="https://bined.exbin.org/intellij-plugin">
2-
<id>org.exbin.bined.intellij</id>
2+
<id>org.exbin.deltahex.intellij</id>
33
<name>BinEd - Binary/Hexadecimal Editor</name>
4-
<version>0.2.0-SNAPSHOT</version>
4+
<version>0.2.0</version>
55
<vendor email="hajdam@users.sf.net" url="https://exbin.org">ExBin Project</vendor>
66

77
<description><![CDATA[
@@ -32,8 +32,8 @@ Sources: <a href="https://github.com/exbin/bined-intellij-plugin">https://github
3232
<li>Updated to newer version of library</li>
3333
<li>Support for half-size space</li>
3434
<li>Support for layout, theme and colors profiles</li>
35-
<li>Added support for different numerical types in status bar</li>
36-
<li>Context aware popup menu</li>
35+
<li>Added support for different numerical bases in status bar</li>
36+
<li>Configurable address margin</li>
3737
<li>Fixed issue with copy as code for debug view</li>
3838
</ul>
3939
]]>

resources/org/exbin/bined/intellij/resources/Bundle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Application.name = BinEd
22
Application.title = BinEd Binary/Hexadecimal Editor
33
Application.release = 0.2.0
4-
Application.mode = DEV
5-
Application.version = 0.2.0 DEV
6-
Application.product= BinEd Binary/Hexadecimal Editor 0.2.0 DEV
4+
Application.mode =
5+
Application.version = 0.2.0
6+
Application.product= BinEd Binary/Hexadecimal Editor 0.2.0
77
Application.vendor = ExBin Project
88
Application.homepage = https://bined.exbin.org/intellij-plugin/
99
Application.vendorId = ExBin Project

src/org/exbin/bined/intellij/BinEdFileEditor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void undoCommandAdded(final BinaryDataCommand command) {
175175
setNewData();
176176
CodeAreaOperationCommandHandler commandHandler = new CodeAreaOperationCommandHandler(codeArea, undoHandler);
177177
codeArea.setCommandHandler(commandHandler);
178-
editorPanel.add(codeArea, BorderLayout.CENTER);
178+
codeAreaPanel.add(codeArea, BorderLayout.CENTER);
179179
editorPanel.add(statusPanel, BorderLayout.SOUTH);
180180
registerBinaryStatus(statusPanel);
181181
goToRowAction = new GoToPositionAction(codeArea);
@@ -860,6 +860,7 @@ private JPopupMenu createContextMenu() {
860860
}
861861
if (actionType != OptionsControlHandler.ControlActionType.CANCEL) {
862862
setApplyOptions(optionsPanel.getApplyOptions());
863+
encodingsHandler.setEncodings(optionsPanel.getApplyOptions().getCharsetOptions().getEncodings());
863864
codeArea.repaint();
864865
}
865866

src/org/exbin/bined/intellij/GoToPositionAction.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.exbin.bined.intellij;
1717

18+
import org.exbin.bined.basic.PositionScrollVisibility;
1819
import org.exbin.bined.swing.extended.ExtCodeArea;
1920
import org.exbin.framework.bined.panel.GoToBinaryPanel;
2021
import org.exbin.framework.gui.utils.LanguageUtils;
@@ -34,7 +35,7 @@
3435
/**
3536
* Go to handler.
3637
*
37-
* @version 0.2.0 2019/03/22
38+
* @version 0.2.0 2019/04/13
3839
* @author ExBin Project (http://exbin.org)
3940
*/
4041
@ParametersAreNonnullByDefault
@@ -61,6 +62,10 @@ public void actionPerformed(ActionEvent event) {
6162
if (actionType == DefaultControlHandler.ControlActionType.OK) {
6263
goToPanel.acceptInput();
6364
codeArea.setCaretPosition(goToPanel.getGoToPosition());
65+
PositionScrollVisibility visibility = codeArea.getPainter().computePositionScrollVisibility(codeArea.getCaretPosition());
66+
if (visibility != PositionScrollVisibility.VISIBLE) {
67+
codeArea.centerOnCursor();
68+
}
6469
}
6570

6671
dialog.close();

src/org/exbin/bined/intellij/SearchAction.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public final class SearchAction implements ActionListener {
5151

5252
private final int metaMask;
5353
private boolean findTextPanelVisible = false;
54-
private BinarySearchPanel hexSearchPanel = null;
54+
private BinarySearchPanel binarySearchPanel = null;
5555
private final JPanel codeAreaPanel;
5656
private final ExtCodeArea codeArea;
5757

@@ -63,13 +63,13 @@ public SearchAction(ExtCodeArea codeArea, JPanel codeAreaPanel, int metaMask) {
6363

6464
@Override
6565
public void actionPerformed(ActionEvent e) {
66-
if (hexSearchPanel == null) {
67-
hexSearchPanel = new BinarySearchPanel(new BinarySearchPanelApi() {
66+
if (binarySearchPanel == null) {
67+
binarySearchPanel = new BinarySearchPanel(new BinarySearchPanelApi() {
6868
@Override
6969
public void performFind(SearchParameters searchParameters) {
7070
ExtendedHighlightCodeAreaPainter painter = (ExtendedHighlightCodeAreaPainter) codeArea.getPainter();
7171
SearchCondition condition = searchParameters.getCondition();
72-
hexSearchPanel.clearStatus();
72+
binarySearchPanel.clearStatus();
7373
if (condition.isEmpty()) {
7474
painter.clearMatches();
7575
codeArea.repaint();
@@ -120,7 +120,7 @@ public void setMatchPosition(int matchPosition) {
120120

121121
@Override
122122
public void updatePosition() {
123-
hexSearchPanel.updatePosition(codeArea.getCaretPosition().getDataPosition(), codeArea.getDataSize());
123+
binarySearchPanel.updatePosition(codeArea.getCaretPosition().getDataPosition(), codeArea.getDataSize());
124124
}
125125

126126
@Override
@@ -147,7 +147,7 @@ public void clearMatches() {
147147
painter.clearMatches();
148148
}
149149
});
150-
hexSearchPanel.setBinaryCodePopupMenuHandler(new CodeAreaPopupMenuHandler() {
150+
binarySearchPanel.setBinaryCodePopupMenuHandler(new CodeAreaPopupMenuHandler() {
151151
@Override
152152
public JPopupMenu createPopupMenu(ExtCodeArea codeArea, String menuPostfix) {
153153
return createCodeAreaPopupMenu(codeArea, menuPostfix);
@@ -157,27 +157,27 @@ public JPopupMenu createPopupMenu(ExtCodeArea codeArea, String menuPostfix) {
157157
public void dropPopupMenu(String menuPostfix) {
158158
}
159159
});
160-
hexSearchPanel.setClosePanelListener(this::hideSearchPanel);
160+
binarySearchPanel.setClosePanelListener(this::hideSearchPanel);
161161
}
162162

163163
if (!findTextPanelVisible) {
164-
codeAreaPanel.add(hexSearchPanel, BorderLayout.SOUTH);
164+
codeAreaPanel.add(binarySearchPanel, BorderLayout.NORTH);
165165
codeAreaPanel.revalidate();
166166
// revalidate();
167167
findTextPanelVisible = true;
168-
hexSearchPanel.requestSearchFocus();
168+
binarySearchPanel.requestSearchFocus();
169169
}
170170
}
171171

172172
public void switchReplaceMode(BinarySearchPanel.SearchOperation searchOperation) {
173-
hexSearchPanel.switchReplaceMode(searchOperation);
173+
binarySearchPanel.switchReplaceMode(searchOperation);
174174
}
175175

176176
public void hideSearchPanel() {
177177
if (findTextPanelVisible) {
178-
hexSearchPanel.cancelSearch();
179-
hexSearchPanel.clearSearch();
180-
codeAreaPanel.remove(hexSearchPanel);
178+
binarySearchPanel.cancelSearch();
179+
binarySearchPanel.clearSearch();
180+
codeAreaPanel.remove(binarySearchPanel);
181181
codeAreaPanel.revalidate();
182182
// revalidate();
183183
findTextPanelVisible = false;
@@ -263,7 +263,7 @@ private void searchForText(SearchParameters searchParameters) {
263263
ExtendedHighlightCodeAreaPainter.SearchMatch firstMatch = painter.getCurrentMatch();
264264
codeArea.revealPosition(new DefaultCodeAreaCaretPosition(firstMatch.getPosition(), 0, codeArea.getActiveSection()));
265265
}
266-
hexSearchPanel.setStatus(foundMatches.size(), 0);
266+
binarySearchPanel.setStatus(foundMatches.size(), 0);
267267
codeArea.repaint();
268268
}
269269

@@ -320,13 +320,13 @@ private void searchForBinaryData(SearchParameters searchParameters) {
320320
ExtendedHighlightCodeAreaPainter.SearchMatch firstMatch = painter.getCurrentMatch();
321321
codeArea.revealPosition(new DefaultCodeAreaCaretPosition(firstMatch.getPosition(), 0, codeArea.getActiveSection()));
322322
}
323-
hexSearchPanel.setStatus(foundMatches.size(), 0);
323+
binarySearchPanel.setStatus(foundMatches.size(), 0);
324324
codeArea.repaint();
325325
}
326326

327327
public void codeAreaDataChanged() {
328-
if (hexSearchPanel != null && hexSearchPanel.isVisible()) {
329-
hexSearchPanel.dataChanged();
328+
if (binarySearchPanel != null && binarySearchPanel.isVisible()) {
329+
binarySearchPanel.dataChanged();
330330
}
331331
}
332332

src/org/exbin/bined/intellij/panel/BinEdOptionsPanel.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ public void load() {
169169
editorOptions.loadFromParameters(preferences.getEditorParameters());
170170
statusOptions.loadFromParameters(preferences.getStatusParameters());
171171
codeAreaOptions.loadFromParameters(preferences.getCodeAreaParameters());
172+
charsetOptions.loadFromParameters(preferences.getCharsetParameters());
172173

173174
editorParametersPanel.loadFromOptions(editorOptions);
174175
statusParametersPanel.loadFromOptions(statusOptions);
175176
codeAreaParametersPanel.loadFromOptions(codeAreaOptions);
177+
charsetParametersPanel.loadFromOptions(charsetOptions);
176178

177179
charsetOptions.loadFromParameters(preferences.getCharsetParameters());
178180
layoutProfilesPanel.loadFromParameters(preferences.getLayoutParameters());
@@ -181,25 +183,25 @@ public void load() {
181183
colorSelectionPanel.setDefaultProfile(preferences.getColorParameters().getSelectedProfile());
182184
themeProfilesPanel.loadFromParameters(preferences.getThemeParameters());
183185
themeSelectionPanel.setDefaultProfile(preferences.getThemeParameters().getSelectedProfile());
184-
charsetParametersPanel.loadFromPreferences(preferences.getPreferences());
185186
}
186187

187188
public void store() {
188189
editorParametersPanel.saveToOptions(editorOptions);
189190
statusParametersPanel.saveToOptions(statusOptions);
190191
codeAreaParametersPanel.saveToOptions(codeAreaOptions);
192+
charsetParametersPanel.saveToOptions(charsetOptions);
191193

192194
editorOptions.saveToParameters(preferences.getEditorParameters());
193195
statusOptions.saveToParameters(preferences.getStatusParameters());
194196
codeAreaOptions.saveToParameters(preferences.getCodeAreaParameters());
197+
charsetOptions.saveToParameters(preferences.getCharsetParameters());
195198

196199
layoutProfilesPanel.saveToParameters(preferences.getLayoutParameters());
197200
preferences.getLayoutParameters().setSelectedProfile(layoutSelectionPanel.getDefaultProfile());
198201
colorProfilesPanel.saveToParameters(preferences.getColorParameters());
199202
preferences.getColorParameters().setSelectedProfile(colorSelectionPanel.getDefaultProfile());
200203
themeProfilesPanel.saveToParameters(preferences.getThemeParameters());
201204
preferences.getThemeParameters().setSelectedProfile(themeSelectionPanel.getDefaultProfile());
202-
charsetParametersPanel.saveToPreferences(preferences.getPreferences());
203205
}
204206

205207
public void setApplyOptions(BinEdApplyOptions applyOptions) {

src/org/exbin/framework/PreferencesWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void put(String key, @Nullable String value) {
5151
@Override
5252
public String get(String key, @Nullable String def) {
5353
String value = preferences.getValue(prefix + key, def == null ? "" : def);
54-
return "".equals(value) ? null : value;
54+
return "".equals(value) && def == null ? null : value;
5555
}
5656

5757
@Override

src/org/exbin/framework/bined/options/CodeAreaOptions.java

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@
1515
*/
1616
package org.exbin.framework.bined.options;
1717

18-
import java.awt.Font;
19-
import javax.annotation.Nonnull;
20-
import javax.annotation.ParametersAreNonnullByDefault;
2118
import org.exbin.bined.CodeAreaViewMode;
2219
import org.exbin.bined.CodeCharactersCase;
2320
import org.exbin.bined.CodeType;
2421
import org.exbin.bined.PositionCodeType;
2522
import org.exbin.bined.capability.CodeCharactersCaseCapable;
2623
import org.exbin.bined.capability.CodeTypeCapable;
27-
import org.exbin.bined.capability.RowWrappingCapable;
2824
import org.exbin.bined.capability.RowWrappingCapable.RowWrappingMode;
2925
import org.exbin.bined.capability.ViewModeCapable;
3026
import org.exbin.bined.extended.capability.PositionCodeTypeCapable;
@@ -34,6 +30,10 @@
3430
import org.exbin.bined.swing.extended.ExtCodeArea;
3531
import org.exbin.framework.bined.preferences.CodeAreaParameters;
3632

33+
import javax.annotation.Nonnull;
34+
import javax.annotation.ParametersAreNonnullByDefault;
35+
import java.awt.*;
36+
3737
/**
3838
* Code area options.
3939
*
@@ -44,7 +44,6 @@
4444
public class CodeAreaOptions {
4545

4646
private Font codeFont = null;
47-
private boolean rowWrapping = false;
4847
private CodeType codeType = CodeType.HEXADECIMAL;
4948
private boolean showUnprintables = true;
5049
private CodeCharactersCase codeCharactersCase = CodeCharactersCase.UPPER;
@@ -68,14 +67,6 @@ public void setCodeFont(Font codeFont) {
6867
this.codeFont = codeFont;
6968
}
7069

71-
public boolean isRowWrapping() {
72-
return rowWrapping;
73-
}
74-
75-
public void setRowWrapping(boolean rowWrapping) {
76-
this.rowWrapping = rowWrapping;
77-
}
78-
7970
@Nonnull
8071
public CodeType getCodeType() {
8172
return codeType;
@@ -171,7 +162,6 @@ public void setMaxRowPositionLength(int maxRowPositionLength) {
171162

172163
public void loadFromParameters(CodeAreaParameters parameters) {
173164
codeFont = parameters.getCodeFont(DEFAULT_FONT);
174-
rowWrapping = parameters.isRowWrapping();
175165
codeType = parameters.getCodeType();
176166
showUnprintables = parameters.isShowNonprintables();
177167
codeCharactersCase = parameters.getCodeCharactersCase();
@@ -187,7 +177,6 @@ public void loadFromParameters(CodeAreaParameters parameters) {
187177

188178
public void saveToParameters(CodeAreaParameters parameters) {
189179
parameters.setCodeFont(codeFont);
190-
parameters.setRowWrapping(rowWrapping);
191180
parameters.setCodeType(codeType);
192181
parameters.setShowUnprintables(showUnprintables);
193182
parameters.setCodeCharactersCase(codeCharactersCase);
@@ -203,7 +192,6 @@ public void saveToParameters(CodeAreaParameters parameters) {
203192

204193
public void applyFromCodeArea(ExtCodeArea codeArea) {
205194
codeFont = ((FontCapable) codeArea).getCodeFont();
206-
rowWrapping = ((RowWrappingCapable) codeArea).getRowWrapping() == RowWrappingMode.WRAPPING;
207195
codeType = ((CodeTypeCapable) codeArea).getCodeType();
208196
showUnprintables = ((ShowUnprintablesCapable) codeArea).isShowUnprintables();
209197
codeCharactersCase = ((CodeCharactersCaseCapable) codeArea).getCodeCharactersCase();
@@ -218,7 +206,6 @@ public void applyFromCodeArea(ExtCodeArea codeArea) {
218206

219207
public void applyToCodeArea(ExtCodeArea codeArea) {
220208
((FontCapable) codeArea).setCodeFont(useDefaultFont ? DEFAULT_FONT : codeFont);
221-
((RowWrappingCapable) codeArea).setRowWrapping(rowWrapping ? RowWrappingMode.WRAPPING : RowWrappingMode.NO_WRAPPING);
222209
((CodeTypeCapable) codeArea).setCodeType(codeType);
223210
((ShowUnprintablesCapable) codeArea).setShowUnprintables(showUnprintables);
224211
((CodeCharactersCaseCapable) codeArea).setCodeCharactersCase(codeCharactersCase);
@@ -233,7 +220,6 @@ public void applyToCodeArea(ExtCodeArea codeArea) {
233220

234221
public void setOptions(CodeAreaOptions codeAreaOptions) {
235222
codeFont = codeAreaOptions.codeFont;
236-
rowWrapping = codeAreaOptions.rowWrapping;
237223
codeType = codeAreaOptions.codeType;
238224
showUnprintables = codeAreaOptions.showUnprintables;
239225
codeCharactersCase = codeAreaOptions.codeCharactersCase;

0 commit comments

Comments
 (0)