/** {@inheritDoc} */ @Override public String getText(int columnIndex) { if (columnIndex == Integer.MAX_VALUE) { return item.getHeaderText(); } else { return item.getText(columnIndex); } }
private String getToolTipText(final GridItem item, final int column) { String result = null; final IBaseLabelProvider labelProvider = getTableViewer().getLabelProvider(); if (labelProvider != null) { final Object element = item.getData(); result = ((TableRidgetLabelProvider) labelProvider).getToolTipText(element, column); } if (result == null) { result = item.getText(column); } return result; }
/** * ************************************************************************* Copy selected source * rows ************************************************************************ */ public void copySelected() { GridItem[] selection = getGrid().getSelection(); Clipboard clipboard = new Clipboard(Display.getCurrent()); String data = ""; for (GridItem item : selection) { if (!data.isEmpty()) data += "\n"; String line = item.getText(CodeViewerColumn.CODE.ordinal()); if (line != null) { line = line.trim(); } else { line = ""; } data += line; } clipboard.setContents(new Object[] {data}, new Transfer[] {TextTransfer.getInstance()}); clipboard.dispose(); }