use of com.google.gwt.view.client.SelectionChangeEvent in project drools-wb by kiegroup.
the class ActionSetFieldsPageViewImpl method initialiseAvailablePatterns.
private void initialiseAvailablePatterns() {
availablePatternsContainer.add(availablePatternsWidget);
availablePatternsWidget.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
availablePatternsWidget.setMinimumWidth(170);
final Label lstEmpty = GWT.create(Label.class);
lstEmpty.setText(GuidedDecisionTableConstants.INSTANCE.DecisionTableWizardNoAvailablePatterns());
lstEmpty.setStyleName(WizardCellListResources.INSTANCE.cellListStyle().cellListEmptyItem());
availablePatternsWidget.setEmptyListWidget(lstEmpty);
final SingleSelectionModel<Pattern52> selectionModel = new SingleSelectionModel<Pattern52>();
availablePatternsWidget.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(final SelectionChangeEvent event) {
availablePatternsSelection = selectionModel.getSelectedObject();
presenter.selectPattern(availablePatternsSelection);
}
});
}
use of com.google.gwt.view.client.SelectionChangeEvent in project drools-wb by kiegroup.
the class ColumnExpansionPageViewImpl method initialiseChosenColumns.
private void initialiseChosenColumns() {
chosenColumnsContainer.add(chosenColumnsWidget);
chosenColumnsWidget.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
chosenColumnsWidget.setMinimumWidth(270);
final Label lstEmpty = new Label(GuidedDecisionTableConstants.INSTANCE.DecisionTableWizardNoChosenColumns());
lstEmpty.setStyleName(WizardCellListResources.INSTANCE.cellListStyle().cellListEmptyItem());
chosenColumnsWidget.setEmptyListWidget(lstEmpty);
chosenColumnsWidget.setSelectionModel(chosenSelectionModel);
chosenSelectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(final SelectionChangeEvent event) {
chosenColumnsSelections = chosenSelectionModel.getSelectedSet();
btnRemove.setEnabled(chosenColumnsSelections.size() > 0);
}
});
}
use of com.google.gwt.view.client.SelectionChangeEvent in project drools-wb by kiegroup.
the class FactPatternConstraintsPageViewImpl method initialiseAvailablePatterns.
private void initialiseAvailablePatterns() {
availablePatternsContainer.add(availablePatternsWidget);
availablePatternsWidget.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
availablePatternsWidget.setMinimumWidth(170);
final Label lstEmpty = new Label(GuidedDecisionTableConstants.INSTANCE.DecisionTableWizardNoAvailablePatterns());
lstEmpty.setStyleName(WizardCellListResources.INSTANCE.cellListStyle().cellListEmptyItem());
availablePatternsWidget.setEmptyListWidget(lstEmpty);
final SingleSelectionModel<Pattern52> selectionModel = new SingleSelectionModel<Pattern52>();
availablePatternsWidget.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(final SelectionChangeEvent event) {
availablePatternsSelection = selectionModel.getSelectedObject();
presenter.selectPattern(availablePatternsSelection);
}
});
}
use of com.google.gwt.view.client.SelectionChangeEvent in project drools-wb by kiegroup.
the class FactPatternsPageViewImpl method initialiseChosenPatterns.
private void initialiseChosenPatterns() {
chosenPatternsContainer.add(chosenPatternWidget);
chosenPatternWidget.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
chosenPatternWidget.setMinimumWidth(270);
final Label lstEmpty = new Label(GuidedDecisionTableConstants.INSTANCE.DecisionTableWizardNoChosenPatterns());
lstEmpty.setStyleName(WizardCellListResources.INSTANCE.cellListStyle().cellListEmptyItem());
chosenPatternWidget.setEmptyListWidget(lstEmpty);
final MultiSelectionModel<Pattern52> selectionModel = new MultiSelectionModel<Pattern52>(System::identityHashCode);
chosenPatternWidget.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(final SelectionChangeEvent event) {
chosenPatternSelections = selectionModel.getSelectedSet();
chosenTypesSelected(chosenPatternSelections);
}
private void chosenTypesSelected(final Set<Pattern52> ps) {
btnRemove.setEnabled(true);
if (ps.size() == 1) {
chosenPatternSelection = ps.iterator().next();
patternDefinition.setVisible(true);
validateBinding();
txtBinding.setEnabled(true);
txtBinding.setText(chosenPatternSelection.getBoundName());
txtEntryPoint.setEnabled(true);
txtEntryPoint.setText(chosenPatternSelection.getEntryPointName());
enableMoveUpButton();
enableMoveDownButton();
presenter.isPatternEvent(chosenPatternSelection, new Callback<Boolean>() {
@Override
public void callback(final Boolean result) {
if (Boolean.TRUE.equals(result)) {
ddCEPWindow.setCEPWindow(chosenPatternSelection);
cepWindowContainer.setVisible(true);
} else {
cepWindowContainer.setVisible(false);
}
}
});
} else {
chosenPatternSelection = null;
patternDefinition.setVisible(false);
txtBinding.setEnabled(false);
txtBinding.setText("");
txtEntryPoint.setEnabled(false);
txtEntryPoint.setText("");
btnMoveUp.setEnabled(false);
btnMoveDown.setEnabled(false);
cepWindowContainer.setVisible(false);
}
}
});
}
use of com.google.gwt.view.client.SelectionChangeEvent in project drools-wb by kiegroup.
the class ActionSetFieldsPageViewImpl method initialiseAvailableFields.
private void initialiseAvailableFields() {
availableFieldsContainer.add(availableFieldsWidget);
availableFieldsWidget.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
availableFieldsWidget.setMinimumWidth(170);
final Label lstEmpty = new Label(GuidedDecisionTableConstants.INSTANCE.DecisionTableWizardNoAvailableFields());
lstEmpty.setStyleName(WizardCellListResources.INSTANCE.cellListStyle().cellListEmptyItem());
availableFieldsWidget.setEmptyListWidget(lstEmpty);
final MultiSelectionModel<AvailableField> selectionModel = new MultiSelectionModel<AvailableField>();
availableFieldsWidget.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(final SelectionChangeEvent event) {
availableFieldsSelections = selectionModel.getSelectedSet();
btnAdd.setEnabled(availableFieldsSelections.size() > 0);
}
});
}
Aggregations