Source Code Cross Referenced for AnnotationParamsCompletion.java in  » IDE » tIDE » tide » editor » completions » 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 » tIDE » tide.editor.completions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package tide.editor.completions;
002:
003:        import tide.project.JDocRes;
004:        import tide.editor.Accelerators;
005:        import javax.swing.text.html.*;
006:        import tide.editor.MainEditorFrame;
007:        import javax.swing.*;
008:        import javax.swing.event.*;
009:        import java.awt.BorderLayout;
010:        import java.awt.event.*;
011:
012:        /** TODO.
013:         */
014:        public final class AnnotationParamsCompletion extends JDialog implements 
015:                CompletionDialog {
016:            // CompletionDialog interface
017:            public void cancelDialog() {
018:            }
019:
020:            // CompletionDialog interface
021:            public void selectAndQuit() {
022:            }
023:
024:            final CompletionManager completionManager;
025:            final int docOffset;
026:            private final JSplitPane sp;
027:            private final JEditorPane memberExplorerPane = new JEditorPane();
028:            private boolean wasCancelled = true;
029:            private final JEditorPane javaDocPane = new JEditorPane();
030:            final private HyperlinkListener hyperlinkListener;
031:
032:            public AnnotationParamsCompletion(Class clazz, String title,
033:                    JFrame owner, int x, int y,
034:                    final CompletionManager completionManager,
035:                    final int docOffset) {
036:                super (owner, title, false);
037:                this .setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
038:
039:                this .completionManager = completionManager;
040:                this .docOffset = docOffset;
041:
042:                setLayout(new BorderLayout(0, 0));
043:
044:                JPanel centerPanel = new JPanel();
045:
046:                JTabbedPane explPane = new JTabbedPane();
047:                explPane.addTab("JavaDoc", new JScrollPane(javaDocPane));
048:                explPane.addTab("Member explorer", new JScrollPane(
049:                        memberExplorerPane));
050:                explPane.setSelectedIndex(0);
051:                sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, centerPanel,
052:                        explPane);
053:
054:                javaDocPane.setEditable(false);
055:                memberExplorerPane.setEditable(false);
056:
057:                add(sp, BorderLayout.CENTER);
058:
059:                final int fontSize = UIManager.getFont("Label.font").getSize();
060:                MainEditorFrame.instance.globalProperties
061:                        .setComponentSizeFromINIFile(this ,
062:                                "AnnotationParamsCompletion", fontSize * 50,
063:                                fontSize * 45, x, y);
064:                this .setLocation(x, y);
065:                sp.setDividerLocation(MainEditorFrame.instance.globalProperties
066:                        .getInteger("AnnotationParamsCompletion_divloc",
067:                                fontSize * 5));
068:                sp.setOneTouchExpandable(true);
069:
070:                ((JComponent) getContentPane()).registerKeyboardAction(
071:                        new ActionListener() {
072:                            public void actionPerformed(ActionEvent ae) {
073:                                wasCancelled = true;
074:                                setVisible(false);
075:                                return;
076:                            }
077:                        }, "Escape", Accelerators.escape,
078:                        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
079:
080:                ((JComponent) getContentPane()).registerKeyboardAction(
081:                        new ActionListener() {
082:                            public void actionPerformed(ActionEvent ae) {
083:                                wasCancelled = false;
084:                                setVisible(false);
085:                                return;
086:                            }
087:                        }, "Enter", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
088:                                0, true), // false => not working, let the table "jump"
089:                        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
090:
091:                this .addWindowListener(new WindowAdapter() {
092:                    @Override
093:                    public void windowClosed(WindowEvent e) {
094:                        // not called on cancel
095:                        saveSettingsOnClose();
096:                    }
097:
098:                    @Override
099:                    public void windowClosing(WindowEvent e) {
100:                        // not called on cancel
101:                        saveSettingsOnClose();
102:                    }
103:                    /*@Override
104:                    public void windowDeactivated(WindowEvent e)
105:                    {
106:                       saveSettingsOnClose();
107:                    } */
108:                });
109:
110:                javaDocPane
111:                        .addHyperlinkListener(hyperlinkListener = new HyperlinkListener() {
112:                            public void hyperlinkUpdate(HyperlinkEvent e) {
113:                                if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
114:                                    JEditorPane pane = (JEditorPane) e
115:                                            .getSource();
116:                                    if (e instanceof  HTMLFrameHyperlinkEvent) {
117:                                        HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
118:                                        HTMLDocument doc = (HTMLDocument) pane
119:                                                .getDocument();
120:                                        doc.processHTMLFrameHyperlinkEvent(evt);
121:                                    } else {
122:                                        try {
123:                                            //TODO: resolve relative names !
124:                                            System.out.println("URL: "
125:                                                    + e.getURL());
126:                                            pane.setPage(e.getURL());
127:                                        } catch (Throwable t) {
128:                                            t.printStackTrace();
129:                                        }
130:                                    }
131:                                }
132:                            }
133:                        });
134:
135:                javaDocPane.setContentType("text/html");
136:                JDocRes jdr = MainEditorFrame.instance.getActualProject()
137:                        .getJavaDocManager().getClassSummary(clazz.getName());
138:                javaDocPane.setText(jdr.part);
139:                javaDocPane.setCaretPosition(0);
140:
141:                memberExplorerPane.setContentType("text/html");
142:                memberExplorerPane.setText("<html><body>" + clazz
143:                        + "</body></html>");
144:
145:                this .setVisible(true); // NOT MODAL !!
146:
147:            }
148:
149:            private void saveSettingsOnClose() {
150:                MainEditorFrame.instance.globalProperties
151:                        .saveComponentSizeInINIFile(this ,
152:                                "AnnotationParamsCompletion");
153:                MainEditorFrame.instance.globalProperties.setInteger(
154:                        "AnnotationParamsCompletion_divloc", sp
155:                                .getDividerLocation());
156:                //MainEditorFrame.debugOut("removing caret listener for completion dialog "+this.getTitle());
157:                //this.completionManager.editor.getTextPane().removeCaretListener(caretListener);
158:                this .completionManager.openedDialogs.remove(this );
159:                javaDocPane.removeHyperlinkListener(hyperlinkListener);
160:                //actualDisplayedItem = null;
161:                //new Throwable("close").printStackTrace();
162:            }
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.