mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 15:51:33 +00:00
AMF Editor display error message
This commit is contained in:
@@ -25,7 +25,6 @@ import com.jpexs.decompiler.flash.gui.generictageditors.ChangeListener;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ColorEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.GenericTagEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.NumberEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ScrollPanedEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.StringEditor;
|
||||
import com.jpexs.decompiler.flash.gui.helpers.SpringUtilities;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
@@ -413,7 +412,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
|
||||
} else if (type.equals(ByteArrayRange.class)) {
|
||||
editor = new BinaryDataEditor(mainPanel, name, obj, field, index, type);
|
||||
} else if (type.equals(Amf3Value.class)) {
|
||||
editor = new ScrollPanedEditor(new Amf3ValueEditor(name, obj, field, index, type));
|
||||
editor = new Amf3ValueEditor(name, obj, field, index, type);
|
||||
} else {
|
||||
if (value == null) {
|
||||
if (readonly) {
|
||||
@@ -501,10 +500,15 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void save() {
|
||||
public boolean save() {
|
||||
for (Object component : genericTagPropertiesEditPanel.getComponents()) {
|
||||
if (component instanceof GenericTagEditor) {
|
||||
((GenericTagEditor) component).save();
|
||||
try {
|
||||
((GenericTagEditor) component).validateValue();
|
||||
((GenericTagEditor) component).save();
|
||||
} catch (IllegalArgumentException iex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
SWF swf = tag.getSwf();
|
||||
@@ -512,6 +516,7 @@ public class GenericTagPanel extends JPanel implements ChangeListener {
|
||||
tag.setModified(true);
|
||||
tag.setSwf(swf);
|
||||
setTagText(tag);
|
||||
return true;
|
||||
}
|
||||
|
||||
public Tag getTag() {
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.gui.generictageditors.BooleanEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ColorEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.GenericTagEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.NumberEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.ScrollPanedEditor;
|
||||
import com.jpexs.decompiler.flash.gui.generictageditors.StringEditor;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
@@ -170,7 +169,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
} else if (type.equals(byte[].class) || type.equals(ByteArrayRange.class)) {
|
||||
editor = new BinaryDataEditor(mainPanel, field.getName(), obj, field, index, type);
|
||||
} else if (type.equals(Amf3Value.class)) {
|
||||
editor = new ScrollPanedEditor(new Amf3ValueEditor(field.getName(), obj, field, index, type));
|
||||
editor = new Amf3ValueEditor(field.getName(), obj, field, index, type);
|
||||
}
|
||||
if (editor != null) {
|
||||
if (editors == null) {
|
||||
@@ -250,19 +249,28 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopCellEditing() {
|
||||
super.stopCellEditing();
|
||||
|
||||
/*List<FieldNode> depends = ((MyTreeModel) tree.getModel()).getDependentFields(fnode);
|
||||
boolean dep = false;
|
||||
if (!depends.isEmpty()) {
|
||||
dep = true;
|
||||
} */
|
||||
public void cancelCellEditing() {
|
||||
if (editors != null) {
|
||||
for (GenericTagEditor editor : editors) {
|
||||
editor.save();
|
||||
editor.reset();
|
||||
}
|
||||
}
|
||||
super.cancelCellEditing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopCellEditing() {
|
||||
if (editors != null) {
|
||||
for (GenericTagEditor editor : editors) {
|
||||
try {
|
||||
editor.validateValue();
|
||||
editor.save();
|
||||
} catch (IllegalArgumentException iex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
super.stopCellEditing();
|
||||
|
||||
editors = null;
|
||||
|
||||
@@ -885,20 +893,23 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
tree.setEditable(edit);
|
||||
if (!edit) {
|
||||
tree.stopEditing();
|
||||
}
|
||||
tree.setEditable(edit);
|
||||
refreshTree();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
tree.stopEditing();
|
||||
SWF swf = tag.getSwf();
|
||||
assignTag(tag, editedTag);
|
||||
tag.setModified(true);
|
||||
tag.setSwf(swf);
|
||||
public boolean save() {
|
||||
if (tree.stopEditing()) {
|
||||
SWF swf = tag.getSwf();
|
||||
assignTag(tag, editedTag);
|
||||
tag.setModified(true);
|
||||
tag.setSwf(swf);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void assignTag(Tag t, Tag assigned) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,25 +18,55 @@ package com.jpexs.decompiler.flash.gui.generictageditors;
|
||||
|
||||
import com.jpexs.decompiler.flash.amf.amf3.Amf3Value;
|
||||
import com.jpexs.decompiler.flash.exporters.amf.amf3.Amf3Exporter;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
|
||||
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3ParseException;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.ReflectionTools;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Timer;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.event.CaretEvent;
|
||||
import javax.swing.event.CaretListener;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
public class Amf3ValueEditor extends JPanel implements GenericTagEditor {
|
||||
|
||||
private JEditorPane editor = new JEditorPane() {
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportWidth() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component.BaselineResizeBehavior getBaselineResizeBehavior() {
|
||||
return Component.BaselineResizeBehavior.CONSTANT_ASCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseline(int width, int height) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
private final Object obj;
|
||||
|
||||
@@ -48,32 +78,16 @@ public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
|
||||
private String fieldName;
|
||||
|
||||
private Amf3Value value;
|
||||
private final JLabel errorLabel = new JLabel();
|
||||
private Timer hideErrorTimer;
|
||||
private final int TIMEOUT = 5000;
|
||||
|
||||
@Override
|
||||
public void added() {
|
||||
String s = getText();
|
||||
setContentType("text/javascript");
|
||||
setText(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getScrollableTracksViewportWidth() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension ret = super.getPreferredSize();
|
||||
ret.width = 300;
|
||||
return ret;
|
||||
}*/
|
||||
@Override
|
||||
public Component.BaselineResizeBehavior getBaselineResizeBehavior() {
|
||||
return Component.BaselineResizeBehavior.CONSTANT_ASCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBaseline(int width, int height) {
|
||||
return 0;
|
||||
String s = editor.getText();
|
||||
editor.setContentType("text/javascript");
|
||||
editor.setText(s);
|
||||
}
|
||||
|
||||
public Amf3ValueEditor(String fieldName, Object obj, Field field, int index, Class<?> type) {
|
||||
@@ -82,13 +96,31 @@ public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
this.index = index;
|
||||
this.type = type;
|
||||
this.fieldName = fieldName;
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
Dimension d = new Dimension(500, 330);
|
||||
setSize(d);
|
||||
setPreferredSize(d);
|
||||
|
||||
add(new JScrollPane(editor), BorderLayout.CENTER);
|
||||
add(errorLabel, BorderLayout.SOUTH);
|
||||
errorLabel.setBackground(Color.red);
|
||||
errorLabel.setForeground(Color.white);
|
||||
errorLabel.setOpaque(true);
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
Amf3Value val = (Amf3Value) ReflectionTools.getValue(obj, field, index);
|
||||
if (val == null || val.getValue() == null) {
|
||||
setText("");
|
||||
value = (Amf3Value) ReflectionTools.getValue(obj, field, index);
|
||||
if (value == null || value.getValue() == null) {
|
||||
editor.setText("");
|
||||
} else {
|
||||
String stringVal = Amf3Exporter.amfToString(val.getValue());
|
||||
setText(stringVal);
|
||||
String stringVal = Amf3Exporter.amfToString(value.getValue());
|
||||
editor.setText(stringVal);
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
// ignore
|
||||
@@ -98,8 +130,10 @@ public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
@Override
|
||||
public void save() {
|
||||
try {
|
||||
ReflectionTools.setValue(obj, field, index, getChangedValue());
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Object val = getChangedValue();
|
||||
ReflectionTools.setValue(obj, field, index, val);
|
||||
value = (Amf3Value) val;
|
||||
} catch (IllegalAccessException ex) {
|
||||
//ignore
|
||||
}
|
||||
}
|
||||
@@ -107,7 +141,7 @@ public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
@Override
|
||||
public void addChangeListener(final ChangeListener l) {
|
||||
final GenericTagEditor t = this;
|
||||
addFocusListener(new FocusAdapter() {
|
||||
editor.addFocusListener(new FocusAdapter() {
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
@@ -117,16 +151,39 @@ public class Amf3ValueEditor extends JEditorPane implements GenericTagEditor {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
|
||||
Amf3Importer importer = new Amf3Importer();
|
||||
String textVal = editor.getText();
|
||||
try {
|
||||
if (!textVal.trim().isEmpty()) {
|
||||
importer.stringToAmf(textVal);
|
||||
}
|
||||
} catch (IOException | Amf3ParseException ex) {
|
||||
final CaretListener cl = new CaretListener() {
|
||||
@Override
|
||||
public void caretUpdate(CaretEvent e) {
|
||||
errorLabel.setVisible(false);
|
||||
editor.removeCaretListener(this);
|
||||
}
|
||||
};
|
||||
editor.addCaretListener(cl);
|
||||
errorLabel.setText("<html>" + AppStrings.translate("error") + ":" + ex.getMessage() + "</html>");
|
||||
errorLabel.setVisible(true);
|
||||
throw new IllegalArgumentException("Invalid AMF value", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getChangedValue() {
|
||||
Amf3Importer importer = new Amf3Importer();
|
||||
String textVal = getText();
|
||||
String textVal = editor.getText();
|
||||
try {
|
||||
return textVal.trim().isEmpty() ? null : new Amf3Value(importer.stringToAmf(textVal));
|
||||
} catch (IOException | Amf3ParseException ex) {
|
||||
//ignore
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,16 @@ public class BinaryDataEditor extends JButton implements GenericTagEditor {
|
||||
this.fieldName = fieldName;
|
||||
setText(AppStrings.translate("button.replace"));
|
||||
addActionListener(this::buttonActionPerformed);
|
||||
reset();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
Object val = ReflectionTools.getValue(obj, field, index);
|
||||
if (val instanceof byte[]) {
|
||||
|
||||
@@ -50,6 +50,15 @@ public class BooleanEditor extends JCheckBox implements GenericTagEditor {
|
||||
this.index = index;
|
||||
this.type = type;
|
||||
this.fieldName = fieldName;
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
setSelected((boolean) ReflectionTools.getValue(obj, field, index));
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ColorEditor extends JPanel implements GenericTagEditor, ActionListe
|
||||
|
||||
private int colorType;
|
||||
|
||||
private JButton buttonChange;
|
||||
private final JButton buttonChange;
|
||||
|
||||
public int getColorType() {
|
||||
return colorType;
|
||||
@@ -86,6 +86,38 @@ public class ColorEditor extends JPanel implements GenericTagEditor, ActionListe
|
||||
this.index = index;
|
||||
this.type = type;
|
||||
this.fieldName = fieldName;
|
||||
|
||||
setLayout(new FlowLayout());
|
||||
|
||||
buttonChange = new JButton("") {
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
g.setColor(getBackground());
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
super.paintBorder(g);
|
||||
}
|
||||
|
||||
};
|
||||
buttonChange.setToolTipText(AppStrings.translate("button.selectcolor.hint"));
|
||||
buttonChange.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||
buttonChange.addActionListener(this);
|
||||
|
||||
buttonChange.setBorderPainted(true);
|
||||
buttonChange.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
|
||||
Dimension colorDim = new Dimension(16, 16);
|
||||
buttonChange.setSize(colorDim);
|
||||
buttonChange.setPreferredSize(colorDim);
|
||||
add(buttonChange);
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
Object val = ReflectionTools.getValue(obj, field, index);
|
||||
if (val instanceof RGBA) {
|
||||
@@ -103,33 +135,11 @@ public class ColorEditor extends JPanel implements GenericTagEditor, ActionListe
|
||||
if (val instanceof ARGB) {
|
||||
color = ((ARGB) val).toColor();
|
||||
}
|
||||
setLayout(new FlowLayout());
|
||||
|
||||
//add(colorPanel);
|
||||
buttonChange = new JButton("") {
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
g.setColor(getBackground());
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
super.paintBorder(g);
|
||||
}
|
||||
|
||||
};
|
||||
buttonChange.setToolTipText(AppStrings.translate("button.selectcolor.hint"));
|
||||
buttonChange.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||
buttonChange.addActionListener(this);
|
||||
buttonChange.setBackground(color);
|
||||
buttonChange.setBorderPainted(true);
|
||||
buttonChange.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
|
||||
Dimension colorDim = new Dimension(16, 16);
|
||||
buttonChange.setSize(colorDim);
|
||||
buttonChange.setPreferredSize(colorDim);
|
||||
add(buttonChange);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,7 +147,7 @@ public class ColorEditor extends JPanel implements GenericTagEditor, ActionListe
|
||||
Object val = getChangedValue();
|
||||
try {
|
||||
ReflectionTools.setValue(obj, field, index, val);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
} catch (IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ public interface GenericTagEditor {
|
||||
|
||||
public void added();
|
||||
|
||||
public void reset();
|
||||
|
||||
public void save();
|
||||
|
||||
public void addChangeListener(ChangeListener l);
|
||||
@@ -37,4 +39,6 @@ public interface GenericTagEditor {
|
||||
public Field getField();
|
||||
|
||||
public String getReadOnlyValue();
|
||||
|
||||
public void validateValue();
|
||||
}
|
||||
|
||||
@@ -71,12 +71,19 @@ public class NumberEditor extends JSpinner implements GenericTagEditor {
|
||||
this.type = type;
|
||||
this.swfType = swfType;
|
||||
this.fieldName = fieldName;
|
||||
|
||||
JFormattedTextField jtf = ((JSpinner.NumberEditor) getEditor()).getTextField();
|
||||
DefaultFormatter formatter = (DefaultFormatter) jtf.getFormatter();
|
||||
formatter.setCommitsOnValidEdit(true);
|
||||
reset();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
Object value = ReflectionTools.getValue(obj, field, index);
|
||||
setModel(getModel(swfType, value));
|
||||
JFormattedTextField jtf = ((JSpinner.NumberEditor) getEditor()).getTextField();
|
||||
DefaultFormatter formatter = (DefaultFormatter) jtf.getFormatter();
|
||||
formatter.setCommitsOnValidEdit(true);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
@@ -195,6 +202,10 @@ public class NumberEditor extends JSpinner implements GenericTagEditor {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getChangedValue() {
|
||||
Object value = null;
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Jindra
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.generictageditors;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.lang.reflect.Field;
|
||||
import javax.swing.JScrollPane;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ScrollPanedEditor extends JScrollPane implements GenericTagEditor {
|
||||
|
||||
private final GenericTagEditor editor;
|
||||
|
||||
public ScrollPanedEditor(GenericTagEditor editor) {
|
||||
super((Component) editor);
|
||||
this.editor = editor;
|
||||
Dimension d = new Dimension(500, 300);
|
||||
setSize(d);
|
||||
setPreferredSize(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
editor.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangeListener(ChangeListener l) {
|
||||
editor.addChangeListener(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getChangedValue() {
|
||||
return editor.getChangedValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFieldName() {
|
||||
return editor.getFieldName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Field getField() {
|
||||
return editor.getField();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReadOnlyValue() {
|
||||
return editor.getReadOnlyValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void added() {
|
||||
editor.added();
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,11 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
|
||||
setPreferredSize(d);
|
||||
setSize(d);
|
||||
}
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
try {
|
||||
setText((String) ReflectionTools.getValue(obj, field, index));
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
@@ -89,7 +94,7 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
|
||||
public void save() {
|
||||
try {
|
||||
ReflectionTools.setValue(obj, field, index, getText());
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
} catch (IllegalAccessException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
@@ -131,4 +136,8 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
|
||||
public void added() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateValue() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user