use of org.gwtbootstrap3.extras.select.client.ui.Select in project ovirt-engine by oVirt.
the class AbstractModeSwitchingPopupWidget method switchMode.
public void switchMode(boolean advanced) {
Set<Widget> allConfiguredWidgets = widgetConfiguration.getAll().keySet();
for (Widget widget : allConfiguredWidgets) {
widget.setVisible(widgetConfiguration.get(widget).isCurrentlyVisible(advanced, createInstanceMode));
}
TabListItem activeTab = ((DialogTabPanel) getWidget()).getActiveTab();
// select the first tab if the selected tab has been hidden
if (!advanced && widgetConfiguration.getVisibleInAdvanceMode().keySet().contains(activeTab)) {
((DialogTabPanel) getWidget()).switchTab(defaultTab);
}
}
use of org.gwtbootstrap3.extras.select.client.ui.Select in project drools-wb by kiegroup.
the class ConstraintValueEditor method literalEditor.
private Widget literalEditor() {
// Custom screen
if (this.constraint instanceof SingleFieldConstraint) {
final SingleFieldConstraint con = (SingleFieldConstraint) this.constraint;
CustomFormConfiguration customFormConfiguration = getWorkingSetManager().getCustomFormConfiguration(modeller.getPath(), factType, fieldName);
if (customFormConfiguration != null) {
Button btnCustom = new Button(con.getValue(), new ClickHandler() {
public void onClick(ClickEvent event) {
showTypeChoice(constraint);
}
});
btnCustom.setEnabled(!this.readOnly);
return btnCustom;
}
}
// Label if read-only
if (this.readOnly) {
return new SmallLabel(getSanitizedValue());
}
// Enumeration (these support multi-select for "in" and "not in", so check before comma separated lists)
if (this.dropDownData != null) {
final String operator = constraint.getOperator();
final boolean multipleSelect = OperatorsOracle.operatorRequiresList(operator);
EnumDropDown enumDropDown = new EnumDropDown(constraint.getValue(), new DropDownValueChanged() {
public void valueChanged(String newText, String newValue) {
// Prevent recursion once value change has been applied
if (!newValue.equals(constraint.getValue())) {
constraint.setValue(newValue);
executeOnValueChangeCommand();
}
}
}, dropDownData, multipleSelect, modeller.getPath());
return enumDropDown;
}
// Comma separated value list (this will become a dedicated Widget but for now a TextBox suffices)
String operator = null;
if (this.constraint instanceof SingleFieldConstraint) {
SingleFieldConstraint sfc = (SingleFieldConstraint) this.constraint;
operator = sfc.getOperator();
}
if (OperatorsOracle.operatorRequiresList(operator)) {
return getNewTextBox(DataType.TYPE_STRING);
}
// Date picker
boolean isCEPOperator = CEPOracle.isCEPOperator((this.constraint).getOperator());
if (DataType.TYPE_DATE.equals(this.fieldType) || (DataType.TYPE_THIS.equals(this.fieldName) && isCEPOperator)) {
if (this.readOnly) {
return new SmallLabel(constraint.getValue());
}
final DatePicker datePicker = new DatePicker(false);
// Wire up update handler
datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
@Override
public void onValueChange(final ValueChangeEvent<Date> event) {
final Date date = datePicker.getValue();
final String sDate = (date == null ? null : DATE_FORMATTER.format(datePicker.getValue()));
boolean update = constraint.getValue() == null || !constraint.getValue().equals(sDate);
constraint.setValue(sDate);
if (update) {
executeOnValueChangeCommand();
}
}
});
datePicker.setFormat(DATE_FORMAT);
datePicker.setValue(getSanitizedDateValue());
return datePicker;
}
// Default editor for all other literals
return getNewTextBox(fieldType);
}
use of org.gwtbootstrap3.extras.select.client.ui.Select in project kie-wb-common by kiegroup.
the class PeriodBox method createOptionAndAddtoSelect.
private void createOptionAndAddtoSelect(Select typeSelector, String name, String value) {
Option option = new Option();
option.setValue(value);
option.setText(name);
typeSelector.add(option);
}
use of org.gwtbootstrap3.extras.select.client.ui.Select in project kie-wb-common by kiegroup.
the class PackageListBox method clearSelect.
void clearSelect() {
if (select != null) {
select.removeFromParent();
removeSelect(select.getElement());
}
select = new Select();
panel.setWidget(select);
}
use of org.gwtbootstrap3.extras.select.client.ui.Select in project drools-wb by kiegroup.
the class ActionValueEditor method boundVariable.
private Widget boundVariable() {
// If there is a bound variable that is the same type of the current variable type, then display a list
ListBox listVariable = new ListBox();
listVariable.addItem(GuidedRuleEditorResources.CONSTANTS.Choose());
List<String> bindings = getApplicableBindings();
for (String v : bindings) {
listVariable.addItem(v);
}
// Pre-select applicable item
if (value.getValue().equals("=")) {
listVariable.setSelectedIndex(0);
} else {
for (int i = 0; i < listVariable.getItemCount(); i++) {
if (listVariable.getItemText(i).equals(value.getValue().substring(1))) {
listVariable.setSelectedIndex(i);
}
}
}
// Add event handler
if (listVariable.getItemCount() > 0) {
listVariable.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
ListBox w = (ListBox) event.getSource();
value.setValue("=" + w.getValue(w.getSelectedIndex()));
executeOnChangeCommand();
refresh();
}
});
}
if (this.readOnly) {
return new SmallLabel(listVariable.getItemText(listVariable.getSelectedIndex()));
}
return listVariable;
}
Aggregations