use of eu.esdihumboldt.hale.ui.service.align.AlignmentService in project hale by halestudio.
the class AlignmentExportAdvisor method prepareProvider.
/**
* @see AbstractIOAdvisor#prepareProvider(IOProvider)
*/
@Override
public void prepareProvider(AlignmentWriter provider) {
super.prepareProvider(provider);
AlignmentService as = getService(AlignmentService.class);
provider.setAlignment(as.getAlignment());
SchemaService ss = getService(SchemaService.class);
provider.setSourceSchema(ss.getSchemas(SchemaSpaceID.SOURCE));
provider.setTargetSchema(ss.getSchemas(SchemaSpaceID.TARGET));
}
use of eu.esdihumboldt.hale.ui.service.align.AlignmentService in project hale by halestudio.
the class IndexStartup method earlyStartup.
@Override
public void earlyStartup() {
final InstanceIndexUpdateService indexUpdater = PlatformUI.getWorkbench().getService(InstanceIndexUpdateService.class);
final AlignmentService alignmentService = PlatformUI.getWorkbench().getService(AlignmentService.class);
alignmentService.addListener(indexUpdater);
}
use of eu.esdihumboldt.hale.ui.service.align.AlignmentService in project hale by halestudio.
the class RemoveCellHandler method execute.
/**
* @see IHandler#execute(ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// collect cells from selection
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (MessageDialog.openQuestion(HandlerUtil.getActiveShell(event), "Delete cells", "Do you really want to delete the selected cells?")) {
AlignmentService as = PlatformUI.getWorkbench().getService(AlignmentService.class);
if (selection instanceof IStructuredSelection) {
List<?> list = ((IStructuredSelection) selection).toList();
List<Cell> cells = new ArrayList<Cell>();
for (Object object : list) {
if (object instanceof Cell) {
// FIXME sanity checks for cell deletion? (e.g. don't
// allow remove type mapping if there are properties
// mapped?) where to do it?
// For now only done in activeWhen defined for handler
cells.add((Cell) object);
}
}
as.removeCells(cells.toArray(new Cell[cells.size()]));
}
}
return null;
}
use of eu.esdihumboldt.hale.ui.service.align.AlignmentService in project hale by halestudio.
the class AlignmentServiceSource method getCurrentState.
/**
* @see ISourceProvider#getCurrentState()
*/
@Override
public Map<String, Object> getCurrentState() {
AlignmentService as = PlatformUI.getWorkbench().getService(AlignmentService.class);
Map<String, Object> result = new HashMap<String, Object>();
result.put(HAS_CELLS, hasCells(as));
return result;
}
use of eu.esdihumboldt.hale.ui.service.align.AlignmentService in project hale by halestudio.
the class AlignmentServiceSource method dispose.
/**
* @see ISourceProvider#dispose()
*/
@Override
public void dispose() {
AlignmentService as = PlatformUI.getWorkbench().getService(AlignmentService.class);
as.removeListener(alignmentListener);
}
Aggregations