Example usage for org.eclipse.jface.viewers ColumnViewerEditorActivationEvent ColumnViewerEditorActivationEvent

List of usage examples for org.eclipse.jface.viewers ColumnViewerEditorActivationEvent ColumnViewerEditorActivationEvent

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ColumnViewerEditorActivationEvent ColumnViewerEditorActivationEvent.

Prototype

public ColumnViewerEditorActivationEvent(ViewerCell cell) 

Source Link

Document

This constructor can be used when no event exists.

Usage

From source file:org.eclipse.nebula.jface.galleryviewer.GalleryTreeViewer.java

License:Open Source License

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);
                }/*from  w ww .  ja  va  2 s  .co m*/
            }
        }
    } else {
        super.editElement(element, column);
    }
}

From source file:org.eclipse.nebula.jface.gridviewer.GridTableViewer.java

License:Open Source License

/**
 * {@inheritDoc}/*from   ww w  .  ja va 2s.c o  m*/
 */
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);
    }
    // }
}

From source file:org.jboss.tools.common.model.ui.editors.dnd.composite.TagAttributesTableViewer.java

License:Open Source License

private void handleKeyReleasedEvent(KeyEvent keyEvent) {
    if (keyEvent.character == '\r' && keyEvent.doit == true) {
        TableItem[] selectedItems = getTable().getSelection();
        if (selectedItems == null || selectedItems.length != 1) {
            return;
        }/* w w  w. ja v a 2 s . c  o  m*/
        TableItem item = selectedItems[0];
        ViewerRow row = getViewerRowFromItem(item);
        ViewerCell cell = row.getCell(1);
        if (cell != null) {
            triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(cell));
        }
    }
}

From source file:org.mingy.jsfs.ui.viewer.CTreeComboViewer.java

License:Open Source License

public void editElement(Object element, int column) {
    if (element instanceof TreePath) {
        try {//w  ww.  j  a  va 2  s.c o  m
            getControl().setRedraw(false);
            setSelection(new TreeSelection((TreePath) element));
            CTreeComboItem[] items = tree.getSelection();

            if (items.length == 1) {
                ViewerRow row = getViewerRowFromItem(items[0]);

                if (row != null) {
                    ViewerCell cell = row.getCell(column);
                    if (cell != null) {
                        triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(cell));
                    }
                }
            }
        } finally {
            getControl().setRedraw(true);
        }
    } else {
        super.editElement(element, column);
    }
}