no message

This commit is contained in:
2024-10-14 15:19:13 +03:00
parent 8eef367bd4
commit 5e09fb44ea
634 changed files with 3751 additions and 3263 deletions

View File

@@ -1,12 +1,12 @@
package _VisualDVM.Visual.Windows;
import Common.Utils.Utils_;
import Common.Visual.UI_;
import Common.Visual.Windows.Form;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Trees.StyledTree;
import Common.Visual.UI_;
import Common.Visual.Windows.Form;
import _VisualDVM.Global;
import _VisualDVM.Visual.UI;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.UI;
import javafx.util.Pair;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rtextarea.SearchContext;
@@ -22,6 +22,8 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.LinkedHashMap;
public class SearchReplaceForm extends Form {
public static String lastProjectPath = "";
public static LinkedHashMap<String, Long> matches = new LinkedHashMap<>();
public JPanel MainPanel;
public boolean forward = true;
SearchContext context = null;
@@ -39,6 +41,58 @@ public class SearchReplaceForm extends Form {
private JCheckBox loopOn;
private JLabel lCount;
private SearchResult result = null;
//------------------
//-
private JButton bSearchInFiles;
private JPanel filesTreePanel;
private JLabel lFilesMatchesCount;
public SearchReplaceForm() {
context = new SearchContext();
//-
context.setRegularExpression(true);
//-
rbDown.addActionListener(e -> SwitchDirection(!forward));
rbUp.addActionListener(e -> SwitchDirection(!forward));
bAll.addActionListener(e -> onAll());
bNext.addActionListener(e -> onNext());
replaceOn.addActionListener(e -> {
setMode(replaceOn.isSelected());
});
bNext.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER)
bNext.doClick();
}
});
tfFind.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_ENTER:
bNext.requestFocus();
bNext.doClick();
break;
}
}
});
bSearchInFiles.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
showNoFilesMatches();
lastProjectPath = Global.mainModule.getProject().Home.getAbsolutePath();
matches = Global.mainModule.getProject().getMatches(
tfFind.getText(),
registerOn.isSelected(),
wholeWordOn.isSelected());
showFilesMatches();
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
//https://techarks.ru/qa/java/kak-uznat-kakoj-iz-jlist-s-Y4/
public void ClearMarkers() {
//сброс выделения. решается подсовыванием пустой строки
@@ -135,13 +189,6 @@ public class SearchReplaceForm extends Form {
tfFind = new StyledTextField();
tfReplace = new StyledTextField();
}
//------------------
//-
private JButton bSearchInFiles;
private JPanel filesTreePanel;
private JLabel lFilesMatchesCount;
public static String lastProjectPath = "";
public static LinkedHashMap<String, Long> matches = new LinkedHashMap<>();
public void dropFilesMatches() {
matches = new LinkedHashMap<>();
}
@@ -202,51 +249,4 @@ public class SearchReplaceForm extends Form {
Refresh();
// setAlwaysOnTop(true);
}
public SearchReplaceForm() {
context = new SearchContext();
//-
context.setRegularExpression(true);
//-
rbDown.addActionListener(e -> SwitchDirection(!forward));
rbUp.addActionListener(e -> SwitchDirection(!forward));
bAll.addActionListener(e -> onAll());
bNext.addActionListener(e -> onNext());
replaceOn.addActionListener(e -> {
setMode(replaceOn.isSelected());
});
bNext.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER)
bNext.doClick();
}
});
tfFind.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_ENTER:
bNext.requestFocus();
bNext.doClick();
break;
}
}
});
bSearchInFiles.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
showNoFilesMatches();
lastProjectPath = Global.mainModule.getProject().Home.getAbsolutePath();
matches = Global.mainModule.getProject().getMatches(
tfFind.getText(),
registerOn.isSelected(),
wholeWordOn.isSelected());
showFilesMatches();
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
}