Project

General

Profile

« Previous | Next » 

Revision 49f4efde

Added by Katja Luther over 2 years ago

ref #9816: add tooltip to disabled fields and change color of fields with default value

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java
60 60
import org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer;
61 61
import org.eclipse.nebula.widgets.nattable.freeze.FreezeHelper;
62 62
import org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer;
63
import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
63 64
import org.eclipse.nebula.widgets.nattable.grid.command.ClientAreaResizeCommand;
64 65
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider;
65 66
import org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider;
......
75 76
import org.eclipse.nebula.widgets.nattable.layer.AbstractLayer;
76 77
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
77 78
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
79
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
78 80
import org.eclipse.nebula.widgets.nattable.persistence.gui.PersistenceDialog;
79 81
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
80 82
import org.eclipse.nebula.widgets.nattable.selection.command.SelectRowsCommand;
81 83
import org.eclipse.nebula.widgets.nattable.sort.SortHeaderLayer;
82 84
import org.eclipse.nebula.widgets.nattable.sort.config.SingleClickSortConfiguration;
83 85
import org.eclipse.nebula.widgets.nattable.style.theme.ModernNatTableThemeConfiguration;
86
import org.eclipse.nebula.widgets.nattable.tooltip.NatTableContentTooltip;
84 87
import org.eclipse.nebula.widgets.nattable.tree.ITreeRowModel;
85 88
import org.eclipse.nebula.widgets.nattable.tree.TreeLayer;
86 89
import org.eclipse.nebula.widgets.nattable.tree.command.TreeExpandToLevelCommand;
......
94 97
import org.eclipse.swt.layout.GridLayout;
95 98
import org.eclipse.swt.widgets.Button;
96 99
import org.eclipse.swt.widgets.Composite;
100
import org.eclipse.swt.widgets.Event;
97 101
import org.eclipse.swt.widgets.Menu;
98 102

  
99 103
import ca.odell.glazedlists.BasicEventList;
......
288 292
                natTable.doCommand(new TreeExpandToLevelCommand(deepestTaxonLevel-2));
289 293
            }
290 294
        }
291

  
295
        new NatTableContentTooltip(natTable, GridRegion.BODY) {
296
    		protected String getText(Event event) {
297
    			int col = this.natTable.getColumnPositionByX(event.x);
298
    	        int row = this.natTable.getRowPositionByY(event.y);
299

  
300
    	        ILayerCell cell = this.natTable.getCellByPosition(col, row);
301
    	        if (cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_EDITABLE)){
302
    	        	return "More than one element available, please check in factual data view.";
303
    	        }
304
    			return null;
305
    		}
306
    	};
307
    
292 308

  
293 309
        // clean up table state
294 310
        getNatTableState().remove(NatTable.INITIAL_PAINT_COMPLETE_FLAG);
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixLabelStyleConfiguration.java
63 63
        Style hasDefaultValueStyle = new Style();
64 64
        hasDefaultValueStyle.setAttributeValue(
65 65
                CellStyleAttributes.BACKGROUND_COLOR,
66
                GUIHelper.COLOR_GRAY);
66
                GUIHelper.COLOR_WIDGET_LIGHT_SHADOW);
67 67
        configRegistry.registerConfigAttribute(
68 68
                CellConfigAttributes.CELL_STYLE,
69 69
                hasDefaultValueStyle,

Also available in: Unified diff