开发者

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.

Contributing actions to existing popup menus (like the navigator view context menus) is possible as well but a bit more challenging.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜