Search in sources :

Example 6 with ViewerColumn

use of org.eclipse.jface.viewers.ViewerColumn in project org.eclipse.rap by eclipse-rap.

the class RowTemplateExample method addMailColumn.

private void addMailColumn(ColumnViewer viewer) {
    ViewerColumn pohoneColumn = createViewerColumn(viewer, "E-Mail", 180);
    pohoneColumn.setLabelProvider(new ColumnLabelProvider() {

        @Override
        public String getText(Object element) {
            Person p = (Person) element;
            return p.getMail();
        }
    });
}
Also used : ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) ViewerColumn(org.eclipse.jface.viewers.ViewerColumn) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn) Person(org.eclipse.rap.examples.pages.internal.Person)

Example 7 with ViewerColumn

use of org.eclipse.jface.viewers.ViewerColumn in project org.eclipse.rap by eclipse-rap.

the class RowTemplateExample method addFirstNameColumn.

private void addFirstNameColumn(final ColumnViewer viewer) {
    ViewerColumn firstNameColumn = createViewerColumn(viewer, "First Name", 200);
    firstNameColumn.setLabelProvider(new ColumnLabelProvider() {

        @Override
        public String getText(Object element) {
            Person p = (Person) element;
            return p.getFirstName();
        }

        @Override
        public Image getImage(Object element) {
            Person p = (Person) element;
            return p.getImage();
        }
    });
}
Also used : ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) ViewerColumn(org.eclipse.jface.viewers.ViewerColumn) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn) TableViewerColumn(org.eclipse.jface.viewers.TableViewerColumn) Image(org.eclipse.swt.graphics.Image) Person(org.eclipse.rap.examples.pages.internal.Person)

Example 8 with ViewerColumn

use of org.eclipse.jface.viewers.ViewerColumn in project org.eclipse.rap by eclipse-rap.

the class TableViewerTest method getViewerColumn.

ViewerColumn getViewerColumn(ColumnViewer viewer, int index) {
    Method method;
    try {
        method = ColumnViewer.class.getDeclaredMethod("getViewerColumn", new Class[] { int.class });
        method.setAccessible(true);
        return (ViewerColumn) method.invoke(viewer, new Object[] { new Integer(index) });
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : ColumnViewer(org.eclipse.jface.viewers.ColumnViewer) Method(java.lang.reflect.Method) ViewerColumn(org.eclipse.jface.viewers.ViewerColumn)

Aggregations

ViewerColumn (org.eclipse.jface.viewers.ViewerColumn)8 TreeViewerColumn (org.eclipse.jface.viewers.TreeViewerColumn)6 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)5 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)4 Person (org.eclipse.rap.examples.pages.internal.Person)4 ColumnViewer (org.eclipse.jface.viewers.ColumnViewer)3 Method (java.lang.reflect.Method)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 Image (org.eclipse.swt.graphics.Image)2 SimulationEngineState (edu.uah.rsesc.aadlsimulator.SimulationEngineState)1 BeforeStepForwardEvent (edu.uah.rsesc.aadlsimulator.ui.events.BeforeStepForwardEvent)1 SimulatorState (edu.uah.rsesc.aadlsimulator.ui.services.SimulatorState)1 InputConstraint (edu.uah.rsesc.aadlsimulator.xtext.inputConstraint.InputConstraint)1 PostConstruct (javax.annotation.PostConstruct)1 DeviceResourceManager (org.eclipse.jface.resource.DeviceResourceManager)1 OwnerDrawLabelProvider (org.eclipse.jface.viewers.OwnerDrawLabelProvider)1 StyledCellLabelProvider (org.eclipse.jface.viewers.StyledCellLabelProvider)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerCell (org.eclipse.jface.viewers.ViewerCell)1