mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 06:50:46 +00:00
replace in text parameters
This commit is contained in:
@@ -1185,23 +1185,32 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (TextTag textTag : textTags) {
|
for (TextTag textTag : textTags) {
|
||||||
List<String> texts = textTag.getTexts();
|
if (!replaceDialog.replaceInParametersCheckBox.isSelected()) {
|
||||||
boolean found = false;
|
List<String> texts = textTag.getTexts();
|
||||||
for (int i = 0; i < texts.size(); i++) {
|
boolean found = false;
|
||||||
String text = texts.get(i);
|
for (int i = 0; i < texts.size(); i++) {
|
||||||
|
String text = texts.get(i);
|
||||||
|
if (pat.matcher(text).find()) {
|
||||||
|
texts.set(i, text.replaceAll(txt, replacement));
|
||||||
|
found = true;
|
||||||
|
findCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found) {
|
||||||
|
String[] textArray = texts.toArray(new String[texts.size()]);
|
||||||
|
textTag.setFormattedText(getMissingCharacterHandler(), textTag.getFormattedText(), textArray);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String text = textTag.getFormattedText();
|
||||||
if (pat.matcher(text).find()) {
|
if (pat.matcher(text).find()) {
|
||||||
texts.set(i, text.replaceAll(txt, replacement));
|
textTag.setFormattedText(getMissingCharacterHandler(), text.replaceAll(txt, replacement), null);
|
||||||
found = true;
|
|
||||||
findCount++;
|
findCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found) {
|
|
||||||
String[] textArray = texts.toArray(new String[texts.size()]);
|
|
||||||
textTag.setFormattedText(getMissingCharacterHandler(), textTag.getFormattedText(), textArray);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (findCount > 0) {
|
if (findCount > 0) {
|
||||||
|
swf.clearImageCache();
|
||||||
refreshTree();
|
refreshTree();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ public class SearchDialog extends AppDialog implements ActionListener {
|
|||||||
public JTextField replaceField = new MyTextField();
|
public JTextField replaceField = new MyTextField();
|
||||||
public JCheckBox ignoreCaseCheckBox = new JCheckBox(translate("checkbox.ignorecase"));
|
public JCheckBox ignoreCaseCheckBox = new JCheckBox(translate("checkbox.ignorecase"));
|
||||||
public JCheckBox regexpCheckBox = new JCheckBox(translate("checkbox.regexp"));
|
public JCheckBox regexpCheckBox = new JCheckBox(translate("checkbox.regexp"));
|
||||||
|
public JCheckBox replaceInParametersCheckBox = new JCheckBox(translate("checkbox.replaceInParameters"));
|
||||||
public JRadioButton searchInASRadioButton = new JRadioButton(translate("checkbox.searchAS"));
|
public JRadioButton searchInASRadioButton = new JRadioButton(translate("checkbox.searchAS"));
|
||||||
public JRadioButton searchInTextsRadioButton = new JRadioButton(translate("checkbox.searchText"));
|
public JRadioButton searchInTextsRadioButton = new JRadioButton(translate("checkbox.searchText"));
|
||||||
public boolean result = false;
|
public boolean result = false;
|
||||||
@@ -89,6 +90,8 @@ public class SearchDialog extends AppDialog implements ActionListener {
|
|||||||
checkPanel.add(ignoreCaseCheckBox);
|
checkPanel.add(ignoreCaseCheckBox);
|
||||||
if (!replace) {
|
if (!replace) {
|
||||||
checkPanel.add(regexpCheckBox);
|
checkPanel.add(regexpCheckBox);
|
||||||
|
} else {
|
||||||
|
checkPanel.add(replaceInParametersCheckBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
cnt.add(checkPanel);
|
cnt.add(checkPanel);
|
||||||
|
|||||||
@@ -27,3 +27,4 @@ error.invalidregexp = Invalid pattern
|
|||||||
|
|
||||||
checkbox.searchText = Search in texts
|
checkbox.searchText = Search in texts
|
||||||
checkbox.searchAS = Search in AS
|
checkbox.searchAS = Search in AS
|
||||||
|
checkbox.replaceInParameters = Replace in parameters
|
||||||
|
|||||||
@@ -27,3 +27,4 @@ error.invalidregexp = \u00c9rv\u00e9nytelen minta
|
|||||||
|
|
||||||
checkbox.searchText = Keres\u00e9s a sz\u00f6vegek k\u00f6z\u00f6tt
|
checkbox.searchText = Keres\u00e9s a sz\u00f6vegek k\u00f6z\u00f6tt
|
||||||
checkbox.searchAS = Keres\u00e9s az ActionScriptekben
|
checkbox.searchAS = Keres\u00e9s az ActionScriptekben
|
||||||
|
checkbox.replaceInParameters = Param\u00e9retekben is cser\u00e9l
|
||||||
|
|||||||
Reference in New Issue
Block a user