private boolean isValidFactType() { return !( editingCol.getBoundName() == null || "".equals( editingCol.getBoundName() ) ); }
private String getFactType() { if ( oracle.isGlobalVariable( editingCol.getBoundName() ) ) { return oracle.getGlobalVariable( editingCol.getBoundName() ); } return getFactType( this.editingCol.getBoundName() ); }
public SetFieldColActionDetectorKey( ActionSetFieldCol52 actionCol ) { super( actionCol ); this.boundName = actionCol.getBoundName(); this.factField = actionCol.getFactField(); }
private void doBindingLabel() { if ( this.editingCol.getBoundName() != null ) { this.bindingLabel.setText( "" + this.editingCol.getBoundName() ); } else { this.bindingLabel.setText( Constants.INSTANCE.pleaseChooseABoundFactForThisColumn() ); } }
private void doValueList() { if ( model.getTableFormat() == TableFormat.LIMITED_ENTRY ) { return; } //Don't show a Value List if either the Fact\Field is empty final String factType = utils.getBoundFactType( editingCol.getBoundName() ); final String factField = editingCol.getFactField(); boolean enableValueList = !( ( factType == null || "".equals( factType ) ) || ( factField == null || "".equals( factField ) ) ); //Don't show a Value List if the Fact\Field has an enumeration if ( enableValueList ) { enableValueList = !oracle.hasEnums( factType, factField ); } valueListWidget.setEnabled( enableValueList ); if ( !enableValueList ) { valueListWidget.setText( "" ); } }
public void onClick( ClickEvent arg0 ) { if ( oracle.isGlobalVariable( editingCol.getBoundName() ) ) { cb.setEnabled( false ); editingCol.setUpdate( false ); } else { editingCol.setUpdate( cb.getValue() ); } } } );
@Override public void initialise() { view.init( this ); view.setValidator( getValidator() ); patternToActionsMap.clear(); //Set-up validator for the pattern-to-action mapping voodoo getValidator().setPatternToActionSetFieldsMap( patternToActionsMap ); //Set-up a factory for value editors view.setDTCellValueWidgetFactory( DTCellValueWidgetFactory.getInstance( model, oracle, false, allowEmptyValues() ) ); //Existing ActionSetFieldCols (should be empty for a new Decision Table) for ( ActionCol52 a : model.getActionCols() ) { if ( a instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) a; final Pattern52 p = model.getConditionPattern( asf.getBoundName() ); if ( !patternToActionsMap.containsKey( p ) ) { patternToActionsMap.put( p, new ArrayList<ActionSetFieldCol52>() ); } final List<ActionSetFieldCol52> actions = patternToActionsMap.get( p ); actions.add( asf ); } } view.setChosenFields( new ArrayList<ActionSetFieldCol52>() ); content.setWidget( view ); }
final String binding = baseActionColumn.getBoundName(); for ( ActionCol52 ac : this.model.getActionCols() ) { if ( ac instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { currentValueMap.put( asf.getFactField(), getValue( asf ) );
final String binding = baseActionColumn.getBoundName(); for ( ActionCol52 ac : this.model.getActionCols() ) { if ( ac instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { if ( asf instanceof LimitedEntryCol ) { currentValueMap.put( asf.getFactField(),
private DecoratedGridCellValueAdaptor<? extends Comparable<?>> derieveCellFromAction( ActionSetFieldCol52 col ) { //Check if the column has a "Value List" or an enumeration. Value List takes precedence final String factType = utils.getBoundFactType( col.getBoundName() ); final String fieldName = col.getFactField(); if ( utils.hasValueList( col ) ) { return makeValueListCell( col ); } else if ( oracle.hasEnums( factType, fieldName ) ) { return makeEnumCell( factType, fieldName ); } return derieveCellFromModel( col ); }
final String binding = baseActionColumn.getBoundName(); for ( ActionCol52 ac : this.model.getActionCols() ) { if ( ac instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { if ( oracle.isDependentEnum( basePattern.getFactType(), baseActionColumn.getFactField(),
final Pattern52 basePattern = model.getConditionPattern( baseActionColumn.getBoundName() ); final String binding = baseActionColumn.getBoundName(); for ( ActionCol52 ac : this.model.getActionCols() ) { if ( ac instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { if ( oracle.isDependentEnum( basePattern.getFactType(), baseActionColumn.getFactField(),
final String binding = baseActionColumn.getBoundName(); for ( ActionCol52 ac : this.model.getActionCols() ) { if ( ac instanceof ActionSetFieldCol52 ) { final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { final int iCol = allColumns.indexOf( asf ); currentValueMap.put( asf.getFactField(),
private void showChangeFact( ClickEvent w ) { final FormStylePopup pop = new FormStylePopup(); final ListBox pats = this.loadBoundFacts( editingCol.getBoundName() ); pop.addAttribute( Constants.INSTANCE.ChooseFact(), pats ); Button ok = new Button( Constants.INSTANCE.OK() ); pop.addAttribute( "", ok ); ok.addClickHandler( new ClickHandler() { public void onClick( ClickEvent w ) { String val = pats.getValue( pats.getSelectedIndex() ); editingCol.setBoundName( val ); editingCol.setFactField( null ); makeLimitedValueWidget(); makeDefaultValueWidget(); doBindingLabel(); doFieldLabel(); doValueList(); pop.hide(); } } ); pop.show(); }
private void makeLimitedValueWidget() { if ( !( editingCol instanceof LimitedEntryActionSetFieldCol52 ) ) { return; } if ( nil( editingCol.getFactField() ) ) { setAttributeVisibility( limitedEntryValueAttributeIndex, false ); return; } LimitedEntryActionSetFieldCol52 lea = (LimitedEntryActionSetFieldCol52) editingCol; setAttributeVisibility( limitedEntryValueAttributeIndex, true ); if ( lea.getValue() == null ) { lea.setValue( factory.makeNewValue( editingCol ) ); } limitedEntryValueWidgetContainer.setWidget( factory.getWidget( model.getConditionPattern( editingCol.getBoundName() ), editingCol, lea.getValue() ) ); }
if ( !isEqualOrNull( origColumn.getBoundName(), editColumn.getBoundName() ) ) { if ( !isEqualOrNull( origColumn.getFactField(), editColumn.getFactField() ) ) {
private void populateModelColumn( final ActionSetFieldCol52 col, final ActionSetFieldCol52 editingCol ) { col.setBoundName( editingCol.getBoundName() ); col.setType( editingCol.getType() ); col.setFactField( editingCol.getFactField() ); col.setHeader( editingCol.getHeader() ); col.setValueList( editingCol.getValueList() ); col.setDefaultValue( editingCol.getDefaultValue() ); col.setHideColumn( editingCol.isHideColumn() ); col.setUpdate( editingCol.isUpdate() ); if ( col instanceof LimitedEntryCol && editingCol instanceof LimitedEntryCol ) { ( (LimitedEntryCol) col ).setValue( ( (LimitedEntryCol) editingCol ).getValue() ); } }
private void makeDefaultValueWidget() { if ( model.getTableFormat() == TableFormat.LIMITED_ENTRY ) { return; } if ( nil( editingCol.getFactField() ) ) { setAttributeVisibility( defaultValueWidgetContainerIndex, false ); return; } setAttributeVisibility( defaultValueWidgetContainerIndex, true ); if ( editingCol.getDefaultValue() == null ) { editingCol.setDefaultValue( factory.makeNewValue( editingCol ) ); } //Ensure the Default Value has been updated to represent the column's //data-type. Legacy Default Values are all String-based and need to be //coerced to the correct type final DTCellValue52 defaultValue = editingCol.getDefaultValue(); final DataType.DataTypes dataType = utilities.getDataType( editingCol ); utilities.assertDTCellValue( dataType, defaultValue ); defaultValueWidgetContainer.setWidget( factory.getWidget( model.getConditionPattern( editingCol.getBoundName() ), editingCol, defaultValue ) ); }
private ActionSetFieldCol52 cloneActionSetColumn( ActionSetFieldCol52 col ) { ActionSetFieldCol52 clone = null; if ( col instanceof LimitedEntryActionSetFieldCol52 ) { clone = new LimitedEntryActionSetFieldCol52(); DTCellValue52 dcv = cloneLimitedEntryValue( ( (LimitedEntryCol) col ).getValue() ); ( (LimitedEntryCol) clone ).setValue( dcv ); } else { clone = new ActionSetFieldCol52(); } clone.setBoundName( col.getBoundName() ); clone.setFactField( col.getFactField() ); clone.setHeader( col.getHeader() ); clone.setType( col.getType() ); clone.setValueList( col.getValueList() ); clone.setUpdate( col.isUpdate() ); clone.setDefaultValue( new DTCellValue52( col.getDefaultValue() ) ); clone.setHideColumn( col.isHideColumn() ); return clone; }
a3.getBoundName() ); assertEquals( "goo1", a3.getFactField() ); a4.getBoundName() ); assertEquals( "goo2", a4.getFactField() );