Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 321282 | Differences between
and this patch

Collapse All | Expand All

(-)schema/rap/resources.exsd (+18 lines)
Lines 49-54 Link Here
49
         </appInfo>
49
         </appInfo>
50
      </annotation>
50
      </annotation>
51
      <complexType>
51
      <complexType>
52
         <sequence minOccurs="1" maxOccurs="unbounded">
53
            <element ref="dependency"/>
54
         </sequence>
52
         <attribute name="class" type="string" use="required">
55
         <attribute name="class" type="string" use="required">
53
            <annotation>
56
            <annotation>
54
               <documentation>
57
               <documentation>
Lines 62-67 Link Here
62
      </complexType>
65
      </complexType>
63
   </element>
66
   </element>
64
67
68
   <element name="dependency">
69
      <complexType>
70
         <attribute name="class" type="string">
71
            <annotation>
72
               <documentation>
73
                  
74
               </documentation>
75
               <appInfo>
76
                  <meta.attribute kind="java" basedOn=":org.eclipse.rwt.resources.IResource"/>
77
               </appInfo>
78
            </annotation>
79
         </attribute>
80
      </complexType>
81
   </element>
82
65
   <annotation>
83
   <annotation>
66
      <appInfo>
84
      <appInfo>
67
         <meta.section type="since"/>
85
         <meta.section type="since"/>
(-)Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java (-1 / +45 lines)
Lines 15-20 Link Here
15
import java.lang.reflect.Field;
15
import java.lang.reflect.Field;
16
import java.net.URL;
16
import java.net.URL;
17
import java.text.MessageFormat;
17
import java.text.MessageFormat;
18
import java.util.ArrayList;
19
import java.util.HashMap;
20
import java.util.Iterator;
21
import java.util.List;
22
import java.util.Map;
23
import java.util.Map.Entry;
18
24
19
import org.eclipse.core.runtime.*;
25
import org.eclipse.core.runtime.*;
20
import org.eclipse.rap.ui.internal.preferences.WorkbenchFileSettingStoreFactory;
26
import org.eclipse.rap.ui.internal.preferences.WorkbenchFileSettingStoreFactory;
Lines 411-425 Link Here
411
    IExtensionRegistry registry = Platform.getExtensionRegistry();
417
    IExtensionRegistry registry = Platform.getExtensionRegistry();
412
    IExtensionPoint point = registry.getExtensionPoint( ID_RESOURCES );
418
    IExtensionPoint point = registry.getExtensionPoint( ID_RESOURCES );
413
    IConfigurationElement[] elements = point.getConfigurationElements();
419
    IConfigurationElement[] elements = point.getConfigurationElements();
420
    Map loaded = new HashMap();//<IResource,String>
421
    Map deferred = new HashMap();//<IResource,List<String>>
414
    for( int i = 0; i < elements.length; i++ ) {
422
    for( int i = 0; i < elements.length; i++ ) {
415
      try {
423
      try {
416
        IResource resource
424
        IResource resource
417
          = ( IResource )elements[ i ].createExecutableExtension( "class" );
425
          = ( IResource )elements[ i ].createExecutableExtension( "class" );
418
        ResourceRegistry.add( resource );
426
        IConfigurationElement[] children = elements[i].getChildren( "dependency" );
427
428
        // 1. create dependency list of not loaded resources
429
        List depenencies = new ArrayList();
430
        for( int j = 0 ; j < children.length ; j++ ) {
431
          String dependency = children[ j ].getAttribute( "class" );
432
		  depenencies.add( dependency );
433
        }
434
        depenencies.removeAll( loaded.values() );
435
        
436
        // 2. if no dependencies then add otherwise add to deferred list
437
        if( depenencies.size() == 0 ) {
438
          ResourceRegistry.add( resource );
439
          loaded.put( resource, resource.getClass().getName() );
440
        } else {
441
          deferred.put( resource, depenencies );
442
        }
443
        
444
        // 3. iterate over deferred list
445
        for( Iterator iter = deferred.entrySet().iterator() ; iter.hasNext() ; ) {
446
          Entry entry = (Entry) iter.next();
447
          IResource deferredResource = (IResource) entry.getKey();
448
          List depends = (List) entry.getValue();
449
          // 3a. remove added resources from dependency list
450
          depends.removeAll( loaded.values() );
451
          // 3b. if no dependencies then add and remove from deferred list
452
          if( depends.size() == 0 ) {
453
            ResourceRegistry.add( deferredResource );
454
            loaded.put( deferredResource, deferredResource.getClass().getName() );
455
            iter.remove();
456
          }
457
        }
458
        
419
      } catch( final CoreException ce ) {
459
      } catch( final CoreException ce ) {
420
        WorkbenchPlugin.getDefault().getLog().log( ce.getStatus() );
460
        WorkbenchPlugin.getDefault().getLog().log( ce.getStatus() );
421
      }
461
      }
422
    }
462
    }
463
    // 4. if any left in deferred list then error cannot satisfy resource dependencies
464
    if (deferred.size() != 0) {
465
      WorkbenchPlugin.getDefault().getLog().log( new Status( IStatus.ERROR, "org.eclipse.rap.ui.workbench", "Dependencies could not be resolved for " + deferred ) );
466
    }
423
  }
467
  }
424
468
425
  private static void registerUICallBackServiceHandler() {
469
  private static void registerUICallBackServiceHandler() {

Return to bug 321282