Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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.testscenario.client;
 
 
 public class DataInputWidget
         extends DirtyableFlexTable
         implements ScenarioParentWidget {
 
     private final Scenario scenario;
     private final PackageDataModelOracle dmo;
     protected final String type;
     private final ScenarioParentWidget parent;
     private final ExecutionTrace executionTrace;
     private final FixtureList definitionList;
     private final String headerText;
 
     public DataInputWidget(String factType,
                            FixtureList definitionList,
                            Scenario scenario,
                            PackageDataModelOracle dmo,
                            ScenarioParentWidget parent,
                            ExecutionTrace executionTrace,
                            String headerText) {
 
         this. = scenario;
         this. = dmo;
         this. = factType;
 
         this. = parent;
         this. = executionTrace;
         this. = definitionList;
         this. = headerText;
 
         setStyles();
 
         renderEditor();
     }
 
     private void setStyles() {
         getCellFormatter().setStyleName(0,
                 0,
                 "modeller-fact-TypeHeader"); //NON-NLS
         getCellFormatter().setAlignment(0,
                 0,
                 .,
                 .);
         setStyleName("modeller-fact-pattern-Widget"); //NON-NLS
     }
 
 
     public void renderEditor() {
 
         clear();
 
         if (.size() == 0) {
             .renderEditor();
         }
 
         //This will work out what row is for what field, adding labels and remove icons
         FactDataWidgetFactory factDataWidgetFactory = new FactDataWidgetFactory(
                 ,
                 ,
                 ,
                 ,
                 this,
                 this);
         for (Fixture fixture : ) {
             if (fixture instanceof FactData) {
                 factDataWidgetFactory.build(
                         ,
                         (FactDatafixture);
             }
         }
                factDataWidgetFactory.amountOrRows() + 1,
                0,
                .);
        if (factDataWidgetFactory.amountOrRows() == 0) {
            setWidget(
                    1,
                    1,
                    new ClickableLabel(
                            ..AddAField(),
                            new AddFieldToFactDataClickHandler(
                                    ,
                                    ,
                                    )));
        }
    }
New to GrepCode? Check out our FAQ X