Search in sources :

Example 16 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project mdw-designer by CenturyLinkCloud.

the class DesignerPerspective method showPerspectiveAndSelectProjectPreferences.

public static void showPerspectiveAndSelectProjectPreferences(IWorkbenchWindow activeWindow, WorkflowProject project) {
    try {
        IWorkbenchPage page = showPerspective(activeWindow);
        ProcessExplorerView processExplorer = (ProcessExplorerView) page.findView(ProcessExplorerView.VIEW_ID);
        if (processExplorer != null) {
            processExplorer.setFocus();
            processExplorer.select(project);
            PropertySheet propSheet = (PropertySheet) page.showView(PROPERTY_SHEET);
            if (propSheet != null) {
                TabbedPropertySheetPage tabbedPage = (TabbedPropertySheetPage) propSheet.getCurrentPage();
                if (tabbedPage != null)
                    tabbedPage.setSelectedTab("mdw.properties.tabs.preferences");
            }
        }
    } catch (WorkbenchException ex) {
        PluginMessages.uiError(activeWindow.getShell(), ex, "Project Preferences", project);
    }
}
Also used : PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ProcessExplorerView(com.centurylink.mdw.plugin.designer.views.ProcessExplorerView) TabbedPropertySheetPage(com.centurylink.mdw.plugin.designer.properties.TabbedPropertySheetPage) WorkbenchException(org.eclipse.ui.WorkbenchException)

Example 17 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet 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)

Example 18 with PropertySheet

use of org.eclipse.ui.views.properties.PropertySheet in project hale by halestudio.

the class OpenPropertiesHandler method unpinAndOpenPropertiesView.

/**
 * Unpin and open the porperties view.
 *
 * @param activeWindow the active workbench window
 */
public static void unpinAndOpenPropertiesView(IWorkbenchWindow activeWindow) {
    try {
        // unpin 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(false);
                    IWorkbenchPart activePart = activeWindow.getActivePage().getActivePart();
                    /*
						 * Feign the part has been activated (cause else the
						 * PropertySheet will only take a selection from the
						 * last part it was displaying properties about)
						 */
                    sheet.partActivated(activePart);
                    // get the current selection
                    ISelection sel = activePart.getSite().getSelectionProvider().getSelection();
                    // Update the properties view with the current selection
                    sheet.selectionChanged(activePart, sel);
                }
            }
        }
        // show the view
        activeWindow.getActivePage().showView(IPageLayout.ID_PROP_SHEET);
    } catch (PartInitException e) {
        log.error("Error opening properties view", e);
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) PropertySheet(org.eclipse.ui.views.properties.PropertySheet) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IViewReference(org.eclipse.ui.IViewReference) ISelection(org.eclipse.jface.viewers.ISelection) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

PropertySheet (org.eclipse.ui.views.properties.PropertySheet)18 TabbedPropertySheetPage (org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)8 Test (org.junit.Test)6 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)5 PartInitException (org.eclipse.ui.PartInitException)5 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 IViewReference (org.eclipse.ui.IViewReference)4 IViewPart (org.eclipse.ui.IViewPart)3 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)3 ISelection (org.eclipse.jface.viewers.ISelection)2 PropertyShowInContext (org.eclipse.ui.views.properties.PropertyShowInContext)2 TabbedPropertySheetPage (com.centurylink.mdw.plugin.designer.properties.TabbedPropertySheetPage)1 ProcessExplorerView (com.centurylink.mdw.plugin.designer.views.ProcessExplorerView)1 TransformationMessage (eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage)1 InstanceSelection (eu.esdihumboldt.hale.ui.selection.InstanceSelection)1 DefaultInstanceSelection (eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection)1 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)1 TransformedDataView (eu.esdihumboldt.hale.ui.views.data.TransformedDataView)1 MappingView (eu.esdihumboldt.hale.ui.views.mapping.MappingView)1