本文整理汇总了Java中org.eclipse.ui.IWorkbenchWindow.getSelectionService方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchWindow.getSelectionService方法的具体用法?Java IWorkbenchWindow.getSelectionService怎么用?Java IWorkbenchWindow.getSelectionService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkbenchWindow
的用法示例。
在下文中一共展示了IWorkbenchWindow.getSelectionService方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException {
final INewWizard wizard = new NewModelWizard();
// Initialize the selection
final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final ISelectionService service = window.getSelectionService();
final IStructuredSelection selection = (IStructuredSelection)service
.getSelection("org.eclipse.sirius.ui.tools.views.model.explorer"); //$NON-NLS-1$
wizard.init(PlatformUI.getWorkbench(), selection);
// Open the new model wizard
final WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
dialog.open();
return null;
}
示例2: getSelectionService
import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
protected final ISelectionService getSelectionService() {
IWorkbenchWindow workBenchWindow = getActiveWorkbenchWindow();
return workBenchWindow.getSelectionService();
}