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

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

Introduction

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

Prototype

public Object[] getColumnProperties() 

Source Link

Document

Returns the column properties of this table viewer.

Usage

From source file:org.eclipse.e4.xwt.jface.JFacesHelper.java

License:Open Source License

public static String[] getViewerProperties(Viewer viewer) {
    if (viewer instanceof ColumnViewer) {
        ColumnViewer columnViewer = (ColumnViewer) viewer;
        Object[] properties = columnViewer.getColumnProperties();
        String[] propertyNames = Core.EMPTY_STRING_ARRAY;
        if (properties != null) {
            int size = 0;
            for (int i = 0; i < properties.length; i++) {
                if (properties[i] != null) {
                    size++;//from w  ww.j a va  2 s. c  om
                }
            }

            propertyNames = new String[size];
            for (int i = 0, j = 0; i < properties.length; i++) {
                if (properties[i] != null) {
                    propertyNames[j++] = properties[i].toString();
                }
            }
        }
        if (propertyNames.length != 0) {
            return propertyNames;
        }
    }
    String path = (String) UserData.getLocalData(viewer, IUserDataConstants.XWT_PROPERTY_DATA_KEY);
    if (path != null) {
        return new String[] { path };
    }
    return Core.EMPTY_STRING_ARRAY;
}