Source Code Cross Referenced for FormFilteredTree.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » editor » plugin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » Eclipse plug in development » org.eclipse.pde.internal.ui.editor.plugin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2006, 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *     Peter Friese <peter.friese@gentleware.com> - bug 194529     
011:         *******************************************************************************/package org.eclipse.pde.internal.ui.editor.plugin;
012:
013:        import org.eclipse.jface.viewers.TreeViewer;
014:        import org.eclipse.pde.internal.ui.editor.FormEntryAdapter;
015:        import org.eclipse.pde.internal.ui.editor.FormLayoutFactory;
016:        import org.eclipse.pde.internal.ui.editor.IContextPart;
017:        import org.eclipse.pde.internal.ui.parts.FormEntry;
018:        import org.eclipse.swt.SWT;
019:        import org.eclipse.swt.layout.GridData;
020:        import org.eclipse.swt.layout.GridLayout;
021:        import org.eclipse.swt.widgets.Composite;
022:        import org.eclipse.swt.widgets.Text;
023:        import org.eclipse.ui.dialogs.FilteredTree;
024:        import org.eclipse.ui.dialogs.PatternFilter;
025:        import org.eclipse.ui.forms.events.HyperlinkEvent;
026:        import org.eclipse.ui.forms.widgets.FormToolkit;
027:
028:        public class FormFilteredTree extends FilteredTree {
029:
030:            private FormToolkit toolkit;
031:
032:            private FormEntry fEntryFilter;
033:
034:            public FormFilteredTree(Composite parent, int treeStyle,
035:                    PatternFilter filter) {
036:                super (parent, treeStyle, filter);
037:            }
038:
039:            protected void createControl(Composite parent, int treeStyle) {
040:                toolkit = new FormToolkit(parent.getDisplay());
041:                GridLayout layout = FormLayoutFactory.createClearGridLayout(
042:                        false, 1);
043:                // Space between filter text field and tree viewer
044:                layout.verticalSpacing = 3;
045:                setLayout(layout);
046:                setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
047:
048:                if (showFilterControls) {
049:                    filterComposite = new Composite(this , SWT.NONE);
050:                    GridLayout filterLayout = FormLayoutFactory
051:                            .createClearGridLayout(false, 2);
052:                    filterLayout.horizontalSpacing = 5;
053:                    filterComposite.setLayout(filterLayout);
054:                    filterComposite.setFont(parent.getFont());
055:                    createFilterControls(filterComposite);
056:                    filterComposite.setLayoutData(new GridData(SWT.FILL,
057:                            SWT.BEGINNING, true, false));
058:                }
059:
060:                treeComposite = new Composite(this , SWT.NONE);
061:                treeComposite.setLayout(FormLayoutFactory
062:                        .createClearGridLayout(false, 1));
063:                GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
064:                treeComposite.setLayoutData(data);
065:                createTreeControl(treeComposite, treeStyle);
066:            }
067:
068:            /* (non-Javadoc)
069:             * @see org.eclipse.swt.widgets.Widget#dispose()
070:             */
071:            public void dispose() {
072:                if (toolkit != null) {
073:                    toolkit.dispose();
074:                    toolkit = null;
075:                }
076:                super .dispose();
077:            }
078:
079:            protected Text doCreateFilterText(Composite parent) {
080:                int style = SWT.SINGLE | toolkit.getBorderStyle();
081:                fEntryFilter = new FormEntry(parent, toolkit, null, style);
082:                // Needed otherwise borders are missing on Windows Classic Theme
083:                toolkit.paintBordersFor(parent);
084:                setBackground(toolkit.getColors().getBackground());
085:                return fEntryFilter.getText();
086:            }
087:
088:            protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
089:                TreeViewer viewer = super .doCreateTreeViewer(parent, toolkit
090:                        .getBorderStyle()
091:                        | style);
092:                toolkit.paintBordersFor(viewer.getTree().getParent());
093:                return viewer;
094:            }
095:
096:            /**
097:             * @param part
098:             */
099:            public void createUIListenerEntryFilter(IContextPart part) {
100:                // Required to enable Ctrl-V initiated paste operation on first focus
101:                // See Bug # 157973
102:                fEntryFilter.setFormEntryListener(new FormEntryAdapter(part) {
103:                    // Override all callback methods except focusGained
104:                    // See Bug # 184085
105:                    public void browseButtonSelected(FormEntry entry) {
106:                        // NO-OP
107:                    }
108:
109:                    public void linkActivated(HyperlinkEvent e) {
110:                        // NO-OP
111:                    }
112:
113:                    public void linkEntered(HyperlinkEvent e) {
114:                        // NO-OP
115:                    }
116:
117:                    public void linkExited(HyperlinkEvent e) {
118:                        // NO-OP
119:                    }
120:
121:                    public void selectionChanged(FormEntry entry) {
122:                        // NO-OP
123:                    }
124:
125:                    public void textDirty(FormEntry entry) {
126:                        // NO-OP
127:                    }
128:
129:                    public void textValueChanged(FormEntry entry) {
130:                        // NO-OP
131:                    }
132:                });
133:            }
134:
135:            /**
136:             * @return a boolean indicating whether the tree is filtered or not.
137:             */
138:            public boolean isFiltered() {
139:                String filterText = getFilterControl().getText();
140:                boolean filtered = (filterText != null
141:                        && filterText.length() > 0 && !filterText
142:                        .equals(getInitialText()));
143:                return filtered;
144:            }
145:        }
w___w___w._jav___a_2__s___.c__o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.