简体   繁体   English

在eclipse插件中动态更改弹出窗口

[英]Changing pop-ups dynamically in eclipse plugin

I have a plugin where for a particular type of file i will enable some options to perform. 我有一个插件,对于特定类型的文件,我将启用一些选项。 so now i have requirement where i need to decide the type of a file dynamically and apply a particular options for that type of file. 因此,现在我有了要求,我需要动态地决定文件的类型并为该文件类型应用特定的选项。

Is it possible to do that? 有可能这样做吗? if yes, need some help about the same. 如果是,则需要同样的帮助。

Thanks. 谢谢。

So I guess you want to show the context menu for something that represents a file in a view. 因此,我想您想为表示视图中文件的内容显示上下文菜单。 Determine the file type based on custom rules (file extension is the easiest rule, looking inside the file the most complex) and create the popup or distribute content to an existing one. 根据自定义规则确定文件类型(文件扩展名是最简单的规则,在文件内部查找最复杂的规则),然后创建弹出窗口或将内容分发到现有的弹出窗口中。

If it's your own view, maybe a list or tree that shows a folder structure, then you have to register the Viewer as a SelectionProvider, listen to selection events, evaluate the selection (maybe a String or a File object) and create the popup menu. 如果是您自己的视图,可能是显示文件夹结构的列表或树,则必须将查看器注册为SelectionProvider,侦听选择事件,评估选择(可能是String或File对象)并创建弹出菜单。

Contributing actions to existing popup menus (like the navigator view context menus) is possible as well but a bit more challenging. 也可以向现有的弹出菜单(例如导航器视图上下文菜单)进行操作,但是更具挑战性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Selenium Firefox WebDriver处理多个弹出窗口 - How to handle multiple pop-ups with selenium firefox webdriver 无法使用 Robot 类处理 Windows 10 弹出窗口 - Unable to handle Windows 10 pop-ups using Robot class 处理在Java / Selenium中停止处理的浏览器弹出窗口 - Handling browser pop-ups that stop processing in Java/Selenium 在Java弹出窗口中重复使用JTextField - Re-using JTextField in Java pop-ups 通过Selenium Webdriver(3.x)处理自定义弹出窗口(不是默认窗口) - Handling custom pop-ups (not the default windows one) through selenium webdriver (3.x) 我们是否应该为页面中出现的错误弹出窗口编写单独的页面对象? - Should we write separate page-object for the error pop-ups coming in a page? 是否可以使用 Java 中的 JOptionPane 同时显示多个弹出窗口? - Is it possible to have multiple pop-ups present at the same time using the JOptionPane in java? 我们可以自动化浏览器设置,例如在浏览器启动时禁用弹出窗口吗? - Can we automate browser settings, like disabling pop-ups whenever browser starts? 更改Eclipse插件的ID(Bundle-SymbolicName) - Changing the ID (Bundle-SymbolicName) of an Eclipse plugin Eclipse插件中动态生成的TestNG测试的名称 - Names for dynamically generated TestNG tests in Eclipse plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM