use of com.google.gwt.event.logical.shared.ValueChangeEvent in project drools-wb by kiegroup.
the class FactPatternWidget method createCEPWindowWidget.
// Widget for CEP 'windows'
private Widget createCEPWindowWidget(final RuleModeller modeller, final HasCEPWindow c) {
final HorizontalPanel hp = new HorizontalPanel();
modeller.getDataModelOracle().isFactTypeAnEvent(pattern.getFactType(), new Callback<Boolean>() {
@Override
public void callback(final Boolean result) {
if (Boolean.TRUE.equals(result)) {
final Label lbl = new Label(HumanReadableConstants.INSTANCE.OverCEPWindow());
lbl.setStyleName("paddedLabel");
hp.add(lbl);
final CEPWindowOperatorsDropdown cwo = new CEPWindowOperatorsDropdown(c, readOnly);
if (!isReadOnly()) {
cwo.addValueChangeHandler(new ValueChangeHandler<OperatorSelection>() {
public void onValueChange(ValueChangeEvent<OperatorSelection> event) {
setModified(true);
OperatorSelection selection = event.getValue();
String selected = selection.getValue();
c.getWindow().setOperator(selected);
}
});
}
hp.add(cwo);
}
}
});
return hp;
}
use of com.google.gwt.event.logical.shared.ValueChangeEvent in project rstudio by rstudio.
the class EditSnippetsDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
panel_ = new DockLayoutPanel(Unit.PX);
// compute the widget size and set it
Size size = new Size(900, 900);
size = DomMetrics.adjustedElementSize(size, null, // pad
70, // client margin
100);
panel_.setWidth(size.width + "px");
panel_.setHeight(size.height + "px");
// snippet types
snippetTypes_ = new WidgetListBox<EditableSnippets>();
snippetTypes_.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
updateEditor(snippetTypes_.getSelectedItem());
}
});
snippetTypes_.addItem(new EditableSnippets("R", FileTypeRegistry.R));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.CPP));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.MARKDOWN));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.TEX));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.JS));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.HTML));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.CSS));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.SQL));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.JAVA));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.PYTHON));
snippetTypes_.addItem(new EditableSnippets(FileTypeRegistry.STAN));
panel_.addWest(snippetTypes_, 150);
// editor
docDisplay_ = new AceEditor();
docDisplay_.setUseSoftTabs(false);
docDisplay_.setTabSize(uiPrefs_.numSpacesForTab().getValue());
docDisplay_.addValueChangeHandler(new ValueChangeHandler<Void>() {
@Override
public void onValueChange(ValueChangeEvent<Void> event) {
editorDirty_ = true;
}
});
docDisplay_.setFileType(FileTypeRegistry.SNIPPETS);
SimplePanel panel = new SimplePanel();
panel.addStyleName("EditDialog");
panel.getElement().getStyle().setMarginLeft(8, Unit.PX);
panel.setWidget(docDisplay_.asWidget());
panel_.add(panel);
TextEditingTarget.syncFontSize(releaseOnDismiss_, events_, this, fontSizeManager_);
snippetTypes_.setSelectedIndex(0, true);
return panel_;
}
use of com.google.gwt.event.logical.shared.ValueChangeEvent in project rstudio by rstudio.
the class DataImportOptionsUiCsv method initEvents.
void initEvents() {
ValueChangeHandler<String> valueChangeHandler = new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> arg0) {
updateEnabled();
triggerChange();
}
};
ChangeHandler changeHandler = new ChangeHandler() {
@Override
public void onChange(ChangeEvent arg0) {
updateEnabled();
triggerChange();
}
};
ChangeHandler delimChangeHandler = new ChangeHandler() {
@Override
public void onChange(ChangeEvent arg0) {
if (delimiterListBox_.getSelectedValue() == "other") {
globalDisplay_.promptForTextWithOption("Other Delimiter", "Please enter a single character delimiter.", "", false, "", false, new ProgressOperationWithInput<PromptWithOptionResult>() {
private void dismissAndUpdate(ProgressIndicator indicator, int newSelectIndex) {
lastDelimiterListBoxIndex_ = newSelectIndex;
delimiterListBox_.setSelectedIndex(newSelectIndex);
indicator.onCompleted();
updateEnabled();
triggerChange();
}
@Override
public void execute(PromptWithOptionResult result, ProgressIndicator indicator) {
String otherDelimiter = result.input;
if (otherDelimiter.length() != 1) {
globalDisplay_.showErrorMessage("Incorrect Delimiter", "The specified delimiter is not valid.");
} else {
for (int idxDelimiter = 0; idxDelimiter < delimiterListBox_.getItemCount(); idxDelimiter++) {
if (delimiterListBox_.getValue(idxDelimiter) == otherDelimiter) {
dismissAndUpdate(indicator, idxDelimiter);
return;
}
}
int selectedIndex = delimiterListBox_.getSelectedIndex();
delimiterListBox_.insertItem("Character " + otherDelimiter, otherDelimiter, selectedIndex - 1);
dismissAndUpdate(indicator, selectedIndex - 1);
}
}
}, new Operation() {
@Override
public void execute() {
delimiterListBox_.setSelectedIndex(lastDelimiterListBoxIndex_);
updateEnabled();
triggerChange();
}
});
} else {
lastDelimiterListBoxIndex_ = delimiterListBox_.getSelectedIndex();
updateEnabled();
triggerChange();
}
}
};
ValueChangeHandler<Boolean> booleanValueChangeHandler = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> arg0) {
updateEnabled();
triggerChange();
}
};
nameTextBox_.addValueChangeHandler(valueChangeHandler);
delimiterListBox_.addChangeHandler(delimChangeHandler);
quotesListBox_.addChangeHandler(changeHandler);
escapeListBox_.addChangeHandler(changeHandler);
columnNamesCheckBox_.addValueChangeHandler(booleanValueChangeHandler);
trimSpacesCheckBox_.addValueChangeHandler(booleanValueChangeHandler);
openDataViewerCheckBox_.addValueChangeHandler(booleanValueChangeHandler);
naListBox_.addChangeHandler(changeHandler);
commentListBox_.addChangeHandler(changeHandler);
skipTextBox_.addValueChangeHandler(valueChangeHandler);
localeButton_.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
new DataImportOptionsUiCsvLocale(new OperationWithInput<DataImportOptionsCsvLocale>() {
@Override
public void execute(final DataImportOptionsCsvLocale result) {
localeInfo_ = result;
updateEnabled();
triggerChange();
}
}, localeInfo_).showModal();
}
});
}
use of com.google.gwt.event.logical.shared.ValueChangeEvent in project rstudio by rstudio.
the class DataImportOptionsUiSav method initEvents.
void initEvents() {
ValueChangeHandler<String> valueChangeHandler = new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> arg0) {
updateEnabled();
triggerChange();
}
};
ChangeHandler changeHandler = new ChangeHandler() {
@Override
public void onChange(ChangeEvent arg0) {
updateEnabled();
triggerChange();
}
};
ValueChangeHandler<Boolean> booleanValueChangeHandler = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> arg0) {
updateEnabled();
triggerChange();
}
};
nameTextBox_.addValueChangeHandler(valueChangeHandler);
formatListBox_.addChangeHandler(changeHandler);
openDataViewerCheckBox_.addValueChangeHandler(booleanValueChangeHandler);
}
use of com.google.gwt.event.logical.shared.ValueChangeEvent in project rstudio by rstudio.
the class ImportFileSettingsDialog method hookChangeEvents.
private void hookChangeEvents() {
ValueChangeHandler<Boolean> valueChangeHandler = new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> booleanValueChangeEvent) {
updateOutput();
}
};
headingYes_.addValueChangeHandler(valueChangeHandler);
headingNo_.addValueChangeHandler(valueChangeHandler);
ChangeHandler changeHandler = new ChangeHandler() {
public void onChange(ChangeEvent event) {
updateOutput();
}
};
separator_.addChangeHandler(changeHandler);
decimal_.addChangeHandler(changeHandler);
quote_.addChangeHandler(changeHandler);
encoding_.addChangeHandler(changeHandler);
comment_.addChangeHandler(changeHandler);
}
Aggregations