Source Code Cross Referenced for MapEditorSite.java in  » GIS » udig-1.1 » net » refractions » udig » project » ui » internal » 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 » GIS » udig 1.1 » net.refractions.udig.project.ui.internal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* uDig - User Friendly Desktop Internet GIS client
002:         * http://udig.refractions.net
003:         * (C) 2004, Refractions Research Inc.
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation;
008:         * version 2.1 of the License.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         */
015:        package net.refractions.udig.project.ui.internal;
016:
017:        import org.eclipse.jface.action.IAction;
018:        import org.eclipse.jface.action.ICoolBarManager;
019:        import org.eclipse.jface.action.IMenuManager;
020:        import org.eclipse.jface.action.IStatusLineManager;
021:        import org.eclipse.jface.action.IToolBarManager;
022:        import org.eclipse.jface.action.MenuManager;
023:        import org.eclipse.jface.viewers.ISelectionProvider;
024:        import org.eclipse.swt.widgets.Shell;
025:        import org.eclipse.ui.IActionBars;
026:        import org.eclipse.ui.IActionBars2;
027:        import org.eclipse.ui.IEditorActionBarContributor;
028:        import org.eclipse.ui.IEditorSite;
029:        import org.eclipse.ui.IKeyBindingService;
030:        import org.eclipse.ui.IViewSite;
031:        import org.eclipse.ui.IWorkbenchPage;
032:        import org.eclipse.ui.IWorkbenchPart;
033:        import org.eclipse.ui.IWorkbenchPartSite;
034:        import org.eclipse.ui.IWorkbenchWindow;
035:        import org.eclipse.ui.services.IServiceLocator;
036:
037:        /**
038:         * Primarily used so the action bars returned by this is 
039:         * a MapEditorActionBars
040:         * 
041:         * @author Jesse
042:         * @since 1.1.0
043:         */
044:        public class MapEditorSite implements  IEditorSite, IViewSite {
045:
046:            IWorkbenchPartSite delegate;
047:            private MapEditor editor;
048:
049:            public MapEditorSite(IWorkbenchPartSite original, MapEditor editor) {
050:                delegate = original;
051:                this .editor = editor;
052:            }
053:
054:            public IEditorActionBarContributor getActionBarContributor() {
055:                if (delegate instanceof  IEditorSite) {
056:                    return ((IEditorSite) delegate).getActionBarContributor();
057:                }
058:                throw new IllegalStateException(
059:                        "delegate is not a IEditorSite!!!"); //$NON-NLS-1$
060:            }
061:
062:            public IActionBars getActionBars() {
063:                if (delegate instanceof  IEditorSite) {
064:                    return new MapEditorActionBars(
065:                            (IActionBars2) ((IEditorSite) delegate)
066:                                    .getActionBars(), editor);
067:                }
068:                if (delegate instanceof  IViewSite) {
069:                    return new MapEditorActionBars(
070:                            (IActionBars2) ((IViewSite) delegate)
071:                                    .getActionBars(), editor);
072:                }
073:                throw new IllegalStateException(
074:                        "delegate is not a IEditorSite!!!!"); //$NON-NLS-1$
075:            }
076:
077:            public void registerContextMenu(MenuManager menuManager,
078:                    ISelectionProvider selectionProvider,
079:                    boolean includeEditorInput) {
080:                if (delegate instanceof  IEditorSite) {
081:                    ((IEditorSite) delegate).registerContextMenu(menuManager,
082:                            selectionProvider, includeEditorInput);
083:                    return;
084:                }
085:                throw new IllegalStateException(
086:                        "delegate is not a IEditorSite!!!!"); //$NON-NLS-1$
087:            }
088:
089:            public void registerContextMenu(String menuId,
090:                    MenuManager menuManager,
091:                    ISelectionProvider selectionProvider,
092:                    boolean includeEditorInput) {
093:                if (delegate instanceof  IEditorSite) {
094:                    ((IEditorSite) delegate).registerContextMenu(menuId,
095:                            menuManager, selectionProvider, includeEditorInput);
096:                    return;
097:                }
098:                throw new IllegalStateException(
099:                        "delegate is not a IEditorSite!!!!"); //$NON-NLS-1$
100:            }
101:
102:            public Object getAdapter(Class adapter) {
103:                return delegate.getAdapter(adapter);
104:            }
105:
106:            public String getId() {
107:                return delegate.getId();
108:            }
109:
110:            public IKeyBindingService getKeyBindingService() {
111:                return delegate.getKeyBindingService();
112:            }
113:
114:            public IWorkbenchPage getPage() {
115:                return delegate.getPage();
116:            }
117:
118:            public IWorkbenchPart getPart() {
119:                return delegate.getPart();
120:            }
121:
122:            public String getPluginId() {
123:                return delegate.getPluginId();
124:            }
125:
126:            public String getRegisteredName() {
127:                return delegate.getRegisteredName();
128:            }
129:
130:            public ISelectionProvider getSelectionProvider() {
131:                return delegate.getSelectionProvider();
132:            }
133:
134:            //    public Object getService( Class api ) {
135:            //        return delegate.getService(api);
136:            //    }
137:
138:            public Shell getShell() {
139:                return delegate.getShell();
140:            }
141:
142:            public IWorkbenchWindow getWorkbenchWindow() {
143:                return delegate.getWorkbenchWindow();
144:            }
145:
146:            //    public boolean hasService( Class api ) {
147:            //        return delegate.hasService(api);
148:            //    }
149:
150:            public void registerContextMenu(MenuManager menuManager,
151:                    ISelectionProvider selectionProvider) {
152:                delegate.registerContextMenu(menuManager, selectionProvider);
153:            }
154:
155:            public void registerContextMenu(String menuId,
156:                    MenuManager menuManager,
157:                    ISelectionProvider selectionProvider) {
158:                delegate.registerContextMenu(menuId, menuManager,
159:                        selectionProvider);
160:            }
161:
162:            public void setSelectionProvider(ISelectionProvider provider) {
163:                delegate.setSelectionProvider(provider);
164:            }
165:
166:            public String getSecondaryId() {
167:                if (delegate instanceof  IViewSite) {
168:                    return ((IViewSite) delegate).getSecondaryId();
169:                }
170:                throw new IllegalStateException(
171:                        "delegate is not a IViewSite!!!!"); //$NON-NLS-1$
172:            }
173:
174:            private static class MapEditorActionBars implements  IActionBars2 {
175:                MapEditor editor;
176:                private IActionBars2 actionBars;
177:
178:                public MapEditorActionBars(IActionBars2 actionBars,
179:                        MapEditor editor) {
180:                    this .editor = editor;
181:                    this .actionBars = actionBars;
182:                }
183:
184:                public void clearGlobalActionHandlers() {
185:                    actionBars.clearGlobalActionHandlers();
186:                }
187:
188:                public IAction getGlobalActionHandler(String actionId) {
189:                    return actionBars.getGlobalActionHandler(actionId);
190:                }
191:
192:                public IMenuManager getMenuManager() {
193:                    return actionBars.getMenuManager();
194:                }
195:
196:                public IServiceLocator getServiceLocator() {
197:                    return actionBars.getServiceLocator();
198:                }
199:
200:                public IStatusLineManager getStatusLineManager() {
201:                    return editor.statusLineManager;
202:                }
203:
204:                public IToolBarManager getToolBarManager() {
205:                    return actionBars.getToolBarManager();
206:                }
207:
208:                public void setGlobalActionHandler(String actionId,
209:                        IAction handler) {
210:                    actionBars.setGlobalActionHandler(actionId, handler);
211:                }
212:
213:                public void updateActionBars() {
214:                    actionBars.updateActionBars();
215:                }
216:
217:                public ICoolBarManager getCoolBarManager() {
218:                    return actionBars.getCoolBarManager();
219:                }
220:            }
221:
222:            public Object getService(Class api) {
223:                return delegate.getService(api);
224:            }
225:
226:            public boolean hasService(Class api) {
227:                return delegate.hasService(api);
228:            }
229:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.