/* (non-Javadoc)
@see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
353834
public Component getTableCellRendererComponent(JTable table, Object value,
      boolean isSelected, boolean hasFocus, int row, int column) {

    return (JProgressBar) value;

  }
1144534
public static Object getCellValue(Cell cell, boolean isTrimCellValue) {
		if (null == cell) {
			return null;
		}
		return getCellValue(cell, cell.getCellTypeEnum(), isTrimCellValue);
	}
1324529
@Override
    public boolean columnCondition(Writable writable) {
        BooleanWritable booleanWritable = (BooleanWritable) writable;
        return booleanWritable.get();
    }
838320
@Override
    public Component getTableCellEditorComponent(JTable table, Object value,
            boolean isSelected, int rowIndex, int vColIndex) {
        // 'value' is value contained in the cell located at (rowIndex, vColIndex)
        
        if (isSelected) {
            // cell (and perhaps other cells) are selected
        }
        
        // Configure the component with the specified value
        button.setText((String)value);

        row = rowIndex;
        
        // Return the configured component
        return button;
    }
1105745
private Class<? extends WComponent> getRowRendererClass() {
		RowIdWrapper wrapper = getCurrentRowIdWrapper();
		if (wrapper != null) {
			return table.getTableModel().getRendererClass(wrapper.getRowIndex());
		}
		return null;
	}
736152
@Override
    public Component getTreeCellRendererComponent(
            JTree tree,
            Object value,
            boolean sel,
            boolean expanded,
            boolean leaf,
            int row,
            boolean hasFocus) {

        super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);

        if (value instanceof AlertNode) {
            AlertNode alertNode = (AlertNode) value;
            if (alertNode.isRoot()) {
                if (expanded) {
                    this.setIcon(FOLDER_OPEN_ICON);
                } else {
                    this.setIcon(FOLDER_CLOSED_ICON);
                }
            } else if (alertNode.getParent().isRoot()) {
                // Add the alert flag icon
                Alert alert = alertNode.getUserObject();
                this.setIcon(alert.getIcon());
            } else {
                this.setIcon(LEAF_ICON);
            }
        }
        return this;
    }
768872
public static TableCellButtonRenderer newTableCellButtonRenderer(String text)
	{
		return new TableCellButtonRenderer(null, null)
		{
			private static final long serialVersionUID = 1L;

			@Override
			protected String onSetText(final Object value)
			{
				String currentText = text;
				return currentText;
			}
		};
	}
263903
function getTableCellByColumnTexts(table, cellData) {

      if (table.isPanel) {
        table = table.getView();
      }

      if (typeof cellData.one === 'undefined') {
        cellData.one = true;
      }
      if (typeof cellData.index === 'undefined') {
        cellData.index = 0;
      }

      var panel = table.ownerGrid;
      var visColumns = panel.getVisibleColumns();
      var text2DataIndex = {};
      var cellSelector = null;

      visColumns.forEach(function (col) {
        var key = col.text || col.tooltip;
        text2DataIndex[key] = col.dataIndex;
        if (key === cellData.column) {
          cellSelector = table.getCellSelector(col);
        }
      });

      if (!cellSelector) {
        throw new Error('Column ' + cellData.column + ' not found in visible columns');
      }

      var row = cellData.row.slice(0);

      row = row.map(function (tup) {
        var tmpTup = tup.slice(0);
        tmpTup[0] = text2DataIndex[tup[0]];
        if (!tmpTup[0]) {
          throw new Error('getTableCellByColumnTexts: No such column text: ' + tup[0]);
        }
        return tmpTup;
      });

      var internalIds = this.findRecordIds(table.getStore(), row);

      console.log(internalIds);

      if (cellData.one && (internalIds.length > 1)) {
        throw new Error('getTableCellByColumnTexts: one is true, but found ' + internalIds.length + ' records.');
      }

      var internalId = (cellData.index < 0) ? internalIds[internalIds.length + cellData.index] :
        internalIds[cellData.index];
      var rowDomId = this.getRowDomId(table, internalId);

      var rowDom = document.getElementById(rowDomId);
      var cellDom = rowDom.querySelector(cellSelector);

      return cellDom;
    }
226501
public Object getCellEditorValue()
    {
        boolean bValue = this.isSelected();
        if (bValue)
            return Boolean.TRUE.toString();
        else
            return Boolean.FALSE.toString();
    }
367731
private static Object getCellValue(Cell cell) throws Exception {
        Object value = null;
        if (cell instanceof ErrorCell) {
            value = null;
        } else if (cell instanceof LabelCell) {
            value = ((LabelCell) cell).getString();
        } else if (cell instanceof NumberCell) {
            value = ((NumberCell) cell).getValue();
        } else if (cell instanceof DateCell) {
            value = ((DateCell) cell).getDate();
        } else if (cell instanceof BooleanCell) {
            value = ((BooleanCell) cell).getValue();
        } /*else if (cell instanceof FormulaCell) {
            value = ((FormulaCell) cell).getFormula();
        }*/ else {
            value = cell.getContents();
        }
        return value;
    }
837069
private JTable getMainPanel() {
        if (table == null) {            
            model = new ScanProgressTableModel();
            
            table = new JTable();
            table.setModel(model);
            table.setRowSelectionAllowed(false);
            table.setColumnSelectionAllowed(false);
            table.setDoubleBuffered(true);

            // First column is for plugin's name
            table.getColumnModel().getColumn(0).setPreferredWidth(256);
            table.getColumnModel().getColumn(1).setPreferredWidth(80);

            // Second column is for plugin's status
            table.getColumnModel().getColumn(2).setPreferredWidth(80);
            table.getColumnModel().getColumn(2).setCellRenderer(new ScanProgressBarRenderer());

            // Third column is for plugin's elapsed time
            DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
            centerRenderer.setHorizontalAlignment(JLabel.CENTER);
            table.getColumnModel().getColumn(3).setPreferredWidth(85);                  
            table.getColumnModel().getColumn(3).setCellRenderer(centerRenderer);
            
            // Forth column is for plugin's request count
            DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
            rightRenderer.setHorizontalAlignment(JLabel.RIGHT);
            table.getColumnModel().getColumn(4).setPreferredWidth(60);
            table.getColumnModel().getColumn(4).setCellRenderer(rightRenderer);

            table.getColumnModel().getColumn(5).setPreferredWidth(60);
            table.getColumnModel().getColumn(5).setCellRenderer(rightRenderer);
            
            // Fifth column is for plugin's completion and actions
            table.getColumnModel().getColumn(6).setPreferredWidth(40);                  
            table.getColumnModel().getColumn(6).setCellRenderer(new ScanProgressActionRenderer());

            ScanProgressActionListener listener = new ScanProgressActionListener(table, model);
            table.addMouseListener(listener);
            table.addMouseMotionListener(listener);
        }
        
        return table;
    }
516621
@Override
    protected void getEndTextToRender(final FacesContext context,
                                      final UIComponent component,
                                      final String currentValue) throws IOException {
        final ResponseWriter writer = context.getResponseWriter();

        if (component instanceof UIInput) {
            writer.startElement(getHtmlTagName(), component);

            writer.writeAttribute("id", createInputClientId(context, component), "clientId");
            writer.writeAttribute("name", component.getClientId(context), "clientId");

            // TODO extract protected method
            // for text area based components the value can't be set this way
            if (!(component instanceof HtmlInputTextarea) && !(component instanceof HtmlCheckBox) && currentValue != null) {
                writer.writeAttribute("value", currentValue, "value");
            }

            // default
            this.renderBooleanValue(component, writer, "disabled");
            this.renderBooleanValue(component, writer, "ismap");
            this.renderBooleanValue(component, writer, "readonly");

            // html 5
            this.renderStringValue(component, writer, "autocomplete", "off");
            this.renderStringValue(component, writer, "placeholder");
            this.renderBooleanValue(component, writer, "autoFocus");
            this.renderBooleanValue(component, writer, "pattern");
            this.renderStringValue(component, writer, "min");
            this.renderStringValue(component, writer, "max");

            // html
            this.renderStringValue(component, writer, "alt");
            this.renderStringValue(component, writer, "dir");
            this.renderStringValue(component, writer, "lang");
            this.renderStringValue(component, writer, "maxlength");
            this.renderStringValue(component, writer, "role");
            this.renderStringValue(component, writer, "size");
            this.renderStringValue(component, writer, "style");
            this.renderStringValue(component, writer, "tabindex");
            this.renderStringValue(component, writer, "title");

            // events
            this.renderEventValue(component, writer, "onblur", "blur");
            this.renderEventValue(component, writer, "onclick", "click");
            this.renderEventValue(component, writer, "ondblclick", "dblclick");
            this.renderEventValue(component, writer, "onfocus", "focus");
            this.renderEventValue(component, writer, "onkeydown", "keydown");
            this.renderEventValue(component, writer, "onkeypress", "keypress");
            this.renderEventValue(component, writer, "onkeyup", "keyup");
            this.renderEventValue(component, writer, "onmousedown", "mousedown");
            this.renderEventValue(component, writer, "onmousemove", "mousemove");
            this.renderEventValue(component, writer, "onmouseout", "mouseout");
            this.renderEventValue(component, writer, "onmouseover", "mouseover");
            this.renderEventValue(component, writer, "onmouseup", "mouseup");
            this.renderEventValue(component, writer, "onselect", "select");
            this.renderEventValue(component, writer, "onchange", "change");

            this.renderInputStyleClass((HtmlInputComponent) component, writer);

            this.encodeTagType(component, writer);
            this.encodeAdditionalTagAttributes(component, writer, currentValue);

            this.renderAdditionalInputAttributes(context, component, writer);

            // for text area based components the value must be set this way
            if (component instanceof HtmlInputTextarea && currentValue != null) {
                writer.writeText(currentValue, null);
            }

            writer.endElement(getHtmlTagName());
        }
    }
42927
@Override
  public boolean getBooleanCellValue() {
    CellType cellType = getCellType();
    switch(cellType) {
      case BLANK:
        return false;
      case BOOLEAN:
        return rawContents != null && TRUE_AS_STRING.equals(rawContents);
      case FORMULA:
        throw new NotSupportedException();
      default:
        throw typeMismatch(CellType.BOOLEAN, cellType, false);
    }
  }
735859
public static Object getCellValue(int type, Cell cell) {
        switch (type) {
            case Cell.CELL_TYPE_BOOLEAN:
                return cell.getBooleanCellValue();
            case Cell.CELL_TYPE_NUMERIC:
                if (DateUtil.isCellDateFormatted(cell)) {
                    return DateUtil.getJavaDate(cell.getNumericCellValue());
                } else {
                    BigDecimal bd = new BigDecimal(cell.getNumericCellValue());
                    return bd.toString().contains(".") ? bd.setScale(2, RoundingMode.HALF_UP).toString() :
                            bd.toString();
                }
            case Cell.CELL_TYPE_STRING:
                try {
                    return DateUtils.parseDate(cell.getStringCellValue(), ReadExcelUtils.PATTERN);
                } catch (Exception e) {
                    return cell.getStringCellValue();
                }
            case Cell.CELL_TYPE_FORMULA:
                if (DateUtil.isCellDateFormatted(cell)) {
                    return cell.getDateCellValue();
                }
                break;
            default:
                break;
        }
        return null;
    }
931915
private TableCellRenderer installRendererIfPossible(Class objectClass, TableCellRenderer renderer) {
        TableCellRenderer currentRenderer = table.getDefaultRenderer(objectClass);

        if (currentRenderer instanceof UIResource) {
            table.setDefaultRenderer(objectClass, renderer);
        }

        return currentRenderer;
    }
453066
@Override
    protected SuperColumn getSuperColumnForRow(ConsistencyLevel consistencyLevel, String columnFamilyName,
            String rowKey, byte[] superColumnName, String persistenceUnit)
    {
        ColumnPath cp = new ColumnPath(columnFamilyName);
        cp.setSuper_column(superColumnName);
        ColumnOrSuperColumn cosc = null;
        Connection conn = thriftClient.getConnection();

        try
        {
            cosc = conn.getClient().get(ByteBuffer.wrap(rowKey.getBytes()), cp, consistencyLevel);
        }
        catch (InvalidRequestException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (NotFoundException e)
        {
            log.warn("Not found any record in inverted index table.");
        }
        catch (UnavailableException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (TimedOutException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (TException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        finally
        {
            thriftClient.releaseConnection(conn);
        }
        SuperColumn thriftSuperColumn = ThriftDataResultHelper.transformThriftResult(cosc,
                ColumnFamilyType.SUPER_COLUMN, null);
        return thriftSuperColumn;
    }
820572
public JKTableColumn getTableColumn(final int col, final boolean visibleIndex) {
		int actualIndex;
		if (visibleIndex) {
			actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(col);
		} else {
			actualIndex = col;
		}
		return this.tableColumns.get(actualIndex);
	}