private boolean isValidFactField() { return !( editingCol.getFactField() == null || "".equals( editingCol.getFactField() ) ); }
public SetFieldColActionDetectorKey( ActionSetFieldCol52 actionCol ) { super( actionCol ); this.boundName = actionCol.getBoundName(); this.factField = actionCol.getFactField(); }
@Override public boolean hasEnums( final ActionSetFieldCol52 selectedAction ) { for ( Map.Entry<Pattern52, List<ActionSetFieldCol52>> e : this.patternToActionsMap.entrySet() ) { if ( e.getValue().contains( selectedAction ) ) { final String factType = e.getKey().getFactType(); final String factField = selectedAction.getFactField(); return this.oracle.hasEnums( factType, factField ); } } return false; }
private void doFieldLabel() { if ( this.editingCol.getFactField() != null ) { this.fieldLabel.setText( this.editingCol.getFactField() ); } else { this.fieldLabel.setText( Constants.INSTANCE.pleaseChooseAFactPatternFirst() ); } }
@Override public void render( final Context context, final ActionSetFieldCol52 value, final SafeHtmlBuilder sb ) { final StringBuilder b = new StringBuilder(); appendHeader( b, value ); b.append( value.getFactField() ); sb.append( TEMPLATE.text( getCssStyleName( value ), b.toString() ) ); }
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 w ) { editingCol.setFactField( box.getItemText( box.getSelectedIndex() ) ); editingCol.setType( oracle.getFieldType( factType, editingCol.getFactField() ) ); makeLimitedValueWidget(); makeDefaultValueWidget(); doFieldLabel(); doValueList(); pop.hide(); } } );
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 ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac; if ( asf.getBoundName().equals( binding ) ) { currentValueMap.put( asf.getFactField(), getValue( asf ) );
if ( asf.getBoundName().equals( binding ) ) { if ( oracle.isDependentEnum( basePattern.getFactType(), baseActionColumn.getFactField(), asf.getFactField() ) ) { dependentColumnIndexes.add( model.getExpandedColumns().indexOf( ac ) );
if ( asf.getBoundName().equals( binding ) ) { if ( asf instanceof LimitedEntryCol ) { currentValueMap.put( asf.getFactField(), getValue( (LimitedEntryCol) asf ) );
if ( !isEqualOrNull( origColumn.getFactField(), editColumn.getFactField() ) ) { bUpdateColumnData = true; bUpdateColumnDefinition = true; } else if ( !isEqualOrNull( origColumn.getFactField(), editColumn.getFactField() ) ) { bUpdateColumnData = true; bUpdateColumnDefinition = true; if ( origColumn.getFactField() != null && !origColumn.getFactField().equals( editColumn.getFactField() ) ) { bUpdateColumnDefinition = true;
if ( asf.getBoundName().equals( binding ) ) { if ( oracle.isDependentEnum( basePattern.getFactType(), baseActionColumn.getFactField(), asf.getFactField() ) ) { dependentColumnIndexes.add( allColumns.indexOf( ac ) );
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 ( asf.getBoundName().equals( binding ) ) { final int iCol = allColumns.indexOf( asf ); currentValueMap.put( asf.getFactField(), getValue( asf, rowData.get( iCol ) ) );
@Test public void testBackwardsCompatability() throws Exception { String xml = loadResource( "ExistingDecisionTable.xml" ); GuidedDecisionTable52 dt_ = GuidedDTXMLPersistence.getInstance().unmarshal( xml ); assertNotNull( dt_ ); assertEquals( "blah", dt_.getTableName() ); assertEquals( 1, dt_.getMetadataCols().size() ); assertEquals( 1, dt_.getAttributeCols().size() ); assertEquals( 2, dt_.getActionCols().size() ); assertEquals( 1, dt_.getConditions().size() ); assertEquals( 1, dt_.getConditions().get( 0 ).getChildColumns().size() ); assertTrue( dt_.getActionCols().get( 1 ) instanceof ActionSetFieldCol52 ); ActionSetFieldCol52 asf = (ActionSetFieldCol52) dt_.getActionCols().get( 1 ); assertEquals( "foo", asf.getFactField() ); assertEquals( false, asf.isUpdate() ); }
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 ) ); }
column.getFactField() ) ) { final Context context = new Context( pattern, column ); final Map<String, String> currentValueMap = dropDownManager.getCurrentValueMap( context ); final DropDownData dd = oracle.getEnums( pattern.getFactType(), column.getFactField(), currentValueMap ); if ( dd == null ) {
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; }