Source Code Cross Referenced for JavaFastOpenPanel.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » ext » java » 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 » Swing Library » abeille forms designer » org.netbeans.editor.ext.java 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *                 Sun Public License Notice
003:         * 
004:         * The contents of this file are subject to the Sun Public License
005:         * Version 1.0 (the "License"). You may not use this file except in
006:         * compliance with the License. A copy of the License is available at
007:         * http://www.sun.com/
008:         * 
009:         * The Original Code is NetBeans. The Initial Developer of the Original
010:         * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
011:         * Microsystems, Inc. All Rights Reserved.
012:         */
013:
014:        package org.netbeans.editor.ext.java;
015:
016:        import java.awt.Dimension;
017:        import java.awt.event.KeyEvent;
018:        import java.awt.event.KeyListener;
019:
020:        import org.netbeans.editor.LocaleSupport;
021:
022:        /**
023:         * The panel for opening java classes.
024:         * 
025:         * @author Miloslav Metelka
026:         * @version 1.0
027:         */
028:        class JavaFastOpenPanel extends javax.swing.JPanel {
029:
030:            private JavaFastOpen jfo;
031:
032:            /** Creates new form SaveMacroPanel */
033:            public JavaFastOpenPanel(JavaFastOpen jfo) {
034:                this .jfo = jfo;
035:
036:                initComponents();
037:
038:                getAccessibleContext().setAccessibleDescription(
039:                        LocaleSupport.getString("ACSD_JFO")); // NOI18N
040:                expField.getAccessibleContext().setAccessibleDescription(
041:                        LocaleSupport.getString("ACSD_JFOP_expLabel")); // NOI18N
042:                javax.swing.JList jl = jfo.getResultList();
043:                listScrollPane.setViewportView(jl);
044:                foundLabel.setLabelFor(jl);
045:                jl.getAccessibleContext().setAccessibleDescription(
046:                        LocaleSupport.getString("ACSD_JFOP_foundLabel")); // NOI18N
047:
048:                setPreferredSize(new Dimension(340, 178));
049:                setMaximumSize(new Dimension(400, 200));
050:
051:                expLabel.setDisplayedMnemonic(LocaleSupport.getString(
052:                        "JFOP_expLabelMnemonic", "C").charAt(0)); // NOI18N
053:                expLabel.setLabelFor(expField);
054:                expField.addKeyListener(new KeyListener() {
055:                    public void keyPressed(KeyEvent evt) {
056:                        if (!checkArrows(evt))
057:                            change();
058:                    }
059:
060:                    public void keyReleased(KeyEvent evt) {
061:                        if (!isArrows(evt))
062:                            change();
063:                    }
064:
065:                    public void keyTyped(KeyEvent evt) {
066:                        if (!isArrows(evt))
067:                            change();
068:                    }
069:
070:                    private boolean isArrows(KeyEvent evt) {
071:                        int key = evt.getKeyCode();
072:                        return key == KeyEvent.VK_DOWN || key == KeyEvent.VK_UP;
073:                    }
074:
075:                    private boolean checkArrows(KeyEvent evt) {
076:                        int key = evt.getKeyCode();
077:                        switch (key) {
078:                        case KeyEvent.VK_DOWN:
079:                            JavaFastOpenPanel.this .jfo.scrollDown();
080:                            return true;
081:                        case KeyEvent.VK_UP:
082:                            JavaFastOpenPanel.this .jfo.scrollUp();
083:                            return true;
084:                        default:
085:                        }
086:                        return false;
087:                    }
088:
089:                    private void change() {
090:                        JavaFastOpenPanel.this .jfo.postUpdate();
091:                    }
092:                });
093:                foundLabel.setDisplayedMnemonic(LocaleSupport.getString(
094:                        "JFOP_foundLabelMnemonic", "F").charAt(0)); // NOI18N
095:                foundLabel.setLabelFor(jfo.getResultList());
096:            }
097:
098:            public Dimension getPreferredSize() {
099:                Dimension pref = super .getPreferredSize();
100:                Dimension max = getMaximumSize();
101:                if (pref.width > max.width)
102:                    pref.width = max.width;
103:                if (pref.height > max.height)
104:                    pref.height = max.height;
105:                return pref;
106:            }
107:
108:            void popupNotify() {
109:                expField.requestFocus();
110:            }
111:
112:            String getSearchText() {
113:                return expField.getText();
114:            }
115:
116:            void setSearchText(String text) {
117:                expField.setText(text);
118:                expField.setCaretPosition(expField.getText().length());
119:            }
120:
121:            private void initComponents() {// GEN-BEGIN:initComponents
122:                java.awt.GridBagConstraints gridBagConstraints;
123:
124:                queryPanel = new javax.swing.JPanel();
125:                expLabel = new javax.swing.JLabel();
126:                expField = new javax.swing.JTextField();
127:                listPanel = new javax.swing.JPanel();
128:                foundLabel = new javax.swing.JLabel();
129:                listScrollPane = new javax.swing.JScrollPane();
130:
131:                setLayout(new java.awt.BorderLayout());
132:
133:                setBorder(new javax.swing.border.EmptyBorder(
134:                        new java.awt.Insets(12, 12, 0, 11)));
135:                queryPanel.setLayout(new java.awt.GridBagLayout());
136:
137:                expLabel.setText(LocaleSupport.getString("JFOP_expLabel",
138:                        "Class Name:"));
139:                expLabel.setLabelFor(expField);
140:                gridBagConstraints = new java.awt.GridBagConstraints();
141:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
142:                gridBagConstraints.insets = new java.awt.Insets(2, 0, 0, 0);
143:                queryPanel.add(expLabel, gridBagConstraints);
144:
145:                expField.setPreferredSize(new java.awt.Dimension(100, 21));
146:                gridBagConstraints = new java.awt.GridBagConstraints();
147:                gridBagConstraints.gridx = 1;
148:                gridBagConstraints.gridy = 0;
149:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
150:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
151:                gridBagConstraints.weightx = 1.0;
152:                gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
153:                queryPanel.add(expField, gridBagConstraints);
154:
155:                add(queryPanel, java.awt.BorderLayout.NORTH);
156:
157:                listPanel.setLayout(new java.awt.GridBagLayout());
158:
159:                listPanel.setBorder(new javax.swing.border.EmptyBorder(
160:                        new java.awt.Insets(12, 0, 0, 0)));
161:                foundLabel.setText(LocaleSupport.getString("JFOP_foundLabel",
162:                        "Matching Classes:"));
163:                gridBagConstraints = new java.awt.GridBagConstraints();
164:                gridBagConstraints.gridx = 0;
165:                gridBagConstraints.gridy = 0;
166:                gridBagConstraints.ipadx = 1;
167:                gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
168:                gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
169:                listPanel.add(foundLabel, gridBagConstraints);
170:
171:                listScrollPane
172:                        .setPreferredSize(new java.awt.Dimension(200, 100));
173:                gridBagConstraints = new java.awt.GridBagConstraints();
174:                gridBagConstraints.gridx = 0;
175:                gridBagConstraints.gridy = 1;
176:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
177:                gridBagConstraints.weightx = 1.0;
178:                gridBagConstraints.weighty = 1.0;
179:                listPanel.add(listScrollPane, gridBagConstraints);
180:
181:                add(listPanel, java.awt.BorderLayout.CENTER);
182:
183:            }// GEN-END:initComponents
184:
185:            // Variables declaration - do not modify//GEN-BEGIN:variables
186:            private javax.swing.JPanel listPanel;
187:            private javax.swing.JLabel expLabel;
188:            private javax.swing.JLabel foundLabel;
189:            private javax.swing.JTextField expField;
190:            private javax.swing.JScrollPane listScrollPane;
191:            private javax.swing.JPanel queryPanel;
192:            // End of variables declaration//GEN-END:variables
193:
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.