MyDoggy 文档和示例并没有真正的帮助(TutorialSet 有同样的问题,而 MyDoggySet 有不可读的代码),所以也许这里有人可以帮助我。
我正在构建一个编辑器,我想要可停靠的框架。我使用了 MyDoggy 但我有一个问题:当我调整窗口大小时,它不会调整内容大小,而是调整底部 ToolWindow 的大小,如下所示:
进入这个:
如何使文本编辑器(选项卡式组件)而不是 ToolWindow 调整大小?
这是一些相关的代码(对不起,混乱,它来自无数次尝试解决这个问题):
toolWindowManager = new MyDoggyToolWindowManager();
contentManager = toolWindowManager.getContentManager();
MultiSplitContentManagerUI contentManagerUI = new MyDoggyMultiSplitContentManagerUI();
contentManager.setContentManagerUI(contentManagerUI);
contentManagerUI.setShowAlwaysTab(true);
contentManagerUI.setTabPlacement(TabPlacement.TOP);
errorDisplay = toolWindowManager.registerToolWindow("Errors",
"Errors", null, new ErrorList(), ToolWindowAnchor.BOTTOM);
errorDisplay.setType(ToolWindowType.DOCKED);
DockedTypeDescriptor dockedTypeDescriptor = (DockedTypeDescriptor) errorDisplay
.getTypeDescriptor(ToolWindowType.DOCKED);
dockedTypeDescriptor.setDockLength(100);
dockedTypeDescriptor.setPopupMenuEnabled(true);
RepresentativeAnchorDescriptor<?> representativeAnchorDescriptor = errorDisplay
.getRepresentativeAnchorDescriptor();
representativeAnchorDescriptor.setPreviewEnabled(true);
representativeAnchorDescriptor.setPreviewDelay(1500);
representativeAnchorDescriptor.setPreviewTransparentRatio(0.4f);
errorDisplay.setAvailable(true);
errorDisplay.setActive(true);
newDocument();
for (ToolWindow window : toolWindowManager.getToolWindows())
window.setAvailable(true);
新文件:
...
Content c = cm.addContent("editor_untitled" + id, "Untitled " + id,
null, new EditorPane(), null, new MultiSplitConstraint(curDoc));
...
TabbedContentUI contentUI = (TabbedContentUI) c.getContentUI();
contentUI.setCloseable(true);
contentUI.setDetachable(true);
contentUI.setTransparentMode(true);
contentUI.setTransparentRatio(0.7f);
contentUI.setTransparentDelay(1000);