Issues #316: Fixed undoable readonly editor panes

Warning about static const initializers shown only in const/static.
This commit is contained in:
Jindra Pet��k
2013-08-11 10:55:22 +02:00
parent 443aa3c98d
commit 1cc46522e7
8 changed files with 79 additions and 5 deletions
@@ -41,7 +41,7 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
private boolean showWarning = false;
public SlotConstTraitDetailPanel() {
slotConstEditor = new JEditorPane();
slotConstEditor = new UndoFixedEditorPane();
setLayout(new BorderLayout());
add(new JLabel(translate("abc.detail.slotconst.typevalue")), BorderLayout.NORTH);
add(new JScrollPane(slotConstEditor), BorderLayout.CENTER);
@@ -97,9 +97,15 @@ public class SlotConstTraitDetailPanel extends JPanel implements TraitDetail {
@Override
public void setEditMode(boolean val) {
if (val) {
if (val && active) {
JOptionPane.showMessageDialog(null, translate("warning.initializers"), translate("message.warning"), JOptionPane.WARNING_MESSAGE);
}
slotConstEditor.setEditable(val);
}
private boolean active = false;
@Override
public void setActive(boolean val) {
this.active = val;
}
}