Revision 62b55a78
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4Composite.java | ||
---|---|---|
252 | 252 |
natTable.setConfigRegistry(configRegistry); |
253 | 253 |
|
254 | 254 |
//add tooltip to table |
255 |
new BulkEditorTooltip(natTable); |
|
255 |
new BulkEditorTooltip(natTable, colHeaderDataProvider);
|
|
256 | 256 |
} |
257 | 257 |
|
258 | 258 |
private void configureTable(){ |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorTooltip.java | ||
---|---|---|
11 | 11 |
import org.eclipse.jface.window.DefaultToolTip; |
12 | 12 |
import org.eclipse.jface.window.ToolTip; |
13 | 13 |
import org.eclipse.nebula.widgets.nattable.NatTable; |
14 |
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider; |
|
14 | 15 |
import org.eclipse.nebula.widgets.nattable.layer.LabelStack; |
15 | 16 |
import org.eclipse.swt.graphics.Point; |
16 | 17 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
26 | 27 |
public class BulkEditorTooltip extends DefaultToolTip { |
27 | 28 |
|
28 | 29 |
private NatTable natTable; |
30 |
private DefaultColumnHeaderDataProvider colHeaderDataProvider; |
|
29 | 31 |
|
30 |
public BulkEditorTooltip(NatTable natTable) { |
|
32 |
public BulkEditorTooltip(NatTable natTable, DefaultColumnHeaderDataProvider colHeaderDataProvider) {
|
|
31 | 33 |
super(natTable, ToolTip.NO_RECREATE, false); |
32 | 34 |
this.natTable = natTable; |
35 |
this.colHeaderDataProvider = colHeaderDataProvider; |
|
33 | 36 |
} |
34 | 37 |
|
35 | 38 |
@Override |
... | ... | |
52 | 55 |
else if(configLabels.hasLabel(BulkEditorE4Composite.LABEL_CANDIDATE)){ |
53 | 56 |
return Messages.BulkEditorTooltip_CANDIDATE; |
54 | 57 |
} |
58 |
int colIndex = this.natTable.getColumnIndexByPosition(col); |
|
59 |
int rowIndex = this.natTable.getRowIndexByPosition(row); |
|
60 |
if(rowIndex==0){ |
|
61 |
return colHeaderDataProvider.getDataValue(colIndex, rowIndex).toString(); |
|
62 |
} |
|
55 | 63 |
return ""; //$NON-NLS-1$ |
56 | 64 |
} |
57 | 65 |
|
... | ... | |
71 | 79 |
|| configLabels.hasLabel(BulkEditorE4Composite.LABEL_TARGET)){ |
72 | 80 |
return true; |
73 | 81 |
} |
82 |
|
|
83 |
int rowIndex = this.natTable.getRowIndexByPosition(row); |
|
84 |
if(rowIndex==0){ |
|
85 |
return true; |
|
86 |
} |
|
74 | 87 |
return false; |
75 | 88 |
} |
76 | 89 |
|
Also available in: Unified diff
ref #7502 Show tooltip for lock icon in header