[英]I want to display a table of metrics but unable to do so
i am developing a plugin that calculates the class metrics of the selected java file.我正在开发一个插件,用于计算所选 java 文件的 class 指标。 so, m using IWorkbenchWindowAction delegate to add the plugin button and menu option.
因此,我使用 IWorkbenchWindowAction 委托来添加插件按钮和菜单选项。
by selecting the java file, and clicking on the plugin button, i obtain the pathname of the selected file, and now i need to calculate the metrics over it.通过选择 java 文件,并单击插件按钮,我获得了所选文件的路径名,现在我需要计算它的指标。
suppose i have already calculated the metrics.假设我已经计算了指标。 now, i want to display them in tabular form.
现在,我想以表格形式显示它们。
what needs to be done???需要做什么??? how can i display a table, and display it as soon as the plugin button is pressed (after calculating the metrics, ofcourse).. ??
我如何显示一个表格,并在按下插件按钮后立即显示它(当然是在计算指标之后)。??
You must probably create your own view, with table (Viewer) inside it.您可能必须创建自己的视图,其中包含表(查看器)。 Updating viewer strategy can be different.
更新查看器策略可能会有所不同。 For instance, you can make your view listen to some events, which are generated after the metrics are calculated.
例如,您可以让您的视图监听一些事件,这些事件是在计算指标后生成的。 Or, if you want to have a separate button for updating the view, then you should attach proper action/command handler with necessary logic.
或者,如果你想有一个单独的按钮来更新视图,那么你应该附加适当的动作/命令处理程序和必要的逻辑。 Does this answer your question, or I am missing something?
这是否回答了您的问题,或者我遗漏了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.