本文整理汇总了Java中com.intellij.util.text.StringTokenizer.hasMoreElements方法的典型用法代码示例。如果您正苦于以下问题:Java StringTokenizer.hasMoreElements方法的具体用法?Java StringTokenizer.hasMoreElements怎么用?Java StringTokenizer.hasMoreElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.text.StringTokenizer
的用法示例。
在下文中一共展示了StringTokenizer.hasMoreElements方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseIgnoredVariables
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
private Collection<String> parseIgnoredVariables() {
final String s = myIgnoredVariables.getText();
final List<String> ignored = new ArrayList<String>();
final StringTokenizer st = new StringTokenizer(s, ";");
while (st.hasMoreElements()) {
ignored.add(st.nextElement().trim());
}
return ignored;
}
示例2: loadKeywords
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
private static void loadKeywords(Element element, Set<String> keywords) {
String value = element.getAttributeValue(ELEMENT_KEYWORDS);
if (value != null) {
StringTokenizer tokenizer = new StringTokenizer(value, SEMICOLON);
while(tokenizer.hasMoreElements()) {
String keyword = tokenizer.nextToken().trim();
if (keyword.length() != 0) keywords.add(keyword);
}
}
for (final Object o1 : element.getChildren(ELEMENT_KEYWORD)) {
keywords.add(((Element)o1).getAttributeValue(ATTRIBUTE_NAME));
}
}
示例3: load
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
public void load(File file, String encoding) throws IOException{
String propText = FileUtil.loadFile(file, encoding);
propText = StringUtil.convertLineSeparators(propText);
StringTokenizer stringTokenizer = new StringTokenizer(propText, "\n");
while (stringTokenizer.hasMoreElements()){
String line = stringTokenizer.nextElement();
int i = line.indexOf('=');
String propName = i == -1 ? line : line.substring(0,i);
String propValue = i == -1 ? "" : line.substring(i+1);
setProperty(propName, propValue);
}
}
示例4: createTipContent
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
private JComponent createTipContent(String tipText, DebuggerTreeNodeImpl node) {
final JToolTip tooltip = new JToolTip();
if (tipText == null) {
tooltip.setTipText(tipText);
}
else {
Dimension rootSize = getVisibleRect().getSize();
Insets borderInsets = tooltip.getBorder().getBorderInsets(tooltip);
rootSize.width -= (borderInsets.left + borderInsets.right) * 2;
rootSize.height -= (borderInsets.top + borderInsets.bottom) * 2;
@NonNls StringBuilder tipBuilder = new StringBuilder();
final String markupText = node.getMarkupTooltipText();
if (markupText != null) {
tipBuilder.append(markupText);
}
if (!tipText.isEmpty()) {
final StringTokenizer tokenizer = new StringTokenizer(tipText, "\n ", true);
while (tokenizer.hasMoreElements()) {
final String each = tokenizer.nextElement();
if ("\n".equals(each)) {
tipBuilder.append("<br>");
}
else if (" ".equals(each)) {
tipBuilder.append("  ");
}
else {
tipBuilder.append(JDOMUtil.legalizeText(each));
}
}
}
tooltip.setTipText(UIUtil.toHtml(tipBuilder.toString(), 0));
}
tooltip.setBorder(null);
return tooltip;
}