@Override public void enableHandler( final NewResourceHandler handler, final boolean enabled ) { final RadioButton handlerOption = this.handlerToWidgetMap.get( handler ); if ( handlerOption == null ) { return; } handlerOption.setEnabled( enabled ); }
private RadioButton makeOption( final NewResourceHandler handler ) { final RadioButton option = new RadioButton( "handlers", handler.getDescription() ); option.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange( ValueChangeEvent<Boolean> event ) { if ( event.getValue() == true ) { selectNewResourceHandler( handler ); } } } ); return option; }
private void initialiseCalculationTypes() { optLiteral.addClickHandler( new ClickHandler() { optFormula.addClickHandler( new ClickHandler() { optPredicate.addClickHandler( new ClickHandler() {
/** * @see #RadioButton(String, SafeHtml) * * @param name * the group name with which to associate the radio button * @param label * this radio button's label * @param directionEstimator * A DirectionEstimator object used for automatic direction * adjustment. For convenience, * {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used. */ public RadioButton(String name, String label, DirectionEstimator directionEstimator) { this(name); setDirectionEstimator(directionEstimator); setText(label); }
/** * Creates a new radio button associated with a particular group, and * initialized with the given label (optionally treated as HTML). All radio * buttons associated with the same group name belong to a * mutually-exclusive set. * * Radio buttons are grouped by their name attribute, so changing their name * using the setName() method will also change their associated group. * * @param name * name the group with which to associate the radio button * @param label * this radio button's label * @param asHTML * <code>true</code> to treat the specified label as HTML */ public RadioButton(String name, String label, boolean asHTML) { this(name); if (asHTML) { setHTML(label); } else { setText(label); } }
private void displayCalculationTypes( final Pattern52 selectedPattern, final ConditionCol52 selectedCondition ) { final boolean isPredicate = ( selectedCondition.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ); final boolean hasEnum = presenter.hasEnum( selectedPattern, selectedCondition ); calculationType.setVisible( !isPredicate ); optLiteral.setEnabled( !isPredicate ); optLiteral.setVisible( !isPredicate ); optFormula.setEnabled( !( isPredicate || hasEnum ) ); optFormula.setVisible( !isPredicate ); operatorContainer.setVisible( !isPredicate ); optPredicate.setEnabled( isPredicate ); optPredicate.setVisible( isPredicate ); txtPredicateExpression.setEnabled( isPredicate ); predicateExpressionContainer.setVisible( isPredicate ); }
literal.setValue( true ); binding.setEnabled( !isReadOnly ); break; case BaseSingleFieldConstraint.TYPE_RET_VALUE: formula.setValue( true ); binding.setEnabled( false ); break; case BaseSingleFieldConstraint.TYPE_PREDICATE: predicate.setValue( true ); binding.setEnabled( false ); literal.addClickHandler( new ClickHandler() { public void onClick( ClickEvent w ) { editingCol.setFactField( null ); formula.addClickHandler( new ClickHandler() { public void onClick( ClickEvent w ) { editingCol.setFactField( null ); predicate.addClickHandler( new ClickHandler() { public void onClick( ClickEvent w ) { editingCol.setFactField( null );
@Override public void setActiveHandler( final NewResourceHandler handler ) { final List<Pair<String, ? extends IsWidget>> extensions = handler.getExtensions(); handlerExtensions.clear(); handlerExtensions.setVisible( !( extensions == null || extensions.isEmpty() ) ); if ( extensions != null ) { for ( Pair<String, ? extends IsWidget> extension : extensions ) { handlerExtensions.add( extension.getK2() ); } } //Select handler final RadioButton option = handlerToWidgetMap.get( handler ); if ( option != null ) { option.setValue( true, true ); } }
/** * @see #RadioButton(String, SafeHtml) * * @param name * the group name with which to associate the radio button * @param label * this radio button's html label * @param directionEstimator * A DirectionEstimator object used for automatic direction * adjustment. For convenience, * {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used. */ public RadioButton(String name, SafeHtml label, DirectionEstimator directionEstimator) { this(name); setDirectionEstimator(directionEstimator); setHTML(label.asString()); }
/** * @see #RadioButton(String, SafeHtml) * * @param name * the group name with which to associate the radio button * @param label * this radio button's html label * @param dir * the text's direction. Note that {@code DEFAULT} means * direction should be inherited from the widget's parent * element. */ public RadioButton(String name, SafeHtml label, Direction dir) { this(name); setHTML(label, dir); }
/** * Change the group name of this radio button. * * Radio buttons are grouped by their name attribute, so changing their name * using the setName() method will also change their associated group. * * If changing this group name results in a new radio group with multiple * radio buttons selected, this radio button will remain selected and the * other radio buttons will be unselected. * * @param name * name the group with which to associate the radio button */ @Override public void setName(String name) { // Just changing the radio button name tends to break groupiness, // so we have to replace it. Note that replaceInputElement is careful // not to propagate name when it propagates everything else replaceInputElement(DOM.createInputRadio(name)); }
optLiteral.setValue( true ); displayCalculationTypes( availablePatternsSelection, chosenConditionsSelection ); break; case BaseSingleFieldConstraint.TYPE_RET_VALUE: optFormula.setValue( true ); displayCalculationTypes( availablePatternsSelection, chosenConditionsSelection ); break; case BaseSingleFieldConstraint.TYPE_PREDICATE: optPredicate.setValue( true ); displayCalculationTypes( availablePatternsSelection, chosenConditionsSelection );
private void doCalculationType() { if ( model.getTableFormat() == TableFormat.LIMITED_ENTRY ) { return; } //Disable Formula and Predicate if the Fact\Field has enums final String factType = editingPattern.getFactType(); final String factField = editingCol.getFactField(); final boolean hasEnums = oracle.hasEnums( factType, factField ); this.literal.setEnabled( hasEnums || !isReadOnly ); this.formula.setEnabled( !( hasEnums || isReadOnly ) ); this.predicate.setEnabled( !( hasEnums || isReadOnly ) ); //If Fact\Field has enums the Value Type has to be a literal if ( hasEnums ) { this.editingCol.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); } }
private void chosenConditionsSelected( final Set<ConditionCol52> cws ) { btnRemove.setEnabled( true ); if ( cws.size() == 1 ) { chosenConditionsSelection = cws.iterator().next(); conditionDefinition.setVisible( true ); validateConditionHeader(); validateConditionOperator(); populateConditionDefinition(); enableMoveUpButton(); enableMoveDownButton(); } else { chosenConditionsSelection = null; conditionDefinition.setVisible( false ); optLiteral.setEnabled( false ); optFormula.setEnabled( false ); optPredicate.setEnabled( false ); txtColumnHeader.setEnabled( false ); txtValueList.setEnabled( false ); defaultValueContainer.setVisible( false ); btnMoveUp.setEnabled( false ); btnMoveDown.setEnabled( false ); } }