|
Lines 31-36
Link Here
|
| 31 |
import org.eclipse.swt.SWT; |
31 |
import org.eclipse.swt.SWT; |
| 32 |
import org.eclipse.swt.custom.StyledText; |
32 |
import org.eclipse.swt.custom.StyledText; |
| 33 |
import org.eclipse.swt.widgets.Combo; |
33 |
import org.eclipse.swt.widgets.Combo; |
|
|
34 |
import org.eclipse.swt.widgets.Control; |
| 34 |
import org.eclipse.swt.widgets.Display; |
35 |
import org.eclipse.swt.widgets.Display; |
| 35 |
import org.eclipse.swt.widgets.Event; |
36 |
import org.eclipse.swt.widgets.Event; |
| 36 |
import org.eclipse.swt.widgets.Listener; |
37 |
import org.eclipse.swt.widgets.Listener; |
|
Lines 40-47
Link Here
|
| 40 |
import org.eclipse.ui.IWindowListener; |
41 |
import org.eclipse.ui.IWindowListener; |
| 41 |
import org.eclipse.ui.IWorkbench; |
42 |
import org.eclipse.ui.IWorkbench; |
| 42 |
import org.eclipse.ui.IWorkbenchWindow; |
43 |
import org.eclipse.ui.IWorkbenchWindow; |
|
|
44 |
import org.eclipse.ui.contexts.IContextService; |
| 45 |
import org.eclipse.ui.handlers.IHandlerService; |
| 43 |
import org.eclipse.ui.internal.Workbench; |
46 |
import org.eclipse.ui.internal.Workbench; |
| 44 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
47 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
|
|
48 |
import org.eclipse.ui.internal.contexts.ContextService; |
| 49 |
import org.eclipse.ui.internal.handlers.HandlerService; |
| 45 |
import org.eclipse.ui.internal.misc.Policy; |
50 |
import org.eclipse.ui.internal.misc.Policy; |
| 46 |
import org.eclipse.ui.internal.util.Util; |
51 |
import org.eclipse.ui.internal.util.Util; |
| 47 |
import org.eclipse.ui.keys.IBindingService; |
52 |
import org.eclipse.ui.keys.IBindingService; |
|
Lines 724-729
Link Here
|
| 724 |
+ potentialKeyStrokes + ")"); //$NON-NLS-1$ |
729 |
+ potentialKeyStrokes + ")"); //$NON-NLS-1$ |
| 725 |
} |
730 |
} |
| 726 |
|
731 |
|
|
|
732 |
/* |
| 733 |
* KLUDGE. This works around a couple of specific problems in how GTK+ |
| 734 |
* works. The first problem is the ordering of key press events with |
| 735 |
* respect to shell activation events. If on the event thread a dialog |
| 736 |
* is about to open, and the user presses a key, the key press event |
| 737 |
* will arrive before the shell activation event. From the perspective |
| 738 |
* of Eclipse, this means that things like two "Open Type" dialogs can |
| 739 |
* appear if "Ctrl+Shift+T" is pressed twice rapidly. For more |
| 740 |
* information, please see Bug 95792. The second problem is simply a bug |
| 741 |
* in GTK+, for which an incomplete workaround currently exists in SWT. |
| 742 |
* This makes shell activation events unreliable. Please see Bug 56231 |
| 743 |
* and Bug 95222 for more information. |
| 744 |
*/ |
| 745 |
if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$ |
| 746 |
final Widget widget = event.widget; |
| 747 |
|
| 748 |
// Update the contexts. |
| 749 |
final ContextService contextService = (ContextService) workbench |
| 750 |
.getAdapter(IContextService.class); |
| 751 |
if ((widget instanceof Control) && (!widget.isDisposed())) { |
| 752 |
final Shell shell = ((Control) widget).getShell(); |
| 753 |
contextService.updateShellKludge(shell); |
| 754 |
} else { |
| 755 |
contextService.updateShellKludge(); |
| 756 |
} |
| 757 |
|
| 758 |
// Update the handlers. |
| 759 |
final HandlerService handlerService = (HandlerService) workbench |
| 760 |
.getAdapter(IHandlerService.class); |
| 761 |
if ((widget instanceof Control) && (!widget.isDisposed())) { |
| 762 |
final Shell shell = ((Control) widget).getShell(); |
| 763 |
handlerService.updateShellKludge(shell); |
| 764 |
} else { |
| 765 |
handlerService.updateShellKludge(); |
| 766 |
} |
| 767 |
} |
| 768 |
|
| 727 |
KeySequence sequenceBeforeKeyStroke = state.getCurrentSequence(); |
769 |
KeySequence sequenceBeforeKeyStroke = state.getCurrentSequence(); |
| 728 |
for (Iterator iterator = potentialKeyStrokes.iterator(); iterator |
770 |
for (Iterator iterator = potentialKeyStrokes.iterator(); iterator |
| 729 |
.hasNext();) { |
771 |
.hasNext();) { |