2012-11-17 209 views
0

MyDoggy文檔和示例並不真正有用(TutorialSet具有相同的問題,而MyDoggySet具有不可讀的代碼),所以也許這裏有人可以幫助我。MyDoggy:調整窗口大小而不是底部ToolWindow時調整內容大小?

我正在建立一個編輯器,我想可停靠的框架。我用MyDoggy但我有一個問題:當我調整,而不是調整的內容的窗口,它會調整的底部工具窗口,如下所示:

Before resizing

成這樣:

After resizing

如何讓文本編輯器(選項卡組件)的大小改變而不是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); 

回答

相關問題