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);
}
}
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
}
}
}
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);
}
}
Aggregations