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 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.
 import  org.drools.guvnor.client.common.FormStyleLayout;
 import  org.drools.guvnor.client.rpc.AnalysisReport;
 import  org.drools.guvnor.client.rpc.AnalysisReportLine;
 import  com.gwtext.client.util.Format;

Shows the results of an analysis run.

Michael Neale
 public class VerifierResultWidget extends Composite {
     private Constants     constants = GWT.createConstants.class );
     private EditItemEvent edit      = null;
     public VerifierResultWidget(AnalysisReport report,
                                 boolean showFactUsage,
                                 EditItemEvent edit) {
               showFactUsage );
         this. = edit;
     public VerifierResultWidget(AnalysisReport report,
                                 boolean showFactUsage) {
         FormStyleLayout layout = new FormStyleLayout();
         Tree tree = new Tree();
         TreeItem errors = doMessageLines.Errors(),
                                           report.errors );
         tree.addItemerrors );
         TreeItem warnings = doMessageLines.Warnings(),
                                             report.warnings );
         tree.addItemwarnings );
         TreeItem notes = doMessageLines.Notes(),
                                          report.notes );
         tree.addItemnotes );
         if ( showFactUsage ) {
             tree.addItemnew FactUsagesItemreport.factUsages ) );
         tree.addTreeListenerswapTitleWithUserObject() );
         layout.addRow( tree );
         initWidgetlayout );
     private TreeItem doMessageLines(String messageType,
                                     String icon,
                                     AnalysisReportLine[] lines) {
         TreeItem linesItem;
         String summary = Format.format( .analysisResultSummary(),
                                         "" + lines.length );
         String topicHtml = Format.format( "<img src='{0}' /> &nbsp; {1}",
                                           summary );
         linesItem = new VerifierMessageLinesItemtopicHtml,
         return linesItem;
        return new TreeListener() {
            public void onTreeItemSelected(TreeItem x) {
            //swap around with user object to toggle
            public void onTreeItemStateChanged(TreeItem x) {
                if ( x.getUserObject() != null ) {
                    Widget currentW = x.getWidget();
                    x.setWidget( (Widgetx.getUserObject() );
                    x.setUserObjectcurrentW );
New to GrepCode? Check out our FAQ X