Example usage for org.eclipse.jface.viewers ColumnViewer isCellEditorActive

List of usage examples for org.eclipse.jface.viewers ColumnViewer isCellEditorActive

Introduction

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

Prototype

public boolean isCellEditorActive() 

Source Link

Document

Returns whether there is an active cell editor.

Usage

From source file:com.rcpcompany.uibindings.extests.viewerBindings.ControlCellEditorTest.java

License:Open Source License

/**
 * Edit the cell by direct entering the value
 *//*from   w  w  w.j  a  v  a2s  .c om*/
@Test
public void testDirectEdit() {
    final IViewerBinding binding = myTable.getBinding();
    final ColumnViewer viewer = binding.getViewer();
    final Table t = myTable.getTable();

    assertEquals(myCountry1, myContact.getCountry());

    postMouse(t, 0 + binding.getFirstTableColumnOffset(), 0);
    yield();

    assertTrue(viewer.isCellEditorActive());

    postKeyStroke(t, "M2+B");
    postKeyStroke(t, "M2+B");
    yield();

    postKeyStroke(t, "ENTER");
    yield();
    assertFalse(viewer.isCellEditorActive());

    assertEquals(myCountry2, myContact.getCountry());
}

From source file:com.rcpcompany.uibindings.extests.viewerBindings.ControlCellEditorTest.java

License:Open Source License

/**
 * Edit the cell by using content assist
 *///from  w ww.j a  v a 2  s  . co m
@Test
public void testChooseViaContentAssist() {
    final IViewerBinding binding = myTable.getBinding();
    final ColumnViewer viewer = binding.getViewer();
    final Table t = myTable.getTable();

    assertEquals(myCountry1, myContact.getCountry());
    myContact.eAdapters().add(new AdapterImpl() {
        @Override
        public void notifyChanged(Notification msg) {
            super.notifyChanged(msg);
            if (msg.isTouch())
                return;
            LogUtils.debug(this, TSEMFUtils.toString(msg));
        }
    });

    postMouse(t, 0 + binding.getFirstTableColumnOffset(), 0);
    yield();

    assertTrue(viewer.isCellEditorActive());

    postKeyStroke(t, "BACKSPACE");
    yield();
    postKeyStroke(t, "CTRL+Space");
    yield();
    postKeyStroke(t, "B");
    postKeyStroke(t, "B");
    yield();

    postKeyStroke(t, "ENTER");
    yield();
    assertTrue(viewer.isCellEditorActive());

    postKeyStroke(t, "ENTER");
    yield();
    assertFalse(viewer.isCellEditorActive());

    assertEquals(myCountry2, myContact.getCountry());
}