From fa3c08d274147f41d8c06c7086dd1449727d674c Mon Sep 17 00:00:00 2001 From: ozzi- Date: Wed, 17 Feb 2021 16:03:43 +0100 Subject: [PATCH] UI improvements Added frame borders due to contrast lacking with new burp look and feel Added label to jwt secret check field --- src/gui/JWTInterceptTab.java | 6 +++--- src/gui/JWTSuiteTab.java | 3 +++ src/gui/JWTViewTab.java | 33 +++++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/gui/JWTInterceptTab.java b/src/gui/JWTInterceptTab.java index fa495ae..c182b9d 100644 --- a/src/gui/JWTInterceptTab.java +++ b/src/gui/JWTInterceptTab.java @@ -88,13 +88,12 @@ private void drawGui() { JTextComponent.removeKeymap("RTextAreaKeymap"); jwtArea = new RSyntaxTextArea(20,60); - jwtArea.setMarginLinePosition(70); - jwtArea.setEOLMarkersVisible(true); - jwtArea.setWhitespaceVisible(true); UIManager.put("RSyntaxTextAreaUI.actionMap", null); UIManager.put("RSyntaxTextAreaUI.inputMap", null); UIManager.put("RTextAreaUI.actionMap", null); UIManager.put("RTextAreaUI.inputMap", null); + jwtArea.setMarginLinePosition(70); + jwtArea.setWhitespaceVisible(true); jwtArea.setMinimumSize(new Dimension(300, 300)); SyntaxScheme scheme = jwtArea.getSyntaxScheme(); @@ -198,6 +197,7 @@ private void drawGui() { jwtKeyArea = new JTextArea(""); jwtKeyArea.setRows(2); jwtKeyArea.setLineWrap(false); + jwtArea.setWhitespaceVisible(true); jwtKeyArea.setEnabled(false); GridBagConstraints gbc_keyField = new GridBagConstraints(); diff --git a/src/gui/JWTSuiteTab.java b/src/gui/JWTSuiteTab.java index 9784819..dce882c 100644 --- a/src/gui/JWTSuiteTab.java +++ b/src/gui/JWTSuiteTab.java @@ -154,6 +154,7 @@ public void actionPerformed(ActionEvent arg0) { add(configButton, gbc_configButton); jwtInputField = new JTextArea(); + jwtInputField.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border")); jwtInputField.setRows(2); jwtInputField.setLineWrap(true); jwtInputField.setWrapStyleWord(true); @@ -175,6 +176,7 @@ public void actionPerformed(ActionEvent arg0) { add(lblEnterSecret, gbc_lblEnterSecret); jwtKeyArea = new JTextArea(); + jwtKeyArea.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border")); GridBagConstraints gbc_jwtKeyField = new GridBagConstraints(); gbc_jwtKeyField.insets = new Insets(0, 0, 5, 5); gbc_jwtKeyField.fill = GridBagConstraints.HORIZONTAL; @@ -205,6 +207,7 @@ public void actionPerformed(ActionEvent arg0) { UIManager.put("RSyntaxTextAreaUI.inputMap", null); UIManager.put("RTextAreaUI.actionMap", null); UIManager.put("RTextAreaUI.inputMap", null); + jwtOuputField.setWhitespaceVisible(true); SyntaxScheme scheme = jwtOuputField.getSyntaxScheme(); Style style = new Style(); diff --git a/src/gui/JWTViewTab.java b/src/gui/JWTViewTab.java index e519eef..023fae3 100644 --- a/src/gui/JWTViewTab.java +++ b/src/gui/JWTViewTab.java @@ -7,6 +7,8 @@ import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.SystemColor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLabel; @@ -18,8 +20,6 @@ import javax.swing.event.DocumentListener; import javax.swing.text.JTextComponent; -import model.JWTTabModel; - import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import org.fife.ui.rsyntaxtextarea.Style; import org.fife.ui.rsyntaxtextarea.SyntaxConstants; @@ -28,6 +28,7 @@ import org.fife.ui.rtextarea.RTextScrollPane; import app.algorithm.AlgorithmType; +import model.JWTTabModel; public class JWTViewTab extends JPanel{ @@ -69,13 +70,8 @@ private void drawPanel() { gbc_inputLabel1.gridy = 1; add(keyLabel, gbc_inputLabel1); - JTextComponent.removeKeymap("RTextAreaKeymap"); jwtKeyArea = new JTextArea(); - UIManager.put("RSyntaxTextAreaUI.actionMap", null); - UIManager.put("RSyntaxTextAreaUI.inputMap", null); - UIManager.put("RTextAreaUI.actionMap", null); - UIManager.put("RTextAreaUI.inputMap", null); - + jwtKeyArea.setBorder(UIManager.getLookAndFeel().getDefaults().getBorder("TextField.border")); GridBagConstraints gbc_inputField1 = new GridBagConstraints(); gbc_inputField1.insets = new Insets(0, 0, 5, 5); gbc_inputField1.fill = GridBagConstraints.HORIZONTAL; @@ -85,6 +81,11 @@ private void drawPanel() { jwtKeyArea.setColumns(10); verificationIndicator = new JButton(""); + verificationIndicator.setText("No secret provided"); + verificationIndicator.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + } + }); Dimension preferredSize = new Dimension(400, 30); verificationIndicator.setPreferredSize(preferredSize); GridBagConstraints gbc_validIndicator = new GridBagConstraints(); @@ -92,8 +93,15 @@ private void drawPanel() { gbc_validIndicator.gridx = 1; gbc_validIndicator.gridy = 4; add(verificationIndicator, gbc_validIndicator); - + + JTextComponent.removeKeymap("RTextAreaKeymap"); outputField = new RSyntaxTextArea(); + UIManager.put("RSyntaxTextAreaUI.actionMap", null); + UIManager.put("RSyntaxTextAreaUI.inputMap", null); + UIManager.put("RTextAreaUI.actionMap", null); + UIManager.put("RTextAreaUI.inputMap", null); + + outputField.setWhitespaceVisible(true); SyntaxScheme scheme = outputField.getSyntaxScheme(); Style style = new Style(); style.foreground = new Color(222,133,10); @@ -190,7 +198,12 @@ public void run() { verificationIndicator.setBackground(jwtTM.getVerificationColor()); } if(!jwtTM.getVerificationLabel().equals(verificationIndicator.getText())){ - verificationIndicator.setText(jwtTM.getVerificationLabel()); + if(jwtTM.getVerificationLabel().equals("")) { + verificationIndicator.setText("No secret provided"); + }else { + verificationIndicator.setText(jwtTM.getVerificationLabel()); + } + } if(algorithmType.equals(AlgorithmType.symmetric)){ keyLabel.setText("Secret");