Пример #1
0
 /** {@inheritDoc} */
 @Override
 public String getText(int columnIndex) {
   if (columnIndex == Integer.MAX_VALUE) {
     return item.getHeaderText();
   } else {
     return item.getText(columnIndex);
   }
 }
Пример #2
0
 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;
 }
Пример #3
0
 /**
  * ************************************************************************* 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();
 }