returns the csv output for a cell.<p>

@param item the item to render the cell for

@return csv output
183882
public String csvCell(CmsListItem item) {

        if (!isVisible()) {
            return "";
        }
        StringBuffer csv = new StringBuffer(512);
        if (m_formatter == null) {
            // unformatted output
            if (item.get(m_id) != null) {
                // null values are not showed by default
                csv.append(item.get(m_id).toString());
            } else {
                Iterator<I_CmsListDirectAction> itActions = m_directActions.iterator();
                while (itActions.hasNext()) {
                    I_CmsListDirectAction action = itActions.next();
                    if (action.isVisible()) {
                        action.setItem(item);
                        csv.append(action.getName().key(getWp().getLocale()));
                    }
                }
            }
        } else {
            // formatted output
            csv.append(m_formatter.format(item.get(m_id), getWp().getLocale()));
        }
        return csv.toString();
    }
1228074
def itemData(self, treeItem, column, role=Qt.DisplayRole):
        
        if role == Qt.DisplayRole:
            if column == self.COL_NODE_NAME:
                return treeItem.nodeName
            elif column == self.COL_NODE_PATH:
                return treeItem.nodePath
            elif column == self.COL_VALUE:
                return treeItem.displayValue
            elif column == self.COL_DEF_VALUE:
                return treeItem.displayDefaultValue
            elif column == self.COL_CTI_TYPE:
                return type_name(treeItem)
            elif column == self.COL_DEBUG:
                return treeItem.debugInfo
            else:
                raise ValueError("Invalid column: {}".format(column))

        elif role == Qt.EditRole:
            if column == self.COL_VALUE:
                return treeItem.data
            else:
                raise ValueError("Invalid column: {}".format(column))

        elif role == Qt.ToolTipRole:
            if column == self.COL_NODE_NAME or column == self.COL_NODE_PATH:
                return treeItem.nodePath
            elif column == self.COL_VALUE:
                # Give Access to exact values. In particular in scientific-notation spin boxes
                return repr(treeItem.configValue)
            elif column == self.COL_DEF_VALUE:
                return treeItem.displayDefaultValue
            elif column == self.COL_CTI_TYPE:
                return type_name(treeItem)
            elif column == self.COL_DEBUG:
                return treeItem.debugInfo
            else:
                return None

        elif role == Qt.CheckStateRole:
            if column != self.COL_VALUE:
                # The CheckStateRole is called for each cell so return None here.
                return None
            else:
                return treeItem.checkState
        else:
            return super(ConfigTreeModel, self).itemData(treeItem, column, role=role)
629672
private void addCell(Listitem item, Object value) {
        createCell(item, value, null, null);
    }
1160084
def as_csv(self):
        """"""

        from io import StringIO

        s = StringIO()
        w = csv.writer(s)
        for row in self.rows:
            w.writerow(row)

        return s.getvalue()
397686
@Override
    public void renderItem(final Comboitem item, final Document doc) {
        item.setLabel(doc.getTitle());
    }
788207
@Override
    public TableCellRenderer getCellRenderer(int row, int column) {
        PropertySheetTableModel.Item item = getSheetModel()
                .getPropertySheetElement(row);

        switch (column) {
            case PropertySheetTableModel.NAME_COLUMN:
                // name column gets a custom renderer
                return nameRenderer;

            case PropertySheetTableModel.VALUE_COLUMN:
                if (!item.isProperty()) {
                    return nameRenderer;
                }

                // property value column gets the renderer from the factory
                Property property = item.getProperty();
                TableCellRenderer renderer = getRendererFactory().createTableCellRenderer(property);
                if (renderer == null) {
                    renderer = getCellRenderer(property.getType());
                }
                return renderer;
            default:
                // when will this happen, given the above?
                return super.getCellRenderer(row, column);
        }
    }
54087
public int submitSingle(T item) {
        if (Objects.isNull(item))
            return 0;
        synchronized (this.dataList) {
            this.dataList.add(item);
            setLastDataTimestamp();
            if (this.dataList.size() >= this.bulkSize)
                flush();
            return 1;
        }
    }
203667
public TableWriteItems addItemToPut(Item item) {
        if (item != null) {
            if (itemsToPut == null)
                itemsToPut = new ArrayList<Item>();
            this.itemsToPut.add(item);
        }
        return this;
    }
1085644
private byte[] getExcelOutput(FileColumn[] columns, List<String[]> lines) throws IOException
    {
        // Create the workbook
        baos = new ByteArrayOutputStream(1024);
        if(existing != null)
            workbook = Workbook.createWorkbook(format, baos, existing);
        else
            workbook = Workbook.createWorkbook(format, baos);

        workbook.setHeaders(hasHeaders());

        if(append && workbook.getSheet(worksheet) != null)
            workbook.appendToSheet(columns, lines, worksheet);
        else
            workbook.createSheet(columns, lines, worksheet);

        // Write out the workbook to the stream
        workbook.write();
        workbook.close();

        // The contents returned is the byte array
        return baos.toByteArray();
    }
214136
def get_item_data(self, session, item, byte_range=None):
        

        # Parse byte range
        if byte_range is not None:
            begin, end = parse_byte_range(byte_range, max_byte=item.file_size)
        else:
            begin, end = 0, item.file_size

        # Open the file
        fp = open(item.file_name, "rb+")

        if not begin:
            return fp, item.file_type, item.file_size
        elif begin and not end:
            fp.seek(begin)
            return fp, item.file_type, item.file_size
        elif begin and end:
            fp.seek(begin)

            data = fp.read(end - begin)
            result = cStringIO.StringIO(data)

            return result, item.file_type, item.file_size
157054
public String getCsv() {

        StringWriter writer = new StringWriter();
        try (CSVWriter csv = new CSVWriter(writer)) {
            List<String> headers = new ArrayList<>();
            for (String col : m_columns) {
                headers.add(col);
            }
            csv.writeNext(headers.toArray(new String[] {}));
            for (List<Object> row : m_data) {
                List<String> colCsv = new ArrayList<>();
                for (Object col : row) {
                    colCsv.add(String.valueOf(col));
                }
                csv.writeNext(colCsv.toArray(new String[] {}));
            }
            return writer.toString();
        } catch (IOException e) {
            return null;
        }
    }
929788
@Override
    public int getItemType(BaseCell item) {
        // if the item is a keyType, which means item.type is not the key
        int version = mViewManager != null ? mViewManager.getViewVersion(item.stringType) : 0;
        if (!TextUtils.isEmpty(item.typeKey)) {
            // we should use getTypeKey()
            String typeKey = item.typeKey + version;
            if (!mStrKeys.containsKey(typeKey)) {
                int newType = mTypeId.getAndIncrement();
                mStrKeys.put(typeKey, newType);
                mId2Types.put(newType, item.stringType);
            }

            return mStrKeys.get(typeKey).intValue();
        } else {
            // otherwise, use item.type as identity key
            // note, this now only be executed in MainThread, atomic not actually needed
            String stringType = item.stringType + version;
            if (!mStrKeys.containsKey(stringType)) {
                int newType = mTypeId.getAndIncrement();
                mStrKeys.put(stringType, newType);
                mId2Types.put(newType, item.stringType);
            }
            return mStrKeys.get(stringType).intValue();
        }
    }
1176122
public String generateCsv() throws ClassNotFoundException {

        CmsHtmlList list = A_CmsListDialog.getListObject(Class.forName(getParamListclass()), getSettings());
        return list.listCsv();
    }
813791
public CmsContextMenu getContextMenuForItem(Object itemId) {

        CmsContextMenu result = null;
        try {
            final Item item = m_container.getItem(itemId);
            Property<?> keyProp = item.getItemProperty(TableProperty.KEY);
            String key = (String)keyProp.getValue();
            if ((null != key) && !key.isEmpty()) {
                loadAllRemainingLocalizations();
                final Map<Locale, String> localesWithEntries = new HashMap<Locale, String>();
                for (Locale l : m_localizations.keySet()) {
                    if (l != m_locale) {
                        String value = m_localizations.get(l).getProperty(key);
                        if ((null != value) && !value.isEmpty()) {
                            localesWithEntries.put(l, value);
                        }
                    }
                }
                if (!localesWithEntries.isEmpty()) {
                    result = new CmsContextMenu();
                    ContextMenuItem mainItem = result.addItem(
                        Messages.get().getBundle(UI.getCurrent().getLocale()).key(
                            Messages.GUI_BUNDLE_EDITOR_CONTEXT_COPY_LOCALE_0));
                    for (final Locale l : localesWithEntries.keySet()) {

                        ContextMenuItem menuItem = mainItem.addItem(l.getDisplayName(UI.getCurrent().getLocale()));
                        menuItem.addItemClickListener(new ContextMenuItemClickListener() {

                            public void contextMenuItemClicked(ContextMenuItemClickEvent event) {

                                item.getItemProperty(TableProperty.TRANSLATION).setValue(localesWithEntries.get(l));

                            }
                        });
                    }
                }
            }
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
            //TODO: Improve
        }
        return result;
    }
815131
public static <T> List<T> create(final T item) {
        final List<T> list = new ArrayList<T>();
        list.add(item);
        return list;
    }
667814
public synchronized void putString(String item)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "putString", item);

      checkValid();

      // A String is presented by a BIT16 denoting the length followed by encoded bytes. If the
      // String is null, then a length of 1, followed by a single null byte (0x00) is written into
      // the buffer.
      if (item == null)
      {
         WsByteBuffer currentBuffer = getCurrentByteBuffer(3);
         currentBuffer.putShort((short) 1);
         currentBuffer.put(new byte[] { (byte) 0 });
      }
      else
      {
         try
         {
            byte[] stringAsBytes = item.getBytes(stringEncoding);
            WsByteBuffer currentBuffer = getCurrentByteBuffer(2 + stringAsBytes.length);
            currentBuffer.putShort((short) stringAsBytes.length);
            currentBuffer.put(stringAsBytes);
         }
         catch (UnsupportedEncodingException e)
         {
            FFDCFilter.processException(e, CLASS_NAME + ".putString",
                                        CommsConstants.COMMSBYTEBUFFER_PUTSTRING_01,
                                        this);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unable to encode String: ", e);

            SibTr.error(tc, "UNSUPPORTED_STRING_ENCODING_SICO8005", new Object[] {stringEncoding, e});

            throw new SIErrorException(
               TraceNLS.getFormattedMessage(CommsConstants.MSG_BUNDLE, "UNSUPPORTED_STRING_ENCODING_SICO8005", new Object[] {stringEncoding, e}, null)
            );
         }
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "putString");
   }
291891
StringBuilder getOutput() {
        if( output == null ) {
            CssFormatter block = copy( null );
            state.results.add( new CssPlainOutput( block.output ) );
            output = block.output;
        }
        return output;
    }