Search in sources :

Example 21 with SelectionChangeEvent

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);
        }
    });
}
Also used : Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) SingleSelectionModel(com.google.gwt.view.client.SingleSelectionModel) Label(org.gwtbootstrap3.client.ui.Label) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Example 22 with SelectionChangeEvent

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);
        }
    });
}
Also used : Label(org.gwtbootstrap3.client.ui.Label) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Example 23 with SelectionChangeEvent

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);
        }
    });
}
Also used : Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) SingleSelectionModel(com.google.gwt.view.client.SingleSelectionModel) Label(org.gwtbootstrap3.client.ui.Label) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Example 24 with SelectionChangeEvent

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);
            }
        }
    });
}
Also used : Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) Callback(org.uberfire.client.callbacks.Callback) MultiSelectionModel(com.google.gwt.view.client.MultiSelectionModel) Label(org.gwtbootstrap3.client.ui.Label) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Example 25 with SelectionChangeEvent

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);
        }
    });
}
Also used : MultiSelectionModel(com.google.gwt.view.client.MultiSelectionModel) Label(org.gwtbootstrap3.client.ui.Label) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Aggregations

SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)31 Label (org.gwtbootstrap3.client.ui.Label)16 MultiSelectionModel (com.google.gwt.view.client.MultiSelectionModel)12 SingleSelectionModel (com.google.gwt.view.client.SingleSelectionModel)9 Column (com.google.gwt.user.cellview.client.Column)6 ArrayList (java.util.ArrayList)5 TextCell (com.google.gwt.cell.client.TextCell)4 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 Group (cz.metacentrum.perun.webgui.model.Group)4 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)3 Handler (com.google.gwt.view.client.SelectionChangeEvent.Handler)3 HashSet (java.util.HashSet)3 Set (java.util.Set)3 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)3 Revision (org.eclipse.che.api.git.shared.Revision)3 DoubleClickEvent (com.google.gwt.event.dom.client.DoubleClickEvent)2 DoubleClickHandler (com.google.gwt.event.dom.client.DoubleClickHandler)2 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)2