Source Code Cross Referenced for SaveablesProvider.java in  » IDE-Eclipse » ui » org » eclipse » ui » navigator » 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 » ui » org.eclipse.ui.navigator 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2006 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:         ******************************************************************************/package org.eclipse.ui.navigator;
011:
012:        import org.eclipse.core.runtime.IAdaptable;
013:        import org.eclipse.ui.ISaveablesLifecycleListener;
014:        import org.eclipse.ui.Saveable;
015:        import org.eclipse.ui.SaveablesLifecycleEvent;
016:        import org.eclipse.ui.services.IDisposable;
017:
018:        /**
019:         * Provides {@link Saveable} objects to the common navigator, and allows to map
020:         * between elements in the tree and models.
021:         * <p>
022:         * This class is intended to be subclassed by clients.
023:         * </p>
024:         * Instances of subclasses will be returned from content extensions that
025:         * implement {@link IAdaptable}.
026:         * 
027:         * @since 3.2
028:         * 
029:         */
030:        public abstract class SaveablesProvider implements  IDisposable {
031:
032:            private ISaveablesLifecycleListener listener;
033:
034:            /**
035:             * Creates a new saveable model provider. May only be called by subclasses.
036:             * 
037:             */
038:            protected SaveablesProvider() {
039:            }
040:
041:            /**
042:             * Initializes this SaveablesProvider with the given listener, and calls the hook method doInit().
043:             * 
044:             * @param listener
045:             */
046:            final public void init(ISaveablesLifecycleListener listener) {
047:                this .listener = listener;
048:                doInit();
049:            }
050:
051:            /**
052:             * May be overridden by clients. The default implementation does nothing.
053:             */
054:            protected void doInit() {
055:            }
056:
057:            /**
058:             * Notifies the listener that the given models were opened in this model
059:             * provider. This method must be called on the UI thread.
060:             * 
061:             * @param models
062:             */
063:            final protected void fireSaveablesOpened(Saveable[] models) {
064:                listener.handleLifecycleEvent(new SaveablesLifecycleEvent(this ,
065:                        SaveablesLifecycleEvent.POST_OPEN, models, false));
066:            }
067:
068:            /**
069:             * Notifies the listener that the given models are about to be closed in
070:             * this model provider. This method must be called on the UI thread.
071:             * 
072:             * @param models
073:             * @param force
074:             *            true if the closing may be canceled by the user
075:             * @return true if the listener vetoed the closing (may be ignored if force
076:             *         is true)
077:             */
078:            final protected boolean fireSaveablesClosing(Saveable[] models,
079:                    boolean force) {
080:                SaveablesLifecycleEvent saveablesLifecycleEvent = new SaveablesLifecycleEvent(
081:                        this , SaveablesLifecycleEvent.PRE_CLOSE, models, force);
082:                listener.handleLifecycleEvent(saveablesLifecycleEvent);
083:                return saveablesLifecycleEvent.isVeto();
084:            }
085:
086:            /**
087:             * Notifies the listener that the given models were closed in this model
088:             * provider. This method must be called on the UI thread.
089:             * 
090:             * @param models
091:             */
092:            final protected void fireSaveablesClosed(Saveable[] models) {
093:                listener.handleLifecycleEvent(new SaveablesLifecycleEvent(this ,
094:                        SaveablesLifecycleEvent.POST_CLOSE, models, false));
095:            }
096:
097:            /**
098:             * Notifies the listener that the given models' dirty state has changed.
099:             * This method must be called on the UI thread.
100:             * 
101:             * @param models
102:             */
103:            final protected void fireSaveablesDirtyChanged(Saveable[] models) {
104:                listener.handleLifecycleEvent(new SaveablesLifecycleEvent(this ,
105:                        SaveablesLifecycleEvent.DIRTY_CHANGED, models, false));
106:            }
107:
108:            /**
109:             * Returns the saveables reachable through this provider. Changes to the
110:             * list of saveables or to the saveables' dirty state must be announced
111:             * using the appropriate fire* methods.
112:             * 
113:             * @return the saveables returned by this saveables provider.
114:             */
115:            public abstract Saveable[] getSaveables();
116:
117:            /**
118:             * Returns the elements representing the given saveable. It is recommended
119:             * that a saveable be represented by only one element.
120:             * 
121:             * @param saveable
122:             * @return the elements representing the given saveable (array may be empty)
123:             */
124:            public abstract Object[] getElements(Saveable saveable);
125:
126:            /**
127:             * Returns the saveable for the given element, or null if the element does
128:             * not represent a saveable.
129:             * 
130:             * @param element
131:             * @return the saveable for the given element, or null
132:             */
133:            public abstract Saveable getSaveable(Object element);
134:
135:            /**
136:             * Disposes of this saveables provider. Subclasses may extend, but must call
137:             * the super implementation.
138:             */
139:            public void dispose() {
140:                listener = null;
141:            }
142:
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.