Source Code Cross Referenced for AbstractSootAttributesHover.java in  » Code-Analyzer » soot » ca » mcgill » sable » soot » attributes » 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 » Code Analyzer » soot » ca.mcgill.sable.soot.attributes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Soot - a J*va Optimization Framework
002:         * Copyright (C) 2003 Jennifer Lhotak
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2.1 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the
016:         * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
017:         * Boston, MA 02111-1307, USA.
018:         */
019:
020:        package ca.mcgill.sable.soot.attributes;
021:
022:        import java.util.ArrayList;
023:
024:        import org.eclipse.jface.text.*;
025:        import org.eclipse.jface.text.source.SourceViewer;
026:        import org.eclipse.ui.*;
027:        import org.eclipse.ui.texteditor.AbstractTextEditor;
028:        import org.eclipse.core.resources.*;
029:        import org.eclipse.core.runtime.CoreException;
030:        import ca.mcgill.sable.soot.SootPlugin;
031:
032:        public abstract class AbstractSootAttributesHover implements  ITextHover {
033:
034:            private IEditorPart editor;
035:            private int lineNum;
036:            private String fileName;
037:            private String packFileName;
038:            private ArrayList packFileNames;
039:            private boolean editorHasChanged;
040:            private String selectedProj;
041:            private SootAttributesHandler attrsHandler;
042:            private IResource rec;
043:            private ITextViewer viewer;
044:            private IDocument document;
045:            public static final String sep = System
046:                    .getProperty("file.separator");
047:
048:            /**
049:             * Method setEditor.
050:             * @param ed
051:             */
052:            public void setEditor(IEditorPart ed) {
053:                editor = ed;
054:            }
055:
056:            /**
057:             * Method getAttributes.
058:             * @return String
059:             * sub classes must implement this method
060:             * if more then one attribute return 
061:             * each attribute separated by newlines
062:             */
063:            protected abstract String getAttributes(AbstractTextEditor editor);
064:
065:            /**
066:             * @see org.eclipse.jface.text.ITextHover#getHoverInfo(ITextViewer, IRegion)
067:             */
068:            public String getHoverInfo(ITextViewer textViewer,
069:                    org.eclipse.jface.text.IRegion hoverRegion) {
070:
071:                // this prevents showing incorrect tags - at least temporaily
072:                // and hopefully if the editor has ever changed
073:
074:                getHoverRegion(textViewer, hoverRegion.getOffset());
075:                String attr = null;
076:                attr = getAttributes((AbstractTextEditor) getEditor());
077:
078:                return attr;
079:
080:            }
081:
082:            /**
083:             * @see org.eclipse.jface.text.ITextHover#getHoverRegion(ITextViewer, int)
084:             */
085:            public org.eclipse.jface.text.IRegion getHoverRegion(
086:                    ITextViewer textViewer, int offset) {
087:                try {
088:                    setLineNum(textViewer.getDocument().getLineOfOffset(offset) + 1);
089:                    setDocument(textViewer.getDocument());
090:                    return textViewer.getDocument().getLineInformationOfOffset(
091:                            offset);
092:                } catch (BadLocationException e) {
093:                    return null;
094:                }
095:
096:            }
097:
098:            /**
099:             * Returns the lineNum.
100:             * @return int
101:             */
102:            public int getLineNum() {
103:                return lineNum;
104:            }
105:
106:            /**
107:             * Sets the lineNum.
108:             * @param lineNum The lineNum to set
109:             */
110:            public void setLineNum(int lineNum) {
111:                this .lineNum = lineNum;
112:            }
113:
114:            /**
115:             * Returns the fileName.
116:             * @return String
117:             */
118:            public String getFileName() {
119:                return fileName;
120:            }
121:
122:            /**
123:             * Sets the fileName.
124:             * @param fileName The fileName to set
125:             */
126:            public void setFileName(String fileName) {
127:                this .fileName = fileName;
128:            }
129:
130:            /**
131:             * Returns the packFileName.
132:             * @return String
133:             */
134:            public String getPackFileName() {
135:                return packFileName;
136:            }
137:
138:            /**
139:             * Sets the packFileName.
140:             * @param packFileName The packFileName to set
141:             */
142:            public void setPackFileName(String packFileName) {
143:                this .packFileName = packFileName;
144:            }
145:
146:            /**
147:             * Returns the editorHasChanged.
148:             * @return boolean
149:             */
150:            public boolean isEditorHasChanged() {
151:                return editorHasChanged;
152:            }
153:
154:            /**
155:             * Sets the editorHasChanged.
156:             * @param editorHasChanged The editorHasChanged to set
157:             */
158:            public void setEditorHasChanged(boolean editorHasChanged) {
159:                this .editorHasChanged = editorHasChanged;
160:            }
161:
162:            /**
163:             * Returns the selectedProj.
164:             * @return String
165:             */
166:            public String getSelectedProj() {
167:                return selectedProj;
168:            }
169:
170:            /**
171:             * Sets the selectedProj.
172:             * @param selectedProj The selectedProj to set
173:             */
174:            public void setSelectedProj(String selectedProj) {
175:                this .selectedProj = selectedProj;
176:            }
177:
178:            /**
179:             * Returns the attrsHandler.
180:             * @return SootAttributesHandler
181:             */
182:            public SootAttributesHandler getAttrsHandler() {
183:                return attrsHandler;
184:            }
185:
186:            /**
187:             * Sets the attrsHandler.
188:             * @param attrsHandler The attrsHandler to set
189:             */
190:            public void setAttrsHandler(SootAttributesHandler attrsHandler) {
191:                this .attrsHandler = attrsHandler;
192:            }
193:
194:            /**
195:             * Returns the editor.
196:             * @return IEditorPart
197:             */
198:            public IEditorPart getEditor() {
199:                return editor;
200:            }
201:
202:            /**
203:             * Returns the rec.
204:             * @return IResource
205:             */
206:            public IResource getRec() {
207:                return rec;
208:            }
209:
210:            /**
211:             * Sets the rec.
212:             * @param rec The rec to set
213:             */
214:            public void setRec(IResource rec) {
215:                this .rec = rec;
216:            }
217:
218:            /**
219:             * @return
220:             */
221:            public IDocument getDocument() {
222:                return document;
223:            }
224:
225:            /**
226:             * @return
227:             */
228:            public ITextViewer getViewer() {
229:                return viewer;
230:            }
231:
232:            /**
233:             * @param document
234:             */
235:            public void setDocument(IDocument document) {
236:                this .document = document;
237:            }
238:
239:            /**
240:             * @param viewer
241:             */
242:            public void setViewer(ITextViewer viewer) {
243:                this .viewer = viewer;
244:            }
245:
246:            /**
247:             * @return
248:             */
249:            public ArrayList getPackFileNames() {
250:                return packFileNames;
251:            }
252:
253:            /**
254:             * @param list
255:             */
256:            public void setPackFileNames(ArrayList list) {
257:                packFileNames = list;
258:            }
259:
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.