NetBeans 7.3自定义/编辑工具栏位置 [英] NetBeans 7.3 customise/Edit Toolbar positions

查看:111
本文介绍了NetBeans 7.3自定义/编辑工具栏位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为客户端创建了新的TopComonent,然后向主工具栏和主菜单下拉列表的view文件夹中添加了新的图标单击操作.但是我的问题是,我将动作设置到的每个位置总是将其放在工具栏的开头,但我需要在结尾.

I have create new TopComonent for a client and then added new icon click action to the main toolbar and in view folder from main menu drop down list. But my problem is that what every position I set the action to it always puts it at start of toolbar but I need it at the end.

@ActionID(
        category = "Build",
        id = "some.action")
@ActionRegistration(
        iconBase = "path.to.icom.image",
        displayName = "someName")
@ActionReferences({
    @ActionReference(path = "Menu/View", position = 400),
    @ActionReference(path = "Toolbars/Refresh", position = 700)
})
@Messages("CTL_SomeAction=Refresh")

那么我可以在netBeans中编辑主要的layer.xml吗?

So can I edit the main layer.xml in netBeans??

推荐答案

您需要做的是在模块中创建一个xml文件(例如layer.xml).然后,您将根据以下路径,从可在左侧窗口的文件选项卡下找到的generate-layer.xml文件中复制并粘贴所需的内容:[您的模块名称]/build/classes/META-INF/生成的layer.xml. 通常,根据您现在的问题,您可能需要layer.xml文件的以下信息(如果使用该名称,则需要提供以下信息):

What you would need to do is to create an xml file (eg. layer.xml) in your module. Then you would copy and paste what you need from the generated-layer.xml file that can be found in under the file tab in the left window according to the following path: [Your Module Name]/build/classes/META-INF/generated-layer.xml. Generally according to your problem now, you might need the following info for your layer.xml file (if you give it that name):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN"
                            "http://www.netbeans.org/dtds/filesystem-1_2.dtd">

<filesystem>
    <folder name="Toolbars">
        <folder name="Refresh">
            <attr intvalue="1000" name="position"/>
        </folder>
    </folder>
</filesystem>

完成此操作后,右键单击并选择"Validate XML"选项来验证layer.xml文件.完成此操作后,然后在项目视图中,转到重要文件"并打开模块清单"文件.在文件末尾添加以下内容:

After doing this then validate your layer.xml file by right-clicking it and selecting "Validate XML" option. After doing this, then in the projects view, go to "important files" and open the Module Manifest file. At the end of the file add the following:

OpenIDE-Module-Layer: org/yourorg/modulename/layer.xml

保存清单文件并运行模块后,就可以了.

After saving the manifest file and running your module, it should be ok.

这篇关于NetBeans 7.3自定义/编辑工具栏位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆