Closed sttts closed 7 years ago
Thanks a lot for adding maximise/restore split feature! I just installed plugin locally and found couple problems (I might fix them myself or if you feel like sending a pull request or commenting that these are not problems, it'll be great :)) :
tabshifter.Actions#tabShifter
method.)
No such child: 0 java.lang.ArrayIndexOutOfBoundsException: No such child: 0
at java.awt.Container.getComponent(Container.java:334)
at tabshifter.Ide.snapshotWindowLayout(Ide.java:74)
at tabshifter.Ide.snapshotWindowLayout(Ide.java:79)
at tabshifter.Ide.snapshotWindowLayout(Ide.java:67)
at tabshifter.TabShifter.moveTab(TabShifter.java:60)
at tabshifter.Actions$ShiftRight.actionPerformed(Actions.java:25)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:199)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:215)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:587)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:634)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:204)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:633)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.c(IdeKeyEventDispatcher.java:477)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:657)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
The first two "issues" are kind of intentional.
About the second: I assumed that it's not possible to hide it completely (cleanly), at least not via setProportion
.
About the third: can you try to debug this? The only thing my patch is doing is resizing the splitter. Why should that influence getComponent
? I also changed that Ide
is static per project, compare https://github.com/dkandalov/tab-shifter/pull/10.
Regarding "usability issues" I agree that API doesn't make it easy. But I'll try to fix them anyway. E.g. it should be possible to save state of toolwindows (there is built-in action which does it).
getComponent
failed. Although I suspect in #10 projectTabShifter
field will now leak memory by keeping reference to Project
objects. <-- Hm, this was happening since #9 anyway via FileEditorManagerEx
. May be it's better to keep state in Project
itself.Right about leaking. We can also use a WeakReference.
I think this is probably more idiomatic for IJ codebase:
Disposer.register(project, new Disposable() {
@Override public void dispose() {
projectTabShifter.remove(project.getProjectFilePath());
}
});
Looks better indeed. I can create a PR if you are not on it already. Also let me know if you need some review or testing of the other changes.
I'm not actively working on it right now. Sure, review/testing is always useful :)
This adds the ToggleMaximizeRestore action (Alt-Shift-M) which toggles the current editor inside a splitter between maximal and original proportion, giving a "fullscreen effect". On maximization, also the tool windows are hidden.