use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.
the class NameBearerHandle method buildStaticPopupItems.
protected void buildStaticPopupItems() {
// build the static part of the popup
staticPopupItems = new ArrayList<JComponent>();
if (target instanceof ProcessingResource && !(target instanceof Controller)) {
// actions for PRs (but not Controllers)
staticPopupItems.add(null);
staticPopupItems.add(new XJMenuItem(new ReloadAction(), sListenerProxy));
staticPopupItems.add(new XJMenuItem(new ApplicationWithPRAction(), sListenerProxy));
} else if (target instanceof LanguageResource) {
// Language Resources
staticPopupItems.add(null);
if (target instanceof Document) {
staticPopupItems.add(new XJMenuItem(new CreateCorpusForDocAction(), sListenerProxy));
}
if (target instanceof gate.TextualDocument) {
staticPopupItems.add(null);
staticPopupItems.add(new DocumentExportMenu(this));
} else if (target instanceof Corpus) {
corpusFiller = new CorpusFillerComponent();
scfInputDialog = new SingleConcatenatedFileInputDialog();
staticPopupItems.add(new XJMenuItem(new PopulateCorpusAction(), sListenerProxy));
staticPopupItems.add(new XJMenuItem(new PopulateCorpusFromSingleConcatenatedFileAction(), sListenerProxy));
staticPopupItems.add(null);
staticPopupItems.add(new DocumentExportMenu(this));
}
if (((LanguageResource) target).getDataStore() != null) {
// this item can be used only if the resource belongs to a
// datastore
staticPopupItems.add(new XJMenuItem(new SaveAction(), sListenerProxy));
}
if (!(target instanceof AnnotationSchema)) {
staticPopupItems.add(new XJMenuItem(new SaveToAction(), sListenerProxy));
}
}
if (target instanceof Controller) {
// Applications
staticPopupItems.add(null);
if (target instanceof SerialAnalyserController) {
staticPopupItems.add(new XJMenuItem(new MakeConditionalAction(), sListenerProxy));
}
staticPopupItems.add(new XJMenuItem(new DumpToFileAction(), sListenerProxy));
staticPopupItems.add(new XJMenuItem(new ExportApplicationAction(), sListenerProxy));
}
}
use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.
the class SerialAnalyserControllerPersistence method createObject.
/**
* Creates a new object from the data contained. This new object is supposed
* to be a copy for the original object used as source for data extraction.
*/
@Override
public Object createObject() throws PersistenceException, ResourceInstantiationException {
SerialAnalyserController sac = (SerialAnalyserController) super.createObject();
sac.setCorpus((Corpus) PersistenceManager.getTransientRepresentation(corpus, resourceName, initParamOverrides));
return sac;
}
use of gate.creole.SerialAnalyserController in project gate-core by GateNLP.
the class SerialAnalyserControllerPersistence method extractDataFromSource.
/**
* Populates this Persistence with the data that needs to be stored from the
* original source object.
*/
@Override
public void extractDataFromSource(Object source) throws PersistenceException {
if (!(source instanceof SerialAnalyserController)) {
throw new UnsupportedOperationException(getClass().getName() + " can only be used for " + SerialAnalyserController.class.getName() + " objects!\n" + source.getClass().getName() + " is not a " + SerialAnalyserController.class.getName());
}
super.extractDataFromSource(source);
SerialAnalyserController sac = (SerialAnalyserController) source;
corpus = PersistenceManager.getPersistentRepresentation(sac.getCorpus());
}
Aggregations