本文介绍了在哪里指定窗口组件的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在netBean平台中创建了模块,然后在此处创建了窗口组件,我想在主窗口中指定默认位置.例如位置编辑".我在哪里可以做到?

I created module in netBean platform, then I created window component there, and I want to specify default position in main window. For exapmle position "editor". Where I can do it?

推荐答案

看起来NB WindowManager似乎无法以类似于您所要求的方式为窗口指定位置.屏幕分为多个区域(称为模式),有些方法可让您将window/TopComponent置于模式中.

It does not look like the NB WindowManager has a way to specify a position for a window in a manner similar to what you are asking. The screen is broken up into areas (known as modes) and there are methods that let you position a window/TopComponent into a mode.

可以很好地概述NB窗口系统的文件.它具有指向更多详细信息的链接,这些信息将为您提供帮助.

There is a document that provides a good overview of the NB windowing system. It has links to more detailed info that will help you.

用于重新定位窗口的另一种策略是编辑与模块关联的图层文件.该文件通常称为"layer.xml".

Another strategy to use to reposition a window is to edit the layer file associated with your module. This file is usually called 'layer.xml'.

寻找类似于以下内容的条目

Look for an entry like the following

<folder name="Windows2">
    <folder name="Components">
        <file name="MyEditorWindowTopComponent.settings" url="MyEditorWindowTopComponentSettings.xml"/>
    </folder>
    <folder name="Modes">
        <folder name="editor">
            <file name="MyEditorWindowTopComponent.wstcref" url="MyEditorWindowTopComponentWstcref.xml"/>
        </folder>
    </folder>
</folder>

在模式"下更改子文件夹的名称,使其与您想要的新位置/模式值相匹配...

Change the name of the subfolder under "Modes" to match the value that you want as the new position/mode...

这篇关于在哪里指定窗口组件的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 15:35