org.eclipse.swt.widgets.TableItem#getParent ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.TableItem#getParent ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: tracecompass   文件: ChartMakerDialog.java
@Override
public void update(@Nullable ViewerCell cell) {
    if (cell == null) {
        return;
    }

    /* Create a button if it doesn't exist */
    ChartSeriesDialog series = (ChartSeriesDialog) cell.getViewerRow().getElement();
    Button button = series.getButton();

    /* Set the position of the button into the cell */
    TableItem item = (TableItem) cell.getItem();
    TableEditor editor = new TableEditor(item.getParent());
    editor.grabHorizontal = true;
    editor.grabVertical = true;
    editor.setEditor(button, item, cell.getColumnIndex());
    editor.layout();
}
 
源代码2 项目: ermaster-b   文件: CompositeFactory.java
public static TableEditor createCheckBoxTableEditor(TableItem tableItem,
		boolean selection, int column) {
	Table table = tableItem.getParent();

	final Button checkBox = new Button(table, SWT.CHECK);
	checkBox.pack();

	TableEditor editor = new TableEditor(table);

	editor.minimumWidth = checkBox.getSize().x;
	editor.horizontalAlignment = SWT.CENTER;
	editor.setEditor(checkBox, tableItem, column);

	checkBox.setSelection(selection);

	return editor;
}
 
源代码3 项目: erflute   文件: CompositeFactory.java
public static TableEditor createCheckBoxTableEditor(TableItem tableItem, boolean selection, int column) {
    final Table table = tableItem.getParent();

    final Button checkBox = new Button(table, SWT.CHECK);
    checkBox.pack();

    final TableEditor editor = new TableEditor(table);
    editor.minimumWidth = checkBox.getSize().x;
    editor.horizontalAlignment = SWT.CENTER;
    editor.setEditor(checkBox, tableItem, column);

    checkBox.setSelection(selection);

    return editor;
}
 
源代码4 项目: uima-uimaj   文件: AbstractSection.java
/**
 * Gets the index.
 *
 * @param item the item
 * @return the index
 */
public static int getIndex(TableItem item) {
  Table parent = item.getParent();
  TableItem[] items = parent.getItems();
  for (int i = items.length - 1; i >= 0; i--) {
    if (items[i] == item)
      return i;
  }
  throw new InternalErrorCDE("invalid state"); //$NON-NLS-1$
}
 
源代码5 项目: uima-uimaj   文件: AbstractSection.java
/**
 * Swap table items.
 *
 * @param itemBelow the item below
 * @param newSelection the new selection
 */
public static void swapTableItems(TableItem itemBelow, int newSelection) {
  Table parent = itemBelow.getParent();
  int i = getIndex(itemBelow);
  TableItem itemAbove = parent.getItems()[i - 1];
  TableItem newItemAbove = new TableItem(parent, SWT.NONE, i - 1);
  copyTableItem(newItemAbove, itemBelow);
  TableItem newItemBelow = new TableItem(parent, SWT.NONE, i);
  copyTableItem(newItemBelow, itemAbove);
  itemAbove.dispose();
  itemBelow.dispose();
  parent.setSelection(newSelection);
}
 
源代码6 项目: ermasterr   文件: CompositeFactory.java
public static TableEditor createCheckBoxTableEditor(final TableItem tableItem, final boolean selection, final int column) {
    final Table table = tableItem.getParent();

    final Button checkBox = new Button(table, SWT.CHECK);
    checkBox.pack();

    final TableEditor editor = new TableEditor(table);

    editor.minimumWidth = checkBox.getSize().x;
    editor.horizontalAlignment = SWT.CENTER;
    editor.setEditor(checkBox, tableItem, column);

    checkBox.setSelection(selection);

    return editor;
}