Java Code Examples for org.eclipse.nebula.widgets.grid.Grid#getCellSelectionEnabled()
The following examples show how to use
org.eclipse.nebula.widgets.grid.Grid#getCellSelectionEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GridViewerEditor.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * FIXME * {@inheritDoc} */ @Override public ViewerCell getFocusCell() { Grid grid = (Grid)getViewer().getControl(); if( grid.getCellSelectionEnabled() ) { Point p = grid.getFocusCell(); if( p.x >= 0 && p.y >= 0 ) { GridItem item = grid.getItem(p.y); if( item != null ) { ViewerRow row = getViewerRowFromItem(item); return row.getCell(p.x); } } } return null; }
Example 2
Source File: GridViewerEditor.java From nebula with Eclipse Public License 2.0 | 6 votes |
public ViewerCell getFocusCell() { Grid grid = (Grid)getViewer().getControl(); if( grid.getCellSelectionEnabled() ) { Point p = grid.getFocusCell(); if( p.x >= 0 && p.y >= 0 ) { GridItem item = grid.getItem(p.y); if( item != null ) { ViewerRow row = getViewerRowFromItem(item); return row.getCell(p.x); } } } return null; }
Example 3
Source File: GridViewerEditor.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
/** * FIXME * {@inheritDoc} */ public ViewerCell getFocusCell() { Grid grid = (Grid)getViewer().getControl(); if( grid.getCellSelectionEnabled() ) { Point p = grid.getFocusCell(); if( p.x >= 0 && p.y >= 0 ) { GridItem item = grid.getItem(p.y); if( item != null ) { ViewerRow row = getViewerRowFromItem(item); return row.getCell(p.x); } } } return null; }
Example 4
Source File: GridViewerEditor.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
/** * FIXME * {@inheritDoc} */ public ViewerCell getFocusCell() { Grid grid = (Grid)getViewer().getControl(); if( grid.getCellSelectionEnabled() ) { Point p = grid.getFocusCell(); if( p.x >= 0 && p.y >= 0 ) { GridItem item = grid.getItem(p.y); if( item != null ) { ViewerRow row = getViewerRowFromItem(item); return row.getCell(p.x); } } } return null; }
Example 5
Source File: DefaultEmptyRowHeaderRenderer.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * {@inheritDoc} */ public void paint(GC gc, Object value) { gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); gc.fillRectangle(getBounds().x, getBounds().y, getBounds().width, getBounds().height + 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW)); Grid grid = (Grid) value; if (!grid.getCellSelectionEnabled()) { gc.drawLine(getBounds().x, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y); gc.drawLine(getBounds().x, getBounds().y, getBounds().x, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + 1); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + 1, getBounds().y + getBounds().height - 2); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 2, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); gc.drawLine(getBounds().x + 1, getBounds().y + getBounds().height - 2, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); } else { gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); } }
Example 6
Source File: DefaultEmptyRowHeaderRenderer.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public void paint(GC gc, Object value) { gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); gc.fillRectangle(getBounds().x, getBounds().y, getBounds().width, getBounds().height + 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW)); Grid grid = (Grid) value; if (!grid.getCellSelectionEnabled()) { gc.drawLine(getBounds().x, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y); gc.drawLine(getBounds().x, getBounds().y, getBounds().x, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + 1); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + 1, getBounds().y + getBounds().height - 2); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 2, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); gc.drawLine(getBounds().x + 1, getBounds().y + getBounds().height - 2, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); } else { gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); } }
Example 7
Source File: DefaultEmptyRowHeaderRenderer.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * {@inheritDoc} */ public void paint(GC gc, Object value) { gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); gc.fillRectangle(getBounds().x, getBounds().y, getBounds().width, getBounds().height + 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW)); Grid grid = (Grid) value; if (!grid.getCellSelectionEnabled()) { gc.drawLine(getBounds().x, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y); gc.drawLine(getBounds().x, getBounds().y, getBounds().x, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + 1); gc.drawLine(getBounds().x + 1, getBounds().y + 1, getBounds().x + 1, getBounds().y + getBounds().height - 2); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 2, getBounds().y + 1, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); gc.drawLine(getBounds().x + 1, getBounds().y + getBounds().height - 2, getBounds().x + getBounds().width - 2, getBounds().y + getBounds().height - 2); } else { gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); gc.drawLine(getBounds().x, getBounds().y + getBounds().height - 1, getBounds().x + getBounds().width - 1, getBounds().y + getBounds().height - 1); } }