Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2011 JBoss Inc
   * 
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
   * 
   * http://www.apache.org/licenses/LICENSE-2.0
   * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
  */
 package org.drools.workbench.screens.guided.dtable.client.widget;
 
 import java.util.List;
 import java.util.Map;
 
An editor for a BRL Condition Columns
 
         implements
         BRLConditionColumnView {
 
     private Presenter presenter;
 
     public BRLConditionColumnViewImplfinal Path path,
                                        final PackageDataModelOracle oracle,
                                        final GuidedDecisionTable52 model,
                                        final BRLConditionColumn column,
                                        final EventBus eventBus,
                                        final boolean isNew,
                                        final boolean isReadOnly ) {
         superpath,
                oracle,
                model,
                column,
                eventBus,
                isNew,
                isReadOnly );
 
     }
 
     protected boolean isHeaderUniqueString header ) {
         for ( CompositeColumn<?> cc : .getConditions() ) {
             for ( int iChild = 0; iChild < cc.getChildColumns().size(); iChild++ ) {
                 if ( cc.getChildColumns().getiChild ).getHeader().equalsheader ) ) {
                     return false;
                 }
             }
         }
         return true;
     }
 
         BRLRuleModel ruleModel = new BRLRuleModel );
         List<IPatterndefinition = column.getDefinition();
         ruleModel.lhs = definition.toArraynew IPatterndefinition.size() ] );
         return ruleModel;
     }
 
         return new RuleModellerConfigurationfalse,
                                               true,
                                               true );
     }
 
     public void setPresenterPresenter presenter ) {
         this. = presenter;
     }
 
     @Override
     protected void doInsertColumn() {
         this..setDefinition( Arrays.asListthis.. ) );
         .insertColumn( (BRLConditionColumnthis. );
     }
 
    @Override
    protected void doUpdateColumn() {
        this..setDefinition( Arrays.asListthis.. ) );
                                (BRLConditionColumnthis. );
    }
    @Override
        //If there are no variables add a boolean column to specify whether the fragment should apply 
        if ( ivs.size() == 0 ) {
            BRLConditionVariableColumn variable = new BRLConditionVariableColumn"",
                                                                                  . );
            variable.setHeader.getHeader() );
            variable.setHideColumn.isHideColumn() );
            List<BRLConditionVariableColumnvariables = new ArrayList<BRLConditionVariableColumn>();
            variables.addvariable );
            return variables;
        }
        //Convert to columns for use in the Decision Table
        BRLConditionVariableColumn[] variables = new BRLConditionVariableColumnivs.size() ];
        for ( Map.Entry<InterpolationVariableIntegerme : ivs.entrySet() ) {
            InterpolationVariable iv = me.getKey();
            int index = me.getValue();
            BRLConditionVariableColumn variable = new BRLConditionVariableColumniv.getVarName(),
                                                                                  iv.getDataType(),
                                                                                  iv.getFactType(),
                                                                                  iv.getFactField() );
            variable.setHeader.getHeader() );
            variable.setHideColumn.isHideColumn() );
            variablesindex ] = variable;
        }
        //Convert the array into a mutable list (Arrays.toList provides an immutable list)
        List<BRLConditionVariableColumnvariableList = new ArrayList<BRLConditionVariableColumn>();
        for ( BRLConditionVariableColumn variable : variables ) {
            variableList.addvariable );
        }
        return variableList;
    }
    @Override
        BRLConditionColumn clone = new BRLConditionColumn();
        clone.setHeadercol.getHeader() );
        clone.setHideColumncol.isHideColumn() );
        clone.setDefinitioncloneDefinitioncol.getDefinition() ) );
        clone.setChildColumnscloneVariablescol.getChildColumns() ) );
        return clone;
    }
        for ( BRLConditionVariableColumn variable : variables ) {
            clone.addcloneVariablevariable ) );
        }
        return clone;
    }
        BRLConditionVariableColumn clone = new BRLConditionVariableColumnvariable.getVarName(),
                                                                           variable.getFieldType(),
                                                                           variable.getFactType(),
                                                                           variable.getFactField() );
        clone.setHeadervariable.getHeader() );
        clone.setHideColumnvariable.isHideColumn() );
        clone.setWidthvariable.getWidth() );
        return clone;
    }
    private List<IPatterncloneDefinitionList<IPatterndefinition ) {
        RuleModelCloneVisitor visitor = new RuleModelCloneVisitor();
        RuleModel rm = new RuleModel();
        for ( IPattern pattern : definition ) {
            rm.addLhsItempattern );
        }
        RuleModel rmClone = visitor.visitRuleModelrm );
        List<IPatternclone = new ArrayList<IPattern>();
        for ( IPattern pattern : rmClone.lhs ) {
            clone.addpattern );
        }
        return clone;
    }
New to GrepCode? Check out our FAQ X