use of org.eclipse.ui.views.properties.PropertyShowInContext in project tdi-studio-se by Talend.
the class StartMonitorJobAction method openPropertiesView.
/**
* Opens the properties view.
*
* @param jvm The JVM
* @throws PartInitException
*/
private static void openPropertiesView(IActiveJvm jvm) throws PartInitException {
PropertySheet view = (PropertySheet) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IPageLayout.ID_PROP_SHEET, String.valueOf(new Date().getTime()), IWorkbenchPage.VIEW_ACTIVATE);
// make sure to set the selection as an identifier of view
PropertyShowInContext context = (PropertyShowInContext) view.getShowInContext();
if (context.getSelection() == null) {
RuntimeVisualizationView jvmExplorer = (RuntimeVisualizationView) context.getPart();
if (jvmExplorer != null) {
view.selectionChanged(jvmExplorer, jvmExplorer.getSelection());
}
}
}
use of org.eclipse.ui.views.properties.PropertyShowInContext in project linuxtools by eclipse.
the class ShowInPropertiesViewCommandHandler method execute.
@Override
public Object execute(final ExecutionEvent event) {
final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
final List<IDockerContainer> containers = CommandUtils.getSelectedContainers(activePart);
if (containers == null || containers.isEmpty()) {
return null;
}
Display.getDefault().asyncExec(() -> {
try {
final PropertySheet propertySheet = (PropertySheet) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(// $NON-NLS-1$
"org.eclipse.ui.views.PropertySheet");
final PropertyShowInContext showInContext = new PropertyShowInContext(activePart, HandlerUtil.getCurrentSelection(event));
propertySheet.show(showInContext);
} catch (PartInitException e) {
Activator.logErrorMessage(CommandMessages.getString(// $NON-NLS-1$
"command.showIn.propertiesView.failure"), e);
}
});
return null;
}
Aggregations