enable save buttons only when text was changed

This commit is contained in:
honfika@gmail.com
2015-05-08 13:16:12 +02:00
parent 13ea982705
commit fa912d01ea
17 changed files with 5605 additions and 5518 deletions

View File

@@ -18,8 +18,8 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.gui.abc.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.gui.controls.JRepeatButton;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.helpers.HighlightedText;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
@@ -43,8 +43,6 @@ import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
/**
@@ -99,24 +97,8 @@ public class TextPanel extends JPanel implements TagEditorPanel {
textValue = new LineMarkedEditorPane();
add(new JScrollPane(textValue), BorderLayout.CENTER);
textValue.setFont(new Font("Monospaced", Font.PLAIN, textValue.getFont().getSize()));
textValue.setContentType("text/swftext");
textValue.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void removeUpdate(DocumentEvent e) {
textChanged();
}
@Override
public void changedUpdate(DocumentEvent e) {
textChanged();
}
});
textValue.changeContentType("text/swftext");
textValue.addTextChangedListener(this::textChanged);
JPanel textButtonsPanel = new JPanel();
textButtonsPanel.setLayout(new FlowLayout(SwingConstants.WEST));
@@ -370,7 +352,6 @@ public class TextPanel extends JPanel implements TagEditorPanel {
private void textChanged() {
setModified(true);
updateButtonsVisibility();
showTextComparingPreview();
}