Skip to content

Commit

Permalink
Fix space distribution in Formatting tab
Browse files Browse the repository at this point in the history
  • Loading branch information
felixb1515 committed Oct 30, 2024
1 parent 09bacae commit 8b76b34
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/de/usd/cstchef/view/RecipePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
Expand Down Expand Up @@ -127,6 +128,13 @@ public RecipePanel(BurpOperation operation, MessageType messageType) {
inputText = new BurpEditorWrapper(controllerOrig, messageType, this);
inputPanel.add(inputText.uiComponent());

/*
* This is necessary to have the distribution of space in all of the three RecipePanels uniform.
* Request and Response Editor have different default sizes than the Raw Editor.
*/
inputPanel.setPreferredSize(new Dimension(248, 0));
inputPanel.setMinimumSize(new Dimension(248, 0));

// create output panel
JPanel outputPanel = new LayoutPanel("Output");
outputText = new BurpEditorWrapper(controllerMod, messageType, this);
Expand Down Expand Up @@ -176,6 +184,10 @@ public void actionPerformed(ActionEvent arg0) {
JPanel operationsPanel = new LayoutPanel("Operations");
operationsPanel.add(searchTreePanel);
operationsPanel.setBackground(Color.WHITE);

operationsPanel.setPreferredSize(new Dimension(100, 0));
operationsPanel.setMinimumSize(new Dimension(100, 0));

inOut.setTopComponent(inputPanel);
inOut.setBottomComponent(outputPanel);
inOut.setResizeWeight(0.5);
Expand All @@ -193,6 +205,10 @@ public void actionPerformed(ActionEvent arg0) {
JButton filters = new JButton("Filter");
if(this.operation != BurpOperation.FORMAT)
activeOperationsPanel.addActionComponent(filters);

activeOperationsPanel.setPreferredSize(new Dimension(393, 0));
activeOperationsPanel.setMinimumSize(new Dimension(393, 0));

filters.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Expand Down Expand Up @@ -360,7 +376,7 @@ public void actionPerformed(ActionEvent e) {


JSplitPane opsInOut = new JSplitPane();
opsInOut.setResizeWeight(0.5);
opsInOut.setResizeWeight(0.7);

opsInOut.setLeftComponent(activeOperationsPanel);
opsInOut.setRightComponent(inOut);
Expand Down

0 comments on commit 8b76b34

Please sign in to comment.