本文整理汇总了Java中com.intellij.codeInsight.template.impl.TemplateImpl.getVariableCount方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateImpl.getVariableCount方法的具体用法?Java TemplateImpl.getVariableCount怎么用?Java TemplateImpl.getVariableCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.template.impl.TemplateImpl
的用法示例。
在下文中一共展示了TemplateImpl.getVariableCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeVariablesWhichHasNoSegment
import com.intellij.codeInsight.template.impl.TemplateImpl; //导入方法依赖的package包/类
private static void removeVariablesWhichHasNoSegment(TemplateImpl template) {
Set<String> segments = new HashSet<String>();
for (int i = 0; i < template.getSegmentsCount(); i++) {
segments.add(template.getSegmentName(i));
}
for (int i = template.getVariableCount() - 1; i >= 0; i--) {
String varName = template.getVariableNameAt(i);
if (!segments.contains(varName)) {
template.removeVariable(i);
}
else {
segments.remove(varName);
}
}
}
示例2: containsAttrsVar
import com.intellij.codeInsight.template.impl.TemplateImpl; //导入方法依赖的package包/类
private static boolean containsAttrsVar(@NotNull TemplateImpl template) {
for (int i = 0; i < template.getVariableCount(); i++) {
String varName = template.getVariableNameAt(i);
if (ATTRS.equals(varName)) {
return true;
}
}
return false;
}
示例3: removeVariablesWhichHasNoSegment
import com.intellij.codeInsight.template.impl.TemplateImpl; //导入方法依赖的package包/类
private static void removeVariablesWhichHasNoSegment(TemplateImpl template) {
Set<String> segments = new HashSet<String>();
for (int i = 0; i < template.getSegmentsCount(); i++) {
segments.add(template.getSegmentName(i));
}
for (int i = template.getVariableCount() - 1; i >= 0; i--) {
String varName = template.getVariableNameAt(i);
if (!segments.contains(varName)) {
template.removeVariable(i);
} else {
segments.remove(varName);
}
}
}
示例4: containsAttrsVar
import com.intellij.codeInsight.template.impl.TemplateImpl; //导入方法依赖的package包/类
private static boolean containsAttrsVar(TemplateImpl template) {
for (int i = 0; i < template.getVariableCount(); i++) {
String varName = template.getVariableNameAt(i);
if (ATTRS.equals(varName)) {
return true;
}
}
return false;
}