This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blink tab when request is send to extended macro.
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package burp; | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class Utils { | ||
|
||
public static void blinkTab(ITab iTab){ | ||
JTabbedPane tp = (JTabbedPane) iTab.getUiComponent().getParent(); | ||
int tabidx = getTabIndex(iTab); | ||
tp.setBackgroundAt(tabidx, BurpExtender.BURP_ORANGE); | ||
|
||
// unblink tab in 4 seconds | ||
Thread t1 = new Thread(new Runnable() { | ||
public void run() | ||
{ | ||
try { | ||
Thread.sleep(4000); | ||
|
||
unblinkTab(iTab); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
}}); | ||
t1.start(); | ||
} | ||
|
||
public static void unblinkTab(ITab iTab){ | ||
JTabbedPane tp = (JTabbedPane) iTab.getUiComponent().getParent(); | ||
int tabidx = getTabIndex(iTab); | ||
tp.setBackgroundAt(tabidx, Color.BLACK); | ||
} | ||
|
||
private static int getTabIndex(ITab iTab) { | ||
JTabbedPane mom = (JTabbedPane) iTab.getUiComponent().getParent();; | ||
for(int i = 0; i < mom.getTabCount(); ++i) { | ||
if(iTab.getTabCaption().equals(mom.getTitleAt(i))) { | ||
return i; | ||
} | ||
} | ||
return -1; | ||
} | ||
|
||
} |