Example usage for org.apache.commons.collections.buffer UnboundedFifoBuffer size

List of usage examples for org.apache.commons.collections.buffer UnboundedFifoBuffer size

Introduction

In this page you can find the example usage for org.apache.commons.collections.buffer UnboundedFifoBuffer size.

Prototype

public int size() 

Source Link

Document

Returns the number of elements stored in the buffer.

Usage

From source file:org.talend.designer.runtime.visualization.views.RuntimeGraphcsComposite.java

public void displayReportField() {
    if (reportField != null && !reportField.isDisposed()) {
        if (messageManager == null) {
            return;
        }/*from   ww w . j a  v a2s . co  m*/
        UnboundedFifoBuffer messages = messageManager.getMessages();
        Iterator iterator = messages.iterator();
        StringBuilder content = new StringBuilder();
        StyleRange[] styleRanges = new StyleRange[messages.size()];
        int i = 0;
        while (iterator.hasNext()) {
            ReportMessage message = (ReportMessage) iterator.next();
            content.append(message.getContent());
            styleRanges[i++] = message.getType();
        }
        reportField.setText(content.toString());
        reportField.setStyleRanges(styleRanges);
        //            reportField.setForeground(new Color(Display.getDefault(), 255, 0, 0));
        reportField.setTopIndex(Integer.MAX_VALUE);
    }
}