| /********************************************************************* |
| * Copyright (c) 2008 The University of York. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| **********************************************************************/ |
| package org.eclipse.epsilon.picto; |
| |
| import org.eclipse.swt.widgets.Composite; |
| import org.eclipse.ui.dialogs.FilteredTree; |
| import org.eclipse.ui.dialogs.PatternFilter; |
| |
| public class FilteredViewTree extends FilteredTree { |
| |
| /** |
| * Create a new instance of the receiver. |
| * |
| * @param parent |
| * the parent <code>Composite</code> |
| * @param treeStyle |
| * the style bits for the <code>Tree</code> |
| * @param filter |
| * the filter to be used |
| * @param useNewLook |
| * <code>true</code> if the new 3.5 look should be used |
| */ |
| public FilteredViewTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) { |
| super(parent, treeStyle, filter, useNewLook, true); |
| } |
| |
| public void clearFilterText() { |
| if (filterText != null && !filterText.getText().isEmpty()) { |
| clearText(); |
| } |
| } |
| |
| /** |
| * Return the time delay that should be used when scheduling the |
| * filter refresh job. Subclasses may override. |
| * |
| * @return a time delay in milliseconds before the job should run |
| */ |
| @Override |
| protected long getRefreshJobDelay() { |
| return 100; |
| } |
| } |