Example usage for org.eclipse.jface.viewers IBaseLabelProvider isLabelProperty

List of usage examples for org.eclipse.jface.viewers IBaseLabelProvider isLabelProperty

Introduction

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

Prototype

public boolean isLabelProperty(Object element, String property);

Source Link

Document

Returns whether the label would be affected by a change to the given property of the given element.

Usage

From source file:org.eclipse.e4.tm.builder.jface.LabeledTableLabelProvider.java

License:Open Source License

public boolean isLabelProperty(Object element, String property) {
    for (IBaseLabelProvider labelProvider : labelProviders) {
        if (labelProvider.isLabelProperty(element, property)) {
            return true;
        }//from ww w.j  a  va  2 s .c  o  m
    }
    return false;
}

From source file:org.eclipse.ui.internal.decorators.DecoratorDefinition.java

License:Open Source License

/**
 * Return whether or not the decorator registered for element
 * has a label property called property name. If there is an 
 * exception disable the receiver and return false.
 * This method should not be called unless a check for
 * isEnabled() has been done first.//  w  w  w .ja  v  a 2s  .  c  o  m
 */
boolean isLabelProperty(Object element, String property) {
    try { //Internal decorator might be null so be prepared
        IBaseLabelProvider currentDecorator = internalGetLabelProvider();
        if (currentDecorator != null) {
            return currentDecorator.isLabelProperty(element, property);
        }
    } catch (CoreException exception) {
        handleCoreException(exception);
        return false;
    }
    return false;
}

From source file:org.neuro4j.studio.debug.ui.views.StructuredViewer.java

License:Apache License

/**
 * Updates the given element's presentation when one or more of its
 * properties changes. Only the given element is updated.
 * <p>/*from ww  w  .ja v a 2 s.  com*/
 * EXPERIMENTAL. Not to be used except by JDT. This method was added to support JDT's explorations into grouping by
 * working sets, which requires viewers to support multiple equal elements. See bug 76482 for more details. This
 * support will likely be removed in Eclipse 3.3 in favor of proper support for multiple equal elements (which was
 * implemented for AbtractTreeViewer in 3.2).
 * </p>
 * 
 * @param widget
 *        the widget for the element
 * @param element
 *        the element
 * @param properties
 *        the properties that have changed, or <code>null</code> to
 *        indicate unknown
 */
protected void internalUpdate(Widget widget, Object element, String[] properties) {
    boolean needsRefilter = false;
    if (properties != null) {
        for (int i = 0; i < properties.length; ++i) {
            needsRefilter = needsRefilter(element, properties[i]);
            if (needsRefilter) {
                break;
            }
        }
    }
    if (needsRefilter) {
        preservingSelection(new Runnable() {
            public void run() {
                internalRefresh(getRoot());
                refreshOccurred = true;
            }
        });
        return;
    }

    boolean needsUpdate;
    if (properties == null) {
        needsUpdate = true;
    } else {
        needsUpdate = false;
        IBaseLabelProvider labelProvider = getLabelProvider();
        for (int i = 0; i < properties.length; ++i) {
            needsUpdate = labelProvider.isLabelProperty(element, properties[i]);
            if (needsUpdate) {
                break;
            }
        }
    }
    if (needsUpdate) {
        updateItem(widget, element);
    }
}