Skip to content

Commit

Permalink
Open correct tab when sending to Paramalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
JGillam committed Dec 23, 2018
1 parent 07793fe commit bf570f7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/com/professionallyevil/bc/Paramalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public java.util.List<JMenuItem> createMenuItems(IContextMenuInvocation invocati
IHttpRequestResponse selectedMessage = messages[0];
final byte[] requestBytes = selectedMessage.getRequest();
final IHttpService service = selectedMessage.getHttpService();
JMenuItem menuItem = new JMenuItem("Paramalyzer: Session");
JMenuItem menuItem = new JMenuItem("Send to Paramalyzer");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Expand All @@ -419,6 +419,23 @@ public void actionPerformed(ActionEvent e) {
sessionsTabbedPane.addTab("S:" + sessionsTabbedPane.getTabCount(), tab.getSessionTabPanel());
tab.initializeTab();
callbacks.customizeUiComponent(tab.getSessionTabPanel());

Component tabComponent = tab.getSessionTabPanel();
if (tabComponent != null) {
Container parent = tabComponent.getParent();
if (parent instanceof JTabbedPane) {
((JTabbedPane) parent).setSelectedComponent(tabComponent);
}

tabPane.setSelectedIndex(2);

Container mainParent = mainPanel.getParent();
if (mainParent instanceof JTabbedPane) {
((JTabbedPane) mainParent).setSelectedComponent(mainPanel);
}
}


// sessionsTabbedPane.setSelectedIndex(sessionsTabbedPane.getTabCount() - 1);
} catch (Exception e1) {
StringWriter sw = new StringWriter();
Expand Down

0 comments on commit bf570f7

Please sign in to comment.