本文整理汇总了Java中org.gwtbootstrap3.client.ui.ListBox类的典型用法代码示例。如果您正苦于以下问题:Java ListBox类的具体用法?Java ListBox怎么用?Java ListBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListBox类属于org.gwtbootstrap3.client.ui包,在下文中一共展示了ListBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFormValues
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public void getFormValues(List<FormGroup> controlGroups) {
formValues = new HashMap();
for (FormGroup groupControl : controlGroups) {
if (groupControl.getWidget(1) instanceof TextBox) {
formValues.put(((TextBox) groupControl.getWidget(1)).getName(),
((TextBox) groupControl.getWidget(1)).getValue());
} else if (groupControl.getWidget(1) instanceof ListBox) {
ListBox listBox = (ListBox) groupControl.getWidget(1);
List<String> selectedValues = new ArrayList<String>();
for (int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selectedValues.add(listBox.getValue(i));
}
}
formValues.put(listBox.getName(),
selectedValues);
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NewFilterPopup.java
示例2: setSelectIndexOnPageSizesSelector
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public static void setSelectIndexOnPageSizesSelector(int minPageSize,
int maxPageSize,
int incPageSize,
ListBox pageSizesSelector,
int pageSize) {
for (int i = minPageSize; i <= maxPageSize; i = i + incPageSize) {
pageSizesSelector
.addItem(String.valueOf(i) + " " + CommonConstants.INSTANCE.Items(),
String.valueOf(i));
if (i == pageSize) {
for (int z = 0; z < pageSizesSelector.getItemCount(); z++) {
if (pageSizesSelector.getValue(z).equals(String.valueOf(i))) {
pageSizesSelector.setSelectedIndex(z);
break;
}
}
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:PagedTableHelper.java
示例3: booleanEditor
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
private ListBox booleanEditor(final String currentValue) {
final ListBox listBox = listBoxEditor(booleanOperators,
currentValue,
false);
listBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(final ChangeEvent event) {
final int selectedIndex = listBox.getSelectedIndex();
final String selectedValue = listBox.getItemText(selectedIndex);
final boolean enabled = "true".equalsIgnoreCase(selectedValue);
ddReasonCodeAlgorithm.setEnabled(enabled);
tbBaselineScore.setEnabled(enabled);
ddReasonCodeField.setEnabled(enabled);
for (final FlexTable cGrid : characteristicsTables) {
//baseline score for each characteristic
((TextBox) cGrid.getWidget(2, 2)).setEnabled(enabled);
//reason code for each characteristic
((TextBox) cGrid.getWidget(2, 3)).setEnabled(enabled);
}
}
});
return listBox;
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:24,代码来源:GuidedScoreCardEditor.java
示例4: makeChoicesListBox
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
private ListBox makeChoicesListBox() {
choices = GWT.create(ListBox.class);
choices.setMultipleSelect(true);
choices.setPixelSize(getChoicesWidth(),
getChoicesHeight());
choices.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
selectSomething();
}
}
});
addDSLSentences();
if (!onlyShowDSLStatements) {
addFacts();
addExistentialConditionalElements();
addFromConditionalElements();
addFreeFormDrl();
}
return choices;
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:25,代码来源:RuleModellerConditionSelectorPopup.java
示例5: selectItem
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
@Override
protected void selectItem(final ListBox listBox) {
final int itemCount = listBox.getItemCount();
listBox.setEnabled(itemCount > 0);
if (itemCount > 0) {
listBox.setSelectedIndex(0);
//Schedule notification after GWT has finished tying everything together as not all
//Event Handlers have been set-up by consumers of this class at Construction time
Scheduler.get().scheduleFinally(new ScheduledCommand() {
@Override
public void execute() {
valueChangedCommand.valueChanged(encodeSelectedItems(),
encodeSelectedItems());
}
});
}
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:20,代码来源:EnumDropDown.java
示例6: setUp
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Mock The ListBox with loaded choices
GwtMockito.useProviderForType(ListBox.class, new FakeProvider<ListBox>() {
@Override
public ListBox getFake(Class<?> aClass) {
return choices;
}
});
// Mock partially the AsyncPackageDataModelOracle
incrementalDataModelServiceCaller = new CallerMock<>(incrementalDataModelService);
validatorInstance = new MockInstanceImpl<>();
oracle = spy(new AsyncPackageDataModelOracleImpl(incrementalDataModelServiceCaller, validatorInstance));
// Mock partially the AsyncPackageDataModelOracleFactory
doReturn(syncBeanDef).when(syncBeanManager).lookupBean(AsyncPackageDataModelOracle.class);
doReturn(oracle).when(syncBeanDef).getInstance();
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:20,代码来源:RuleModellerConditionSelectorPopupTest.java
示例7: setUp
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
fromCollectWidget = new FromCollectCompositeFactPatternWidget(ruleModeller,
eventBus,
pattern);
GwtMockito.useProviderForType(ListBox.class,
new ListBoxFakeProvider());
collectionTypes = new ArrayList<String>() {{
add("ArrayList");
add("HashSet");
}};
when(ruleModeller.getDataModelOracle()).thenReturn(oracle);
when(oracle.getAvailableCollectionTypes()).thenReturn(collectionTypes);
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:FromCollectCompositeFactPatternWidgetTest.java
示例8: cepOperatorsDropdown
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
private void cepOperatorsDropdown(final Consumer<IsWidget> widgetSupplier) {
getOperatorCompletions(options -> {
final String[] operatorsArray = filterOptionsForConstraintTypeLiteral(options);
final CEPOperatorsDropdown dropdown = newCepOperatorsDropdown(operatorsArray);
final ListBox box = dropdown.getBox();
final int currentValueIndex = getCurrentIndexFromList(getOperator(),
box);
box.addChangeHandler((ChangeEvent valueChangeEvent) -> setOperator(box.getValue(box.getSelectedIndex())));
if (currentValueIndex != box.getSelectedIndex()) {
box.setSelectedIndex(currentValueIndex);
}
widgetSupplier.accept(dropdown);
});
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:17,代码来源:OperatorPage.java
示例9: makeHasEnumsListBox
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
private ListBox makeHasEnumsListBox(Pattern52 pattern,
BaseColumn column,
DTCellValue52 value,
boolean isMultipleSelect,
String factField,
String factType) {
final LimitedEntryDropDownManager.Context context = new LimitedEntryDropDownManager.Context(pattern,
column);
final Map<String, String> currentValueMap = dropDownManager.getCurrentValueMap(context);
final DropDownData dd = oracle.getEnums(factType,
factField,
currentValueMap);
//No drop-down data defined
if (dd == null) {
return makeListBoxForColumn(DropDownData.create(new String[0]),
pattern,
column,
value,
isMultipleSelect);
}
return makeListBoxForColumn(dd,
pattern,
column,
value,
isMultipleSelect);
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:27,代码来源:DTCellValueWidgetFactory.java
示例10: toWidget
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public static void toWidget(final boolean isMultipleSelect,
final GridCell<String> cell,
final ListBox widget) {
if (cell == null || cell.getValue() == null || cell.getValue().getValue() == null) {
if (widget.getItemCount() > 0) {
widget.setSelectedIndex(0);
}
} else {
final String value = cell.getValue().getValue();
if (isMultipleSelect) {
final List<String> values = Arrays.asList(value.split(","));
for (int i = 0; i < widget.getItemCount(); i++) {
widget.setItemSelected(i,
values.contains(widget.getValue(i)));
}
} else {
for (int i = 0; i < widget.getItemCount(); i++) {
if (widget.getValue(i).equals(value)) {
widget.setSelectedIndex(i);
break;
}
}
}
}
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:BaseColumnConverterUtilities.java
示例11: fromWidget
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public static String fromWidget(final boolean isMultipleSelect,
final ListBox widget) {
final StringBuilder sb = new StringBuilder();
if (isMultipleSelect) {
for (int i = 0; i < widget.getItemCount(); i++) {
if (widget.isItemSelected(i)) {
sb.append(widget.getValue(i)).append(",");
}
}
if (sb.length() > 0) {
sb.setLength(sb.length() - 1);
}
} else {
int selectedIndex = widget.getSelectedIndex();
if (selectedIndex >= 0) {
sb.append(widget.getValue(selectedIndex));
}
}
return sb.toString();
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:BaseColumnConverterUtilities.java
示例12: EnumSingleSelectDateUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectDateUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<Date, ListBox, ListBoxDOMElement<Date, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<Date, DatePicker, DatePickerDOMElement> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectDateUiColumn.java
示例13: EnumSingleSelectDoubleUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectDoubleUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<Double, ListBox, ListBoxDOMElement<Double, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<Double, NumericDoubleTextBox, TextBoxDOMElement<Double, NumericDoubleTextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectDoubleUiColumn.java
示例14: EnumSingleSelectShortUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectShortUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<Short, ListBox, ListBoxDOMElement<Short, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<Short, NumericShortTextBox, TextBoxDOMElement<Short, NumericShortTextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectShortUiColumn.java
示例15: EnumSingleSelectStringUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectStringUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<String, ListBox, ListBoxDOMElement<String, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<String, TextBox, TextBoxDOMElement<String, TextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectStringUiColumn.java
示例16: EnumSingleSelectFloatUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectFloatUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<Float, ListBox, ListBoxDOMElement<Float, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<Float, NumericFloatTextBox, TextBoxDOMElement<Float, NumericFloatTextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectFloatUiColumn.java
示例17: DialectUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public DialectUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final ListBoxSingletonDOMElementFactory<String, ListBox> factory ) {
super( headerMetaData,
new CellRenderer<String, ListBox, ListBoxDOMElement<String, ListBox>>( factory ) {
@Override
protected void doRenderCellContent( final Text t,
final String value,
final GridBodyCellRenderContext context ) {
t.setText( value );
}
},
width,
isResizable,
isVisible,
access,
factory );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:DialectUiColumn.java
示例18: doEdit
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
@Override
public void doEdit( final GridCell<String> cell,
final GridBodyCellRenderContext context,
final Callback<GridCellValue<String>> callback ) {
factory.attachDomElement( context,
new Callback<ListBoxDOMElement<String, ListBox>>() {
@Override
public void callback( final ListBoxDOMElement<String, ListBox> e ) {
final ListBox widget = e.getWidget();
widget.addItem( "java" );
widget.addItem( "mvel" );
factory.toWidget( cell,
e.getWidget() );
}
},
CallbackFactory.makeOnDisplayListBoxCallback() );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:DialectUiColumn.java
示例19: EnumSingleSelectByteUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectByteUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<Byte, ListBox, ListBoxDOMElement<Byte, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<Byte, NumericByteTextBox, TextBoxDOMElement<Byte, NumericByteTextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectByteUiColumn.java
示例20: EnumSingleSelectBigDecimalUiColumn
import org.gwtbootstrap3.client.ui.ListBox; //导入依赖的package包/类
public EnumSingleSelectBigDecimalUiColumn( final List<HeaderMetaData> headerMetaData,
final double width,
final boolean isResizable,
final boolean isVisible,
final GuidedDecisionTablePresenter.Access access,
final MultiValueSingletonDOMElementFactory<BigDecimal, ListBox, ListBoxDOMElement<BigDecimal, ListBox>> multiValueFactory,
final SingleValueSingletonDOMElementFactory<BigDecimal, NumericBigDecimalTextBox, TextBoxDOMElement<BigDecimal, NumericBigDecimalTextBox>> singleValueFactory,
final GuidedDecisionTableView.Presenter presenter,
final String factType,
final String factField ) {
super( headerMetaData,
width,
isResizable,
isVisible,
access,
multiValueFactory,
singleValueFactory,
presenter,
factType,
factField );
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:EnumSingleSelectBigDecimalUiColumn.java
注:本文中的org.gwtbootstrap3.client.ui.ListBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论