如何覆盖 NetBeans 开放式 IDE 中 ResetWindowsAction 的行为?

huangapple go评论68阅读模式
英文:

How to override behaviour of ResetWindowsAction in netbeans open IDE?

问题

我尝试在NetBeans平台中使用NetBeans开放式IDE自定义菜单项下的重置窗口点击操作。NetBeans的当前实现会清除属性模式和输出模式的所有顶部组件,但编辑器模式和资源管理器模式除外。

我的要求是,在单击“重置窗口”后,使用“Actions/Window/org-netbeans-core-windows-actions-ResetWindowsAction.instance”,保持输出模式和资源管理器模式保持最小化状态。

英文:

I was trying to customize the reset window click action under menu items in netbeans platform using netbeans open IDE. Current implementation of netbeans clears up all the top components of property mode and output mode except for editor mode and explorer mode.

My requirement is to keep the output mode and explore mode minimized even after clicking 'reset windows' using "Actions/Window/org-netbeans-core-windows-actions-ResetWindowsAction.instance".

答案1

得分: 1

你需要编写一个 Netbeans 插件,其中将会:

  1. 移除 Window 菜单中当前的 ResetWindowsAction 引用
  2. 实现自己的动作(可以拥有相同的 "Reset Windows" 显示名称),并在 Window 菜单中添加对它的引用

这比你想象的要简单得多:创建一个 Netbeans 模块和一个动作。Netbeans 动作向导会处理所有的连接工作。这个“官方的” Netbeans 插件创建教程 会告诉你如何进行插件的创建和任务 2。

至于任务 1,在 Netbeans 中,打开你的模块 > 重要文件 > XML 层 > 上下文中的此层 > 菜单栏 > Window,选择 "org-netbeans-core-windows-actions-ResetWindowsAction" 条目然后删除它。

供参考,当前 ResetWindowsAction 的代码在这里

英文:

You need to write a Netbeans plugin which will:

  1. Remove the current ResetWindowsAction reference in the Window menu
  2. Implement your own action (which can have the same "Reset Windows" display name) and add a reference to it in the Window menu

It's much easier than you may think: create a Netbeans module and an Action. Netbeans Action wizard will do all the plumbing stuff. This "official" netbeans plugin creation tutorial explains you how to do the plugin creation and task 2.

For task 1, in Netbeans, open your module > Important Files > XML Layer > this layer in context > Menu Bar > Window, select the "org-netbeans-core-windows-actions-ResetWindowsAction" entry and Delete.

For information the code of the current ResetWindowsAction is here.

huangapple
  • 本文由 发表于 2020年8月17日 18:37:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/63449167.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定