Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 175534 Details for
Bug 321282
Loading Javascript resources from bundles with dependencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to add resource dependency checking
resource-dependency.patch (text/plain), 4.72 KB, created by
Paul Kendall
on 2010-07-29 21:21:23 EDT
(
hide
)
Description:
Patch to add resource dependency checking
Filename:
MIME Type:
Creator:
Paul Kendall
Created:
2010-07-29 21:21:23 EDT
Size:
4.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.ui >Index: schema/rap/resources.exsd >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui/schema/rap/resources.exsd,v >retrieving revision 1.1 >diff -u -r1.1 resources.exsd >--- schema/rap/resources.exsd 18 Apr 2008 10:46:45 -0000 1.1 >+++ schema/rap/resources.exsd 29 Jul 2010 23:44:55 -0000 >@@ -49,6 +49,9 @@ > </appInfo> > </annotation> > <complexType> >+ <sequence minOccurs="1" maxOccurs="unbounded"> >+ <element ref="dependency"/> >+ </sequence> > <attribute name="class" type="string" use="required"> > <annotation> > <documentation> >@@ -62,6 +65,21 @@ > </complexType> > </element> > >+ <element name="dependency"> >+ <complexType> >+ <attribute name="class" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn=":org.eclipse.rwt.resources.IResource"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ > <annotation> > <appInfo> > <meta.section type="since"/> >#P org.eclipse.rap.ui.workbench >Index: Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java,v >retrieving revision 1.13 >diff -u -r1.13 EngineConfigWrapper.java >--- Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java 1 Apr 2010 14:27:58 -0000 1.13 >+++ Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java 29 Jul 2010 23:44:57 -0000 >@@ -15,6 +15,12 @@ > import java.lang.reflect.Field; > import java.net.URL; > import java.text.MessageFormat; >+import java.util.ArrayList; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import java.util.Map.Entry; > > import org.eclipse.core.runtime.*; > import org.eclipse.rap.ui.internal.preferences.WorkbenchFileSettingStoreFactory; >@@ -411,15 +417,53 @@ > IExtensionRegistry registry = Platform.getExtensionRegistry(); > IExtensionPoint point = registry.getExtensionPoint( ID_RESOURCES ); > IConfigurationElement[] elements = point.getConfigurationElements(); >+ Map loaded = new HashMap();//<IResource,String> >+ Map deferred = new HashMap();//<IResource,List<String>> > for( int i = 0; i < elements.length; i++ ) { > try { > IResource resource > = ( IResource )elements[ i ].createExecutableExtension( "class" ); >- ResourceRegistry.add( resource ); >+ IConfigurationElement[] children = elements[i].getChildren( "dependency" ); >+ >+ // 1. create dependency list of not loaded resources >+ List depenencies = new ArrayList(); >+ for( int j = 0 ; j < children.length ; j++ ) { >+ String dependency = children[ j ].getAttribute( "class" ); >+ depenencies.add( dependency ); >+ } >+ depenencies.removeAll( loaded.values() ); >+ >+ // 2. if no dependencies then add otherwise add to deferred list >+ if( depenencies.size() == 0 ) { >+ ResourceRegistry.add( resource ); >+ loaded.put( resource, resource.getClass().getName() ); >+ } else { >+ deferred.put( resource, depenencies ); >+ } >+ >+ // 3. iterate over deferred list >+ for( Iterator iter = deferred.entrySet().iterator() ; iter.hasNext() ; ) { >+ Entry entry = (Entry) iter.next(); >+ IResource deferredResource = (IResource) entry.getKey(); >+ List depends = (List) entry.getValue(); >+ // 3a. remove added resources from dependency list >+ depends.removeAll( loaded.values() ); >+ // 3b. if no dependencies then add and remove from deferred list >+ if( depends.size() == 0 ) { >+ ResourceRegistry.add( deferredResource ); >+ loaded.put( deferredResource, deferredResource.getClass().getName() ); >+ iter.remove(); >+ } >+ } >+ > } catch( final CoreException ce ) { > WorkbenchPlugin.getDefault().getLog().log( ce.getStatus() ); > } > } >+ // 4. if any left in deferred list then error cannot satisfy resource dependencies >+ if (deferred.size() != 0) { >+ WorkbenchPlugin.getDefault().getLog().log( new Status( IStatus.ERROR, "org.eclipse.rap.ui.workbench", "Dependencies could not be resolved for " + deferred ) ); >+ } > } > > private static void registerUICallBackServiceHandler() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 321282
:
175534
|
194340
|
194422