Search in sources :

Example 1 with MappingView

use of eu.esdihumboldt.hale.ui.views.mapping.MappingView in project hale by halestudio.

the class TransformationReportPage method onDoubleClick.

@Override
protected void onDoubleClick(Message m) {
    if (m instanceof TransformationMessage) {
        TransformationMessage tm = (TransformationMessage) m;
        AlignmentService as = PlatformUI.getWorkbench().getService(AlignmentService.class);
        if (as != null && as.getAlignment().getCell(tm.getCellId()) != null) {
            IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            // pin the property sheet if possible
            IViewReference ref = activeWindow.getActivePage().findViewReference(IPageLayout.ID_PROP_SHEET);
            if (ref != null) {
                IViewPart part = ref.getView(false);
                if (part instanceof PropertySheet) {
                    PropertySheet sheet = (PropertySheet) part;
                    if (!sheet.isPinned()) {
                        sheet.setPinned(true);
                    }
                }
            }
            // show cell in mapping view
            try {
                IViewPart part = activeWindow.getActivePage().showView(MappingView.ID);
                if (part instanceof MappingView) {
                    ((MappingView) part).selectCell(tm.getCellId());
                }
            } catch (PartInitException e) {
            // ignore
            }
        }
    }
    super.onDoubleClick(m);
}
Also used : TransformationMessage(eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IViewPart(org.eclipse.ui.IViewPart) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) AlignmentService(eu.esdihumboldt.hale.ui.service.align.AlignmentService) IViewReference(org.eclipse.ui.IViewReference) MappingView(eu.esdihumboldt.hale.ui.views.mapping.MappingView) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with MappingView

use of eu.esdihumboldt.hale.ui.views.mapping.MappingView in project hale by halestudio.

the class TaskTreeView method onDoubleClick.

/**
 * React on a double click on an item that represents the given identifier
 *
 * @param context the context object of the double-clicked node
 */
protected void onDoubleClick(Object context) {
    String cellId;
    if (context instanceof Cell) {
        cellId = ((Cell) context).getId();
    } else {
        return;
    }
    IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    try {
        IViewPart part = activeWindow.getActivePage().showView(MappingView.ID);
        if (part instanceof MappingView) {
            ((MappingView) part).selectCell(cellId);
        }
    } catch (PartInitException e) {
    // ignore
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IViewPart(org.eclipse.ui.IViewPart) MappingView(eu.esdihumboldt.hale.ui.views.mapping.MappingView) PartInitException(org.eclipse.ui.PartInitException) Cell(eu.esdihumboldt.hale.common.align.model.Cell)

Aggregations

MappingView (eu.esdihumboldt.hale.ui.views.mapping.MappingView)2 IViewPart (org.eclipse.ui.IViewPart)2 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)2 PartInitException (org.eclipse.ui.PartInitException)2 Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 TransformationMessage (eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage)1 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)1 IViewReference (org.eclipse.ui.IViewReference)1 PropertySheet (org.eclipse.ui.views.properties.PropertySheet)1