本文整理汇总了Java中com.intellij.util.text.StringTokenizer.countTokens方法的典型用法代码示例。如果您正苦于以下问题:Java StringTokenizer.countTokens方法的具体用法?Java StringTokenizer.countTokens怎么用?Java StringTokenizer.countTokens使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.text.StringTokenizer
的用法示例。
在下文中一共展示了StringTokenizer.countTokens方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LabeledIcon
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
/**
* @param icon not <code>null</code> icon.
* @param text to be painted under the <code>icon<code>. This parameter can
* be <code>null</code> if text isn't specified. In that case <code>LabeledIcon</code>
* @param mnemonic
*/
public LabeledIcon(Icon icon, String text, String mnemonic) {
myIcon = icon;
myMnemonic = mnemonic;
if (text != null) {
StringTokenizer tokenizer = new StringTokenizer(text, "\n");
myStrings = new String[tokenizer.countTokens()];
for (int i = 0; tokenizer.hasMoreTokens(); i++) {
myStrings[i] = tokenizer.nextToken();
}
}
else {
myStrings = null;
}
}
示例2: HorizontalLabeledIcon
import com.intellij.util.text.StringTokenizer; //导入方法依赖的package包/类
/**
* @param icon not <code>null</code> icon.
* @param text to be painted under the <code>icon<code>. This parameter can
* be <code>null</code> if text isn't specified. In that case <code>LabeledIcon</code>
*/
public HorizontalLabeledIcon(Icon icon, String text, String mnemonic) {
myIcon = icon;
if (text != null) {
StringTokenizer tokenizer = new StringTokenizer(text, "\n");
myStrings = new String[tokenizer.countTokens()];
for (int i = 0; tokenizer.hasMoreTokens(); i++) {
myStrings[i] = tokenizer.nextToken();
}
}
else {
myStrings = null;
}
myMnemonic = mnemonic;
}