}
int initialIndex = checkServices(services, defaultService, attributes);
Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getActiveWindow();
Window dialogOwner = getDialogOwner(activeWindow);
ServiceUIDialog dialog = new ServiceUIDialog(gc, x, y, services, initialIndex, flavor,
attributes, dialogOwner);
dialog.show();
if (dialogOwner != activeWindow) {
dialogOwner.dispose();
}
if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
attributes.clear();
attributes.addAll(dialog.getAttributes());
return dialog.getPrintService();
}
return null;
}