本文整理汇总了Java中org.eclipse.jface.viewers.ViewerRow类的典型用法代码示例。如果您正苦于以下问题:Java ViewerRow类的具体用法?Java ViewerRow怎么用?Java ViewerRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewerRow类属于org.eclipse.jface.viewers包,在下文中一共展示了ViewerRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hookListener
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
private void hookListener(final ColumnViewer viewer) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
if ((event.detail & SWT.SELECTED) > 0) {
ViewerCell focusCell = getFocusCell();
ViewerRow row = focusCell.getViewerRow();
Assert.isNotNull(row, "Internal structure invalid. Item without associated row is not possible."); //$NON-NLS-1$
ViewerCell cell = row.getCell(event.index);
if (focusCell == null || !cell.equals(focusCell)) {
removeSelectionInformation(event, cell);
} else {
markFocusedCell(event, cell);
}
}
}
};
viewer.getControl().addListener(SWT.EraseItem, listener);
}
示例2: editElement
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
public void editElement(Object element, int column) {
if (element instanceof TreePath) {
setSelection(new TreeSelection((TreePath) element));
GalleryItem[] items = gallery.getSelection();
if (items.length == 1) {
ViewerRow row = getViewerRowFromItem(items[0]);
if (row != null) {
ViewerCell cell = row.getCell(column);
if (cell != null) {
getControl().setRedraw(false);
triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(cell));
getControl().setRedraw(true);
}
}
}
} else {
super.editElement(element, column);
}
}
示例3: createNewRowPart
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* Create a new ViewerRow at rowIndex
*
* @param parent
* the parent row
* @param style
* the style bits to use for the new row
* @param rowIndex
* the index at which the new row should be created under the parent
* @return ViewerRow
* the new row
*/
private ViewerRow createNewRowPart(ViewerRow parent, int style, int rowIndex) {
if (parent == null) {
if (rowIndex >= 0) {
return getViewerRowFromItem(new GridItem(grid, style, rowIndex));
}
return getViewerRowFromItem(new GridItem(grid, style));
}
if (rowIndex >= 0) {
return getViewerRowFromItem(new GridItem((GridItem) parent
.getItem(), SWT.NONE, rowIndex));
}
return getViewerRowFromItem(new GridItem((GridItem) parent.getItem(),
SWT.NONE));
}
示例4: editElement
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void editElement(Object element, int column) {
try {
getControl().setRedraw(false);
Widget item = findItem(element);
if (item != null) {
ViewerRow row = getViewerRowFromItem(item);
if (row != null) {
ViewerCell cell = row.getCell(column);
if (cell != null) {
triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(
cell));
}
}
}
} finally {
getControl().setRedraw(true);
}
// }
}
示例5: getFocusCell
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* 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;
}
示例6: internalCreateNewRowPart
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
protected ViewerRow internalCreateNewRowPart(int style, int rowIndex) {
TableItem item;
if (rowIndex >= 0) {
item = new TableItem(tableCombo.getTable(), style, rowIndex);
} else {
item = new TableItem(tableCombo.getTable(), style);
}
return getViewerRowFromItem(item);
}
示例7: getViewerRowFromItem
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
protected ViewerRow getViewerRowFromItem(Widget item) {
if (cachedRow == null) {
cachedRow = new TableComboViewerRow((TableItem) item);
} else {
cachedRow.setItem((TableItem) item);
}
return cachedRow;
}
示例8: isNodeExpanded
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
private boolean isNodeExpanded(final ViewerCell cell) {
if (overSteerNodeItemExpandedForTest != null) {
return overSteerNodeItemExpandedForTest;
}
ViewerRow viewerRow = cell.getViewerRow();
TreeItem item = (TreeItem) viewerRow.getItem();
return item.getExpanded();
}
示例9: getViewerRowFromItem
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
protected ViewerRow getViewerRowFromItem(Widget item) {
if (cachedRow == null) {
cachedRow = new GalleryViewerRow((GalleryItem) item);
} else {
cachedRow.setItem((GalleryItem) item);
}
return cachedRow;
}
示例10: createNewRowPart
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* Create a new ViewerRow at rowIndex
*
* @param parent
* @param style
* @param rowIndex
* @return ViewerRow
*/
private ViewerRow createNewRowPart(ViewerRow parent, int style, int rowIndex) {
if (parent == null) {
if (rowIndex >= 0) {
return getViewerRowFromItem(new GalleryItem(gallery, style, rowIndex));
}
return getViewerRowFromItem(new GalleryItem(gallery, style));
}
if (rowIndex >= 0) {
return getViewerRowFromItem(new GalleryItem((GalleryItem) parent.getItem(), SWT.NONE, rowIndex));
}
return getViewerRowFromItem(new GalleryItem((GalleryItem) parent.getItem(), SWT.NONE));
}
示例11: getNeighbor
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
public ViewerRow getNeighbor(int direction, boolean sameLevel) {
if (direction == ViewerRow.ABOVE) {
// TODO: handle grouping
return getRowAbove();
} else if (direction == ViewerRow.BELOW) {
// TODO: handle grouping
return getRowBelow();
} else {
throw new IllegalArgumentException("Illegal value of direction argument."); //$NON-NLS-1$
}
}
示例12: getNeighbor
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public ViewerRow getNeighbor(int direction, boolean sameLevel) {
if( direction == ViewerRow.ABOVE ) {
return getRowAbove();
} else if( direction == ViewerRow.BELOW ) {
return getRowBelow();
} else {
throw new IllegalArgumentException("Illegal value of direction argument."); //$NON-NLS-1$
}
}
示例13: getRowAbove
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
private ViewerRow getRowAbove() {
int index = item.getParent().indexOf(item) - 1;
if( index >= 0 ) {
return new TableComboViewerRow(item.getParent().getItem(index));
}
return null;
}
示例14: getRowBelow
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
private ViewerRow getRowBelow() {
int index = item.getParent().indexOf(item) + 1;
if( index < item.getParent().getItemCount() ) {
TableItem tmp = item.getParent().getItem(index);
//TODO NULL can happen in case of VIRTUAL => How do we deal with that
if( tmp != null ) {
return new TableComboViewerRow(tmp);
}
}
return null;
}
示例15: hookListener
import org.eclipse.jface.viewers.ViewerRow; //导入依赖的package包/类
private void hookListener(final ColumnViewer viewer) {
Listener listener = new Listener() {
public void handleEvent(Event event) {
if ((event.detail & SWT.SELECTED) > 0) {
ViewerCell focusCell = getFocusCell();
try {
Method m = viewer.getClass().getDeclaredMethod("getViewerRowFromItem", Widget.class);
boolean access = m.isAccessible();
if (!access) {
m.setAccessible(true);
}
ViewerRow row = (ViewerRow) m.invoke(viewer, event.item);
m.setAccessible(access);
Assert.isNotNull(row,
"Internal structure invalid. Item without associated row is not possible."); //$NON-NLS-1$
ViewerCell cell = row.getCell(event.index);
if (focusCell != null && cell.equals(focusCell)) {
markFocusedCell(event, cell);
}
} catch (Exception e) {
LOGGER.error(e.getLocalizedMessage(), e);
}
}
}
};
viewer.getControl().addListener(SWT.EraseItem, listener);
}
开发者ID:tmfev,项目名称:IDRT-Import-and-Mapping-Tool,代码行数:36,代码来源:FocusCellOwnerDrawHighlighterForMultiselection.java