Show palette for startup editors

This commit is contained in:
Alexander Lobas
2012-04-04 17:22:26 +04:00
parent ffa4b0e8a9
commit 90d9bf8f73
@@ -72,7 +72,7 @@ public class PaletteManager implements ProjectComponent {
myProject,
true);
myPaletteToolWindow.setIcon(IconLoader.getIcon("/general/toolWindowPalette.png"));
myPaletteToolWindow.setAvailable(false, null);
setContent();
final MyFileEditorManagerListener myListener = new MyFileEditorManagerListener();
myFileEditorManager.addFileEditorManagerListener(myListener, myProject);
}
@@ -159,17 +159,21 @@ public class PaletteManager implements ProjectComponent {
public void run() {
if (myPaletteWindow == null) return;
myPaletteWindow.refreshPaletteIfChanged(selectedFile);
if (myPaletteWindow.getActiveGroupCount() == 0) {
myPaletteToolWindow.setAvailable(false, null);
}
else {
myPaletteToolWindow.setAvailable(true, null);
myPaletteToolWindow.show(null);
}
setContent();
}
});
}
private void setContent() {
if (myPaletteWindow.getActiveGroupCount() == 0) {
myPaletteToolWindow.setAvailable(false, null);
}
else {
myPaletteToolWindow.setAvailable(true, null);
myPaletteToolWindow.show(null);
}
}
void notifyKeyEvent(final KeyEvent e) {
for(KeyListener l: myKeyListeners) {
if (e.getID() == KeyEvent.KEY_PRESSED) {