use of net.servicestack.eclipse.wizard.AddReferenceWizard in project ServiceStack.Java by ServiceStack.
the class AddReferenceAction method run.
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
if (_selection != null) {
IStructuredSelection packageSelection = (IStructuredSelection) selectionService.getSelection("org.eclipse.jdt.ui.PackageExplorer");
if (packageSelection == null) {
ISelectionService selectionService = Workbench.getInstance().getActiveWorkbenchWindow().getSelectionService();
packageSelection = (IStructuredSelection) selectionService.getSelection();
}
AddReferenceWizard generationWizard = new AddReferenceWizard(_selection, packageSelection);
WizardDialog dialog = new WizardDialog(shell, generationWizard);
dialog.setBlockOnOpen(false);
Display display = shell.getDisplay();
Monitor primaryMonitor = display.getPrimaryMonitor();
Rectangle bounds = primaryMonitor.getBounds();
dialog.open();
Rectangle rect = dialog.getShell().getBounds();
int x = bounds.x + (bounds.width - rect.width) / 2;
int y = bounds.y + (bounds.height - rect.height) / 2;
dialog.getShell().setLocation(x, y);
}
}
Aggregations