Search in sources :

Example 1 with TransformedDataView

use of eu.esdihumboldt.hale.ui.views.data.TransformedDataView in project hale by halestudio.

the class InstanceValidationReportDetailsPage method showSelectionInDataView.

/**
 * Shows the current selection (if valid) in the transformed data view.
 */
private void showSelectionInDataView() {
    InstanceSelection selection = getValidSelection();
    if (selection != null) {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        // pin the property sheet if possible
        IViewReference ref = page.findViewReference(IPageLayout.ID_PROP_SHEET);
        if (ref != null) {
            IViewPart part = ref.getView(true);
            if (part instanceof PropertySheet)
                ((PropertySheet) part).setPinned(true);
        }
        // show transformed data view with selection if possible
        try {
            TransformedDataView transformedDataView = (TransformedDataView) page.showView(TransformedDataView.ID);
            transformedDataView.showSelection(selection, reportImage);
        } catch (PartInitException e) {
        // if it's not there, we cannot do anything
        }
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IViewReference(org.eclipse.ui.IViewReference) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) InstanceSelection(eu.esdihumboldt.hale.ui.selection.InstanceSelection) DefaultInstanceSelection(eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection) PartInitException(org.eclipse.ui.PartInitException) TransformedDataView(eu.esdihumboldt.hale.ui.views.data.TransformedDataView)

Aggregations

InstanceSelection (eu.esdihumboldt.hale.ui.selection.InstanceSelection)1 DefaultInstanceSelection (eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection)1 TransformedDataView (eu.esdihumboldt.hale.ui.views.data.TransformedDataView)1 IViewPart (org.eclipse.ui.IViewPart)1 IViewReference (org.eclipse.ui.IViewReference)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 PartInitException (org.eclipse.ui.PartInitException)1 PropertySheet (org.eclipse.ui.views.properties.PropertySheet)1