Lines 20-27
Link Here
|
20 |
package org.netbeans.modules.java.freeform; |
20 |
package org.netbeans.modules.java.freeform; |
21 |
|
21 |
|
22 |
import org.netbeans.api.java.classpath.ClassPath; |
22 |
import org.netbeans.api.java.classpath.ClassPath; |
23 |
import org.netbeans.modules.ant.freeform.spi.LookupMerger; |
|
|
24 |
import org.netbeans.spi.java.classpath.ClassPathProvider; |
23 |
import org.netbeans.spi.java.classpath.ClassPathProvider; |
|
|
24 |
import org.netbeans.spi.project.LookupMerger; |
25 |
import org.openide.filesystems.FileObject; |
25 |
import org.openide.filesystems.FileObject; |
26 |
import org.openide.util.Lookup; |
26 |
import org.openide.util.Lookup; |
27 |
|
27 |
|
Lines 30-48
Link Here
|
30 |
* |
30 |
* |
31 |
* @author David Konecny |
31 |
* @author David Konecny |
32 |
*/ |
32 |
*/ |
33 |
public class LookupMergerImpl implements LookupMerger { |
33 |
public class LookupMergerImpl implements LookupMerger<ClassPathProvider> { |
34 |
|
34 |
|
35 |
public LookupMergerImpl() {} |
35 |
public LookupMergerImpl() {} |
36 |
|
36 |
|
37 |
public Class<?>[] getMergeableClasses() { |
37 |
public Class<ClassPathProvider> getMergeableClass() { |
38 |
return new Class<?>[] {ClassPathProvider.class}; |
38 |
return ClassPathProvider.class; |
39 |
} |
39 |
} |
40 |
|
40 |
|
41 |
public Object merge(Lookup lookup, Class clazz) { |
41 |
public ClassPathProvider merge(Lookup lookup) { |
42 |
if (clazz == ClassPathProvider.class) { |
42 |
return new ClassPathProviderImpl(lookup); |
43 |
return new ClassPathProviderImpl(lookup); |
|
|
44 |
} |
45 |
throw new IllegalArgumentException("merging of "+clazz+" is not supported"); // NOI18N |
46 |
} |
43 |
} |
47 |
|
44 |
|
48 |
private static class ClassPathProviderImpl implements ClassPathProvider { |
45 |
private static class ClassPathProviderImpl implements ClassPathProvider { |