Révision 1999
tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java (revision 1999) | ||
---|---|---|
9 | 9 |
import java.util.HashMap; |
10 | 10 |
import java.util.HashSet; |
11 | 11 |
import java.util.Map; |
12 |
import java.util.jar.Attributes; |
|
13 |
import java.util.jar.Manifest; |
|
12 | 14 |
|
13 | 15 |
import org.codehaus.groovy.control.CompilerConfiguration; |
14 | 16 |
import org.codehaus.groovy.control.customizers.ImportCustomizer; |
... | ... | |
17 | 19 |
import org.osgi.framework.BundleContext; |
18 | 20 |
import org.osgi.framework.wiring.BundleWiring; |
19 | 21 |
import org.txm.Toolbox; |
22 |
import org.txm.utils.BundleUtils; |
|
20 | 23 |
import org.txm.utils.logger.Log; |
21 | 24 |
|
22 | 25 |
import cern.colt.Arrays; |
... | ... | |
113 | 116 |
return defaultGSE; |
114 | 117 |
} |
115 | 118 |
|
119 |
public static void getDependancies(String bundle, HashSet<String> defaultPlugins) { |
|
120 |
//if (defaultPlugins.contains(bundle)) return; |
|
121 |
|
|
122 |
Bundle rcpBundle = BundleUtils.getBundle(bundle); |
|
123 |
if (rcpBundle == null) return; |
|
124 |
String dependanciesString = rcpBundle.getHeaders().get("Require-Bundle"); |
|
125 |
if (dependanciesString == null) return; |
|
126 |
//System.out.println("Require-Bundle: "+dependanciesString); |
|
127 |
for (String dependancy : dependanciesString.split(",")) { |
|
128 |
String name = dependancy.split(";", 2)[0]; |
|
129 |
defaultPlugins.add(name); |
|
130 |
getDependancies(name, defaultPlugins); |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
116 | 134 |
/** |
117 | 135 |
* |
118 | 136 |
* @return a class loader containing all bundles activated in TXM |
... | ... | |
129 | 147 |
// return -1; |
130 | 148 |
// } |
131 | 149 |
// }); |
150 |
HashSet<String> defaultPlugins = new HashSet<String>(); |
|
151 |
getDependancies("org.txm.rcp", defaultPlugins); |
|
152 |
|
|
132 | 153 |
for (Bundle b : bundles) { |
133 | 154 |
if (b == null) continue; |
134 | 155 |
|
135 | 156 |
if (!b.getSymbolicName().startsWith("org.txm")) continue; |
157 |
if (defaultPlugins.contains(b.getSymbolicName())) continue; |
|
136 | 158 |
|
137 | 159 |
BundleWiring bundleWiring = b.adapt(BundleWiring.class); |
138 | 160 |
if (bundleWiring == null) { |
... | ... | |
148 | 170 |
} |
149 | 171 |
|
150 | 172 |
Log.fine("Initializing TXMClassLoader with " + loaders.size() + " bundles."); |
173 |
//for (ClassLoader l : loaders) System.out.println(l); |
|
151 | 174 |
return new TXMClassLoader(loaders); |
152 | 175 |
} |
153 | 176 |
|
tmp/org.txm.groovy.core/META-INF/MANIFEST.MF (revision 1999) | ||
---|---|---|
10 | 10 |
Require-Bundle: org.txm.core;bundle-version="0.8.0";visibility:=reexport, |
11 | 11 |
org.txm.annotation.core;visibility:=reexport, |
12 | 12 |
org.txm.searchengine.cqp.core;visibility:=reexport, |
13 |
org.txm.tokenizer.core;visibility:=reexport |
|
13 |
org.txm.tokenizer.core;visibility:=reexport, |
|
14 |
org.eclipse.osgi |
|
14 | 15 |
|
tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java (revision 1999) | ||
---|---|---|
37 | 37 |
return FrameworkUtil.getBundle(clazz); |
38 | 38 |
} |
39 | 39 |
|
40 |
public static Bundle getBundle(String bundle_id) { |
|
41 |
return Platform.getBundle(bundle_id); |
|
42 |
} |
|
43 |
|
|
40 | 44 |
public static String getBundleId(Class clazz) { |
41 | 45 |
return getBundle(clazz).getSymbolicName(); |
42 | 46 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 1999) | ||
---|---|---|
64 | 64 |
public boolean checkStatsEngine() { |
65 | 65 |
if(!Toolbox.getEngineManager(EngineType.STATS).isCurrentEngineAvailable()) { |
66 | 66 |
Log.warning(StatsEngineCoreMessages.error_statsEngineNotReadyCancelingCommand); |
67 |
return false; |
|
67 | 68 |
} |
68 | 69 |
return true; |
69 | 70 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/menu/MacrosMenuContribution.java (revision 1999) | ||
---|---|---|
116 | 116 |
for (File f : files) { |
117 | 117 |
if (f.getName().endsWith("Macro.groovy")) { |
118 | 118 |
MenuItem menuItem = new MenuItem(menu, SWT.PUSH); |
119 |
menuItem.setText(f.getName()); |
|
119 |
menuItem.setText(f.getName().substring(0, f.getName().length()-12));
|
|
120 | 120 |
menuItem.addSelectionListener(new MacroSelectionAdapter(f)); |
121 | 121 |
} else if (f.isDirectory()) { |
122 | 122 |
MenuItem subMenuItem = new MenuItem(menu, SWT.CASCADE); |
Formats disponibles : Unified diff