no message
This commit is contained in:
@@ -8,12 +8,12 @@ import java.util.Vector;
|
||||
public class TextEditorMenu extends StyledPopupMenu {
|
||||
protected JTextComponent editor;
|
||||
protected String selectedText = null;
|
||||
protected JMenuItem m_strike;
|
||||
protected JMenuItem m_unstrike;
|
||||
//-------------------------------------------------
|
||||
JMenuItem m_cut;
|
||||
JMenuItem m_copy;
|
||||
JMenuItem m_paste;
|
||||
protected JMenuItem m_strike;
|
||||
protected JMenuItem m_unstrike;
|
||||
//-------------------------------------------------
|
||||
public TextEditorMenu(JTextComponent editor_in) {
|
||||
editor = editor_in;
|
||||
@@ -44,28 +44,28 @@ public class TextEditorMenu extends StyledPopupMenu {
|
||||
});
|
||||
add(m_paste);
|
||||
//--
|
||||
m_strike = new VisualiserMenuItem("Вычеркнуть","/icons/Editor/Strikethrough.png");
|
||||
m_strike = new VisualiserMenuItem("Вычеркнуть", "/icons/Editor/Strikethrough.png");
|
||||
m_strike.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
for (String line : data) {
|
||||
new_data.add(Utils_.strikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
}
|
||||
});
|
||||
add(m_strike);
|
||||
m_unstrike = new VisualiserMenuItem("Отменить вычёркивание","/icons/Editor/NoStrike.png");
|
||||
m_unstrike = new VisualiserMenuItem("Отменить вычёркивание", "/icons/Editor/NoStrike.png");
|
||||
m_unstrike.addActionListener(
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
for (String line : data) {
|
||||
new_data.add(Utils_.noStrikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
|
||||
Reference in New Issue
Block a user