本文整理汇总了Java中org.jboss.errai.common.client.dom.Option类的典型用法代码示例。如果您正苦于以下问题:Java Option类的具体用法?Java Option怎么用?Java Option使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Option类属于org.jboss.errai.common.client.dom包,在下文中一共展示了Option类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAddOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Test
public void testAddOption() {
final Option option = mock(Option.class);
when(document.createElement("option")).thenReturn(option);
select.addOption("text",
"subText",
"value",
true);
verify(option).setText("text");
verify(option).setValue("value");
verify(option).setSelected(true);
option.setAttribute("data-subtext",
"subText");
verify(selectMock).add(option);
}
示例2: initConstructionHeuristicTypeSelectOptions
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Override
public void initConstructionHeuristicTypeSelectOptions(final List<Pair<String, String>> optionPairs) {
for (Pair<String, String> optionPair : optionPairs) {
Option option = createOption(optionPair);
constructionHeuristicTypeSelect.add(option);
}
}
示例3: initEntitySorterMannerSelectOptions
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Override
public void initEntitySorterMannerSelectOptions(final List<Pair<String, String>> optionPairs) {
for (Pair<String, String> optionPair : optionPairs) {
Option option = createOption(optionPair);
entitySorterMannerSelect.add(option);
}
}
示例4: initPlanningSolutionScoreTypeOptions
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Override
public void initPlanningSolutionScoreTypeOptions(List<Pair<String, String>> optionPairs) {
planningSolutionScoreTypeSelector.add(createOption(Pair.newPair("-",
"")));
for (Pair<String, String> optionPair : optionPairs) {
Option option = createOption(optionPair);
planningSolutionScoreTypeSelector.add(option);
}
}
示例5: addOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
public void addOption(final String text,
final String subText,
final String value,
final Boolean selected) {
final Option option = (Option) document.createElement("option");
option.setText(text);
option.setValue(value);
option.setSelected(selected);
if (isNullOrEmpty(subText) == false) {
option.setAttribute("data-subtext",
subText);
}
select.add(option);
}
示例6: newOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
private Option newOption(final String text,
final String value) {
final Option option = (Option) Window.getDocument().createElement("option");
option.setTextContent(text);
option.setValue(value);
return option;
}
示例7: makeSureTextAndValueAreBeingSetWhenCreatingNewOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Test
public void makeSureTextAndValueAreBeingSetWhenCreatingNewOption() {
final Option option = mock(Option.class);
doReturn(option).when(document).createElement("option");
final Option createdOption = view.createOption("alias");
assertEquals(option,
createdOption);
verify(option).setValue("alias");
verify(option).setText("alias");
}
示例8: addModelField
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
@Override
public void addModelField(String property,
boolean selected) {
Option option = (Option) document.createElement("option");
option.setText(property);
option.setValue(property);
option.setSelected(selected);
bindings.add(option);
}
示例9: createOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
private Option createOption(final Pair<String, String> optionPair) {
Option option = (Option) document.createElement("option");
option.setText(optionPair.getK1());
option.setValue(optionPair.getK2());
return option;
}
示例10: createOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
Option createOption(String ou) {
Option option = (Option) document.createElement("option");
option.setText(ou);
option.setValue(ou);
return option;
}
示例11: createOption
import org.jboss.errai.common.client.dom.Option; //导入依赖的package包/类
private Option createOption(final String value) {
Option option = (Option) document.createElement("option");
option.setText(value);
return option;
}