/**
* Toggles between java mode and debug mode toolbar
*/
protected void switchToolbars(){
final EditorToolbar nextToolbar;
if(debugToolbarEnabled.get()){
// switch to java
if(javaToolbar == null)
javaToolbar = createToolbar();
nextToolbar = javaToolbar;
debugToolbarEnabled.set(false);
log("Switching to Java Mode Toolbar");
}
else{
// switch to debug
if(debugToolbar == null)
debugToolbar = new DebugToolbar(this, getBase());
nextToolbar = debugToolbar;
debugToolbarEnabled.set(true);
log("Switching to Debugger Toolbar");
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Box upper = (Box)splitPane.getComponent(0);
upper.remove(0);
upper.add(nextToolbar, 0);
upper.validate();
nextToolbar.repaint();
toolbar = nextToolbar;
// The toolbar responds to shift down/up events
// in order to show the alt version of toolbar buttons.
// With toolbar switch, KeyListener has to be changed as well
for (KeyListener kl : textarea.getKeyListeners()) {