-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from wstrei/master
Adding ability to have multiple profiles.
- Loading branch information
Showing
4 changed files
with
453 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package burp; | ||
|
||
import javax.swing.*; | ||
|
||
public class AWSSignerMenuItem extends JMenuItem { | ||
private int profileNumber; | ||
private String itemText; | ||
private boolean isEnabled; | ||
|
||
public AWSSignerMenuItem(String itemText, int profileNumber) { | ||
this.itemText = itemText; | ||
this.profileNumber = profileNumber; | ||
|
||
// This looks confusing, but "enabled" in terms of the menu item means it looks like you can | ||
// click on it. We want disabled items to be clickable, because they're the ones you want to change to | ||
isEnabled = false; | ||
this.setEnabled(true); | ||
} | ||
|
||
public boolean isProfileEnabled() { | ||
return isEnabled; | ||
} | ||
|
||
public void enableProfile() { | ||
|
||
// See comment in constructor to explain this weirdness | ||
isEnabled = true; | ||
this.setEnabled(false); | ||
} | ||
|
||
public void disableProfile() { | ||
|
||
// See comment in constructor to explain this weirdness | ||
isEnabled = false; | ||
this.setEnabled(true); | ||
} | ||
|
||
public int getProfileNumber() { | ||
return profileNumber; | ||
} | ||
|
||
public String toString() { | ||
return itemText; | ||
} | ||
|
||
@Override | ||
public String getText() { | ||
return toString(); | ||
} | ||
} |
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
Oops, something went wrong.