Fixed bug 617156, "DuffPane ignores setEditable(false)".

I fixed this the easy way, by checking the value of isEditable() before
cutting, pasting, or adding typed text.  I may have missed a spot, but
checking at a lower level is a bit less efficient.

Fixing this the hard way, the keymaps-and-overridden-default-action way,
seems like it will make the code uglier, not cleaner.  And it won't get us
closer to fixing the killer bug, 614475, "Improper Line Wrapping".
This commit is contained in:
dchandler 2002-10-20 05:54:29 +00:00
parent 79776d44f9
commit 0097be4266
2 changed files with 26 additions and 7 deletions

View file

@ -277,6 +277,17 @@ public class Jskad extends JPanel implements DocumentListener {
toolsMenu.add(importItem);
}
if (ThdlOptions.getBooleanOption("thdl.add.developer.options.to.menu")) {
toolsMenu.addSeparator();
JMenuItem DevelItem = new JMenuItem("Toggle read-only");
DevelItem.addActionListener(new ThdlActionListener() {
public void theRealActionPerformed(ActionEvent e) {
dp.setEditable(!dp.isEditable());
}
});
toolsMenu.add(DevelItem);
}
menuBar.add(toolsMenu);
JMenu infoMenu = new JMenu("Info");