<small id='AFf4J'></small><noframes id='AFf4J'>

      <legend id='AFf4J'><style id='AFf4J'><dir id='AFf4J'><q id='AFf4J'></q></dir></style></legend>

    1. <i id='AFf4J'><tr id='AFf4J'><dt id='AFf4J'><q id='AFf4J'><span id='AFf4J'><b id='AFf4J'><form id='AFf4J'><ins id='AFf4J'></ins><ul id='AFf4J'></ul><sub id='AFf4J'></sub></form><legend id='AFf4J'></legend><bdo id='AFf4J'><pre id='AFf4J'><center id='AFf4J'></center></pre></bdo></b><th id='AFf4J'></th></span></q></dt></tr></i><div id='AFf4J'><tfoot id='AFf4J'></tfoot><dl id='AFf4J'><fieldset id='AFf4J'></fieldset></dl></div>

        <tfoot id='AFf4J'></tfoot>
        • <bdo id='AFf4J'></bdo><ul id='AFf4J'></ul>

        如何将参数传递到eclipse-plugin中的代码模板

        How to pass parameter into code-template in eclipse-plugin(如何将参数传递到eclipse-plugin中的代码模板)

            <tfoot id='ubwjO'></tfoot>

          • <i id='ubwjO'><tr id='ubwjO'><dt id='ubwjO'><q id='ubwjO'><span id='ubwjO'><b id='ubwjO'><form id='ubwjO'><ins id='ubwjO'></ins><ul id='ubwjO'></ul><sub id='ubwjO'></sub></form><legend id='ubwjO'></legend><bdo id='ubwjO'><pre id='ubwjO'><center id='ubwjO'></center></pre></bdo></b><th id='ubwjO'></th></span></q></dt></tr></i><div id='ubwjO'><tfoot id='ubwjO'></tfoot><dl id='ubwjO'><fieldset id='ubwjO'></fieldset></dl></div>
            <legend id='ubwjO'><style id='ubwjO'><dir id='ubwjO'><q id='ubwjO'></q></dir></style></legend>
              <tbody id='ubwjO'></tbody>

            1. <small id='ubwjO'></small><noframes id='ubwjO'>

                <bdo id='ubwjO'></bdo><ul id='ubwjO'></ul>
                  本文介绍了如何将参数传递到eclipse-plugin中的代码模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想创建一个定义新代码模板的插件(喜欢这篇博文).如何将参数传递给模板?像 ${name:param}?

                  I want to create a plugin which defines a new code template (like this blog post). How can I pass a parameter into the template? like ${name:param}?

                  推荐答案

                  您可以传递给代码模板的东西并不多.例如 ${word_selection} 包含当前选择.

                  There aren't many things that you can pass into a code template. For example ${word_selection} contains the current selection.

                  但是很多人缺少的是您可以定义自己的变量:

                  But what many people are missing is that you can define your own variables:

                  private static final ${type} ${name} = new ${type} (${cursor});
                  

                  ${type}${name} 都不在您单击插入变量..."按钮时获得的列表中.Eclipse 注意到并允许您使用 Tab 循环浏览它们,它将使这些自定义模板字段"的内容保持同步(因此您在 new 之后的部分被填写如果您在第一个字段中输入).

                  Neither ${type} nor ${name} are in the list which you get when you click the "Insert variable..." button. Eclipse notices and allows you to cycle through them with Tab and it will keep the content of these custom "template fields" in sync (so you the part after new gets filled in if you type in the first field).

                  查看此答案以了解其他有用的 Eclipse 模板.

                  根据您提到的博客文章中的答案,目前只能使用编辑器模板,而不是代码模板.我建议提交一个针对 JDT Text 的错误以为此打开 API.

                  According to the answers in the blog post which you mention, this is only possible at the moment with editor templates, not code templates. I suggest to file a bug against JDT Text to open the API for this.

                  这篇关于如何将参数传递到eclipse-plugin中的代码模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )(无法在 32 位 JVM 上加载 64 位 SWT 库(替换 SWT 文件))
                  How can I specify the default JVM arguments for programs I run from eclipse?(如何为从 Eclipse 运行的程序指定默认 JVM 参数?)
                  Class JavaLaunchHelper is implemented in both ... libinstrument.dylib. One of the two will be used. Which one is undefined(JavaLaunchHelper 类在... libinstrument.dylib 中都实现了.将使用两者之一.哪个是未定义的) - IT屋-程序员软件开发技术分享
                  Running Eclipse on Windows 7 JRE and JDK not found(找不到在 Windows 7 JRE 和 JDK 上运行 Eclipse)
                  StringBuilder vs. .concat vs. quot;+quot; Operator relative performance different in eclipse than command line?(StringBuilder vs. .concat vs. “+eclipse中的操作员相对性能与命令行不同?)
                  Is there a maximum number you can set Xmx to when trying to increase jvm memory?(尝试增加 jvm 内存时,您可以将 Xmx 设置为最大数量吗?)
                • <tfoot id='jKJrD'></tfoot>
                    <tbody id='jKJrD'></tbody>

                    <i id='jKJrD'><tr id='jKJrD'><dt id='jKJrD'><q id='jKJrD'><span id='jKJrD'><b id='jKJrD'><form id='jKJrD'><ins id='jKJrD'></ins><ul id='jKJrD'></ul><sub id='jKJrD'></sub></form><legend id='jKJrD'></legend><bdo id='jKJrD'><pre id='jKJrD'><center id='jKJrD'></center></pre></bdo></b><th id='jKJrD'></th></span></q></dt></tr></i><div id='jKJrD'><tfoot id='jKJrD'></tfoot><dl id='jKJrD'><fieldset id='jKJrD'></fieldset></dl></div>

                      <small id='jKJrD'></small><noframes id='jKJrD'>

                      <legend id='jKJrD'><style id='jKJrD'><dir id='jKJrD'><q id='jKJrD'></q></dir></style></legend>
                          <bdo id='jKJrD'></bdo><ul id='jKJrD'></ul>