KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > runtime > registry > RegistryFilteredTree


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.runtime.registry;
12
13 import org.eclipse.swt.SWT;
14 import org.eclipse.swt.layout.GridData;
15 import org.eclipse.swt.layout.GridLayout;
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.ui.dialogs.FilteredTree;
18 import org.eclipse.ui.dialogs.PatternFilter;
19
20 public class RegistryFilteredTree extends FilteredTree {
21     
22     public RegistryFilteredTree(Composite parent, int treeStyle,
23             PatternFilter filter) {
24         super(parent, treeStyle, filter);
25     }
26     
27     protected void createControl(Composite parent, int treeStyle) {
28         GridLayout layout = new GridLayout();
29         layout.marginHeight = 0;
30         layout.marginWidth = 0;
31         setLayout(layout);
32         setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
33
34         if (showFilterControls){
35             filterComposite = new Composite(this, SWT.NONE);
36             GridLayout filterLayout = new GridLayout(2, false);
37             filterLayout.marginHeight = 4;
38             filterLayout.marginWidth = 3;
39             filterComposite.setLayout(filterLayout);
40             filterComposite.setFont(parent.getFont());
41             
42             createFilterControls(filterComposite);
43             filterComposite.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING,
44                     true, false));
45         }
46         
47         treeComposite = new Composite(this, SWT.NONE);
48         GridLayout treeCompositeLayout = new GridLayout();
49         treeCompositeLayout.marginHeight = 0;
50         treeCompositeLayout.marginWidth = 0;
51         treeComposite.setLayout(treeCompositeLayout);
52         GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
53         treeComposite.setLayoutData(data);
54         createTreeControl(treeComposite, SWT.NONE);
55     }
56     
57 }
58
Popular Tags