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.guvnor.client.widgets.tables;
 
 import java.util.Date;
 
 
Widget with a table of Log entries.
 
 public class LogPagedTable extends AbstractPagedTable<LogPageRow>
     implements
     EventLogView {
 
     // UI
     interface LogPagedTableBinder
         extends
         UiBinder<WidgetLogPagedTable> {
     }
 
     @UiField()
     protected Button                   cleanButton;
 
     @UiField()
     protected Button                   refreshButton;
 
     private static LogPagedTableBinder uiBinder        = GWT.createLogPagedTableBinder.class );
 
     private static ImagesCore images          = (ImagesCore) GWT.createImagesCore.class );
     private static final String        HTML_ERROR_ICON = makeImage.error() );
     private static final String        HTML_INFO_ICON  = makeImage.information() );
 
     private static String makeImage(ImageResource resource) {
         AbstractImagePrototype prototype = AbstractImagePrototype.createresource );
         return prototype.getHTML();
     }
 
     // Other stuff
     private static final int PAGE_SIZE = 10;

    
Constructor

Parameters:
cleanCommand
 
     public LogPagedTable() {
         super );
     }
 
     @Override
     protected void addAncillaryColumns(ColumnPicker<LogPageRowcolumnPicker,
                                        SortableHeaderGroup<LogPageRowsortableHeaderGroup) {
 
         // Things got messy with nested, nested anonymous classes
         AbstractCell<LongseverityCell = new AbstractCell<Long>() {
 
             @Override
             public void render(Context context,
                                Long value,
                                SafeHtmlBuilder sb) {
                 if ( value.intValue() == 0 ) {
                     sb.appendHtmlConstant );
                 } else if ( value.intValue() == 1 ) {
                     sb.appendHtmlConstant );
                 }
             }
        };
        Column<LogPageRowLongseverityColumn = new Column<LogPageRowLong>( severityCell ) {
            public Long getValue(LogPageRow row) {
                return Long.valueOfrow.getSeverity() );
            }
        };
        columnPicker.addColumnseverityColumn,
                                new SortableHeader<LogPageRowLong>(
                                                                      sortableHeaderGroup,
                                                                      .Severity(),
                                                                      severityColumn ),
                                true );
        Column<LogPageRowStringmessageColumn = new Column<LogPageRowString>( new TextCell() ) {
            public String getValue(LogPageRow row) {
                return row.getMessage();
            }
        };
        columnPicker.addColumnmessageColumn,
                                new SortableHeader<LogPageRowString>(
                                                                        sortableHeaderGroup,
                                                                        .Message(),
                                                                        messageColumn ),
                                true );
        Column<LogPageRowDatetimestampColumn = new Column<LogPageRowDate>( new DateCell( DateTimeFormat.getFormat.. ) ) ) {
            public Date getValue(LogPageRow row) {
                return row.getTimestamp();
            }
        };
        columnPicker.addColumntimestampColumn,
                                new SortableHeader<LogPageRowDate>( sortableHeaderGroup,
                                                                      .Timestamp(),
                                                                      timestampColumn ),
                                true );
    }
    @Override
    protected Widget makeWidget() {
        return .createAndBindUithis );
    }
        return this.;
    }
        return this.;
    }
    public void showClearingLogMessage() {
        LoadingPopup.showMessage.CleaningLogMessages() );
    }
    public void hideClearingLogMessage() {
        LoadingPopup.close();
    }
    public int getStartRowIndex() {
        return this..getPageStart();
    }
    public int getPageSize() {
        return ;
    }
New to GrepCode? Check out our FAQ X