|
Lines 29-45
Link Here
|
| 29 |
import org.eclipse.swt.SWT; |
29 |
import org.eclipse.swt.SWT; |
| 30 |
import org.eclipse.swt.custom.StyledText; |
30 |
import org.eclipse.swt.custom.StyledText; |
| 31 |
import org.eclipse.swt.widgets.Combo; |
31 |
import org.eclipse.swt.widgets.Combo; |
|
|
32 |
import org.eclipse.swt.widgets.Control; |
| 32 |
import org.eclipse.swt.widgets.Display; |
33 |
import org.eclipse.swt.widgets.Display; |
| 33 |
import org.eclipse.swt.widgets.Event; |
34 |
import org.eclipse.swt.widgets.Event; |
| 34 |
import org.eclipse.swt.widgets.Listener; |
35 |
import org.eclipse.swt.widgets.Listener; |
| 35 |
import org.eclipse.swt.widgets.Shell; |
36 |
import org.eclipse.swt.widgets.Shell; |
| 36 |
import org.eclipse.swt.widgets.Text; |
37 |
import org.eclipse.swt.widgets.Text; |
| 37 |
import org.eclipse.swt.widgets.Widget; |
38 |
import org.eclipse.swt.widgets.Widget; |
|
|
39 |
import org.eclipse.ui.ISources; |
| 38 |
import org.eclipse.ui.IWindowListener; |
40 |
import org.eclipse.ui.IWindowListener; |
| 39 |
import org.eclipse.ui.IWorkbench; |
41 |
import org.eclipse.ui.IWorkbench; |
| 40 |
import org.eclipse.ui.IWorkbenchWindow; |
42 |
import org.eclipse.ui.IWorkbenchWindow; |
|
|
43 |
import org.eclipse.ui.contexts.IContextService; |
| 44 |
import org.eclipse.ui.handlers.IHandlerService; |
| 41 |
import org.eclipse.ui.internal.Workbench; |
45 |
import org.eclipse.ui.internal.Workbench; |
| 42 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
46 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
|
|
47 |
import org.eclipse.ui.internal.contexts.ContextAuthority; |
| 48 |
import org.eclipse.ui.internal.contexts.ContextService; |
| 49 |
import org.eclipse.ui.internal.handlers.HandlerAuthority; |
| 50 |
import org.eclipse.ui.internal.handlers.HandlerService; |
| 43 |
import org.eclipse.ui.internal.misc.Policy; |
51 |
import org.eclipse.ui.internal.misc.Policy; |
| 44 |
import org.eclipse.ui.internal.util.Util; |
52 |
import org.eclipse.ui.internal.util.Util; |
| 45 |
import org.eclipse.ui.keys.IBindingService; |
53 |
import org.eclipse.ui.keys.IBindingService; |
|
Lines 707-713
Link Here
|
| 707 |
.println("KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = " //$NON-NLS-1$ |
715 |
.println("KEYS >>> WorkbenchKeyboard.press(potentialKeyStrokes = " //$NON-NLS-1$ |
| 708 |
+ potentialKeyStrokes + ")"); //$NON-NLS-1$ |
716 |
+ potentialKeyStrokes + ")"); //$NON-NLS-1$ |
| 709 |
} |
717 |
} |
| 710 |
|
718 |
|
|
|
719 |
/* |
| 720 |
* TODO Kludge. A partial workaround for Bug 56231. This should be |
| 721 |
* removed once SWT fixes Bug 56231 such that activation works properly |
| 722 |
* on all platforms. Commented out at the moment. |
| 723 |
*/ |
| 724 |
if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$ |
| 725 |
final Widget widget = event.widget; |
| 726 |
|
| 727 |
final ContextService contextService = (ContextService) workbench |
| 728 |
.getAdapter(IContextService.class); |
| 729 |
ContextAuthority contextAuthority = contextService.contextAuthority; |
| 730 |
if ((widget instanceof Control) && (!widget.isDisposed())) { |
| 731 |
final Shell shell = ((Control) widget).getShell(); |
| 732 |
contextAuthority.sourceChanged(ISources.ACTIVE_SHELL, |
| 733 |
ISources.ACTIVE_SHELL_NAME, shell); |
| 734 |
} else { |
| 735 |
contextAuthority.updateCurrentState(); |
| 736 |
contextAuthority.sourceChanged(ISources.ACTIVE_SHELL); |
| 737 |
} |
| 738 |
|
| 739 |
final HandlerService handlerService = (HandlerService) workbench |
| 740 |
.getAdapter(IHandlerService.class); |
| 741 |
HandlerAuthority handlerAuthority = handlerService.handlerAuthority; |
| 742 |
if ((widget instanceof Control) && (!widget.isDisposed())) { |
| 743 |
final Shell shell = ((Control) widget).getShell(); |
| 744 |
handlerAuthority.sourceChanged(ISources.ACTIVE_SHELL, |
| 745 |
ISources.ACTIVE_SHELL_NAME, shell); |
| 746 |
} else { |
| 747 |
handlerAuthority.updateCurrentState(); |
| 748 |
handlerAuthority.sourceChanged(ISources.ACTIVE_SHELL); |
| 749 |
} |
| 750 |
} |
| 751 |
|
| 711 |
KeySequence sequenceBeforeKeyStroke = state.getCurrentSequence(); |
752 |
KeySequence sequenceBeforeKeyStroke = state.getCurrentSequence(); |
| 712 |
for (Iterator iterator = potentialKeyStrokes.iterator(); iterator |
753 |
for (Iterator iterator = potentialKeyStrokes.iterator(); iterator |
| 713 |
.hasNext();) { |
754 |
.hasNext();) { |