Search in sources :

Example 1 with TextSearchControl

use of org.eclipse.equinox.internal.p2.ui.discovery.util.TextSearchControl in project epp.mpc by eclipse.

the class MarketplaceViewer method setFindText.

private void setFindText(String tag) {
    try {
        // $NON-NLS-1$
        Field filterTextField = FilteredViewer.class.getDeclaredField("filterText");
        filterTextField.setAccessible(true);
        TextSearchControl textSearchControl = (TextSearchControl) filterTextField.get(this);
        textSearchControl.getTextControl().setText(tag);
    } catch (Exception e) {
        MarketplaceClientUi.log(IStatus.WARNING, Messages.MarketplaceViewer_Could_not_change_find_text, e);
    }
}
Also used : Field(java.lang.reflect.Field) TextSearchControl(org.eclipse.equinox.internal.p2.ui.discovery.util.TextSearchControl) CoreException(org.eclipse.core.runtime.CoreException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CoreException (org.eclipse.core.runtime.CoreException)1 TextSearchControl (org.eclipse.equinox.internal.p2.ui.discovery.util.TextSearchControl)1