Skip to content

Commit

Permalink
Update TextAreaMenu.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Sep 3, 2024
1 parent 6887cb7 commit c6a1c3f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Tools/TextAreaMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

import javax.swing.AbstractAction;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;

import org.apache.commons.lang3.StringUtils;

import com.bit4woo.utilbox.utils.IPAddressUtils;
import com.bit4woo.utilbox.utils.TextUtils;

Expand Down Expand Up @@ -136,6 +139,32 @@ public void actionPerformed(ActionEvent actionEvent) {
guiMain.getDomainPanel().saveDomainDataToDB();
}
});


JMenuItem addToTargetWithComment = new JMenuItem(new AbstractAction("Add To Target With Comment") {
@Override
public void actionPerformed(ActionEvent actionEvent) {

String comment = JOptionPane.showInputDialog("Comment", "");
if (StringUtils.isBlank(comment)) {
return;
}

DomainManager domainResult = guiMain.getDomainPanel().getDomainResult();
for (String item:selectedItems) {
try {
if (IPAddressUtils.isValidIPv4MayPort(item)) {
domainResult.getSpecialPortTargets().add(item);
}else {
domainResult.addToTargetAndSubDomain(item,true,AssetTrustLevel.Confirm,comment);
}
} catch (Exception e2) {
e2.printStackTrace(stderr);
}
}
guiMain.getDomainPanel().saveDomainDataToDB();
}
});

JMenuItem doOnlineSearch = new JMenuItem(new AbstractAction("Do Online Search") {
@Override
Expand All @@ -153,6 +182,7 @@ public void actionPerformed(ActionEvent actionEvent) {
this.add(genPortScanCmd);
this.add(addToTarget);
this.add(addToTargetConfirm);
this.add(addToTargetWithComment);
this.add(doOnlineSearch);
}
}

0 comments on commit c6a1c3f

Please sign in to comment.