use of annis.libgui.exporter.ExporterPlugin in project ANNIS by korpling.
the class QueryController method executeExport.
public void executeExport(ExportPanel panel, EventBus eventBus) {
Future exportFuture = state.getExecutedTasks().get(QueryUIState.QueryType.EXPORT);
if (exportFuture != null && !exportFuture.isDone()) {
exportFuture.cancel(true);
}
ExportQuery query = getExportQuery();
addHistoryEntry(query);
ExporterPlugin exporterImpl = ui.getExporter(query.getExporter());
exportFuture = Background.call(new ExportBackgroundJob(query, exporterImpl, ui, eventBus, panel));
state.getExecutedTasks().put(QueryUIState.QueryType.EXPORT, exportFuture);
}
use of annis.libgui.exporter.ExporterPlugin in project ANNIS by korpling.
the class ExportPanel method attach.
@Override
public void attach() {
super.attach();
this.ui = UI.getCurrent();
if (this.ui instanceof AnnisBaseUI) {
PluginManagerUtil util = new PluginManagerUtil(((AnnisBaseUI) getUI()).getPluginManager());
for (ExporterPlugin e : util.getPlugins(ExporterPlugin.class)) {
exporterClassContainer.addItem(e.getClass());
}
}
exporterClassContainer.sort(new Object[] { "simpleName" }, new boolean[] { true });
cbExporter.setItemCaptionMode(ItemCaptionMode.PROPERTY);
cbExporter.setItemCaptionPropertyId("simpleName");
if (exporterClassContainer.size() > 0) {
cbExporter.setValue(exporterClassContainer.getIdByIndex(0));
}
}
use of annis.libgui.exporter.ExporterPlugin in project ANNIS by korpling.
the class AnnisBaseUI method getExporter.
@Override
public ExporterPlugin getExporter(Class<? extends ExporterPlugin> clazz) {
if (exporterRegistryCache == null) {
exporterRegistryCache = MutableClassToInstanceMap.create();
PluginManagerUtil util = new PluginManagerUtil(getPluginManager());
for (ExporterPlugin e : util.getPlugins(ExporterPlugin.class)) {
exporterRegistryCache.put(e.getClass(), e);
}
}
return exporterRegistryCache.get(clazz);
}
Aggregations