本文整理匯總了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;
}