Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 95222 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/contexts/ContextAuthority.java (-3 / +3 lines)
Lines 52-58 Link Here
52
 * 
52
 * 
53
 * @since 3.1
53
 * @since 3.1
54
 */
54
 */
55
final class ContextAuthority implements ISourceProviderListener {
55
public final class ContextAuthority implements ISourceProviderListener {
56
56
57
	/**
57
	/**
58
	 * Whether the context authority should kick into debugging mode. This
58
	 * Whether the context authority should kick into debugging mode. This
Lines 633-639 Link Here
633
	 * @param sourcePriority
633
	 * @param sourcePriority
634
	 *            A bit mask of all the source priorities that have changed.
634
	 *            A bit mask of all the source priorities that have changed.
635
	 */
635
	 */
636
	private final void sourceChanged(final int sourcePriority) {
636
	public final void sourceChanged(final int sourcePriority) {
637
		/*
637
		/*
638
		 * In this first phase, we cycle through all of the activations that
638
		 * In this first phase, we cycle through all of the activations that
639
		 * could have potentially changed. Each such activation is added to a
639
		 * could have potentially changed. Each such activation is added to a
Lines 788-794 Link Here
788
	 * Updates the evaluation context with the current state from all of the
788
	 * Updates the evaluation context with the current state from all of the
789
	 * source providers.
789
	 * source providers.
790
	 */
790
	 */
791
	private final void updateCurrentState() {
791
	public final void updateCurrentState() {
792
		final Iterator providerItr = providers.iterator();
792
		final Iterator providerItr = providers.iterator();
793
		while (providerItr.hasNext()) {
793
		while (providerItr.hasNext()) {
794
			final ISourceProvider provider = (ISourceProvider) providerItr
794
			final ISourceProvider provider = (ISourceProvider) providerItr
(-)Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java (-1 / +1 lines)
Lines 35-41 Link Here
35
	/**
35
	/**
36
	 * The central authority for determining which context we should use.
36
	 * The central authority for determining which context we should use.
37
	 */
37
	 */
38
	private final ContextAuthority contextAuthority;
38
	public final ContextAuthority contextAuthority;
39
39
40
	/**
40
	/**
41
	 * The context manager that supports this service. This value is never
41
	 * The context manager that supports this service. This value is never
(-)Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java (-3 / +3 lines)
Lines 43-49 Link Here
43
 * 
43
 * 
44
 * @since 3.1
44
 * @since 3.1
45
 */
45
 */
46
final class HandlerAuthority implements ISourceProviderListener {
46
public final class HandlerAuthority implements ISourceProviderListener {
47
47
48
	/**
48
	/**
49
	 * Whether the workbench command support should kick into debugging mode.
49
	 * Whether the workbench command support should kick into debugging mode.
Lines 377-383 Link Here
377
	 * @param sourcePriority
377
	 * @param sourcePriority
378
	 *            A bit mask of all the source priorities that have changed.
378
	 *            A bit mask of all the source priorities that have changed.
379
	 */
379
	 */
380
	private final void sourceChanged(final int sourcePriority) {
380
	public final void sourceChanged(final int sourcePriority) {
381
		/*
381
		/*
382
		 * In this first phase, we cycle through all of the activations that
382
		 * In this first phase, we cycle through all of the activations that
383
		 * could have potentially changed. Each such activation is added to a
383
		 * could have potentially changed. Each such activation is added to a
Lines 517-523 Link Here
517
	 * Updates the evaluation context with the current state from all of the
517
	 * Updates the evaluation context with the current state from all of the
518
	 * source providers.
518
	 * source providers.
519
	 */
519
	 */
520
	private final void updateCurrentState() {
520
	public final void updateCurrentState() {
521
		fillInCurrentState(context);
521
		fillInCurrentState(context);
522
	}
522
	}
523
}
523
}
(-)Eclipse UI/org/eclipse/ui/internal/handlers/HandlerService.java (-1 / +1 lines)
Lines 43-49 Link Here
43
	/**
43
	/**
44
	 * The central authority for determining which handler we should use.
44
	 * The central authority for determining which handler we should use.
45
	 */
45
	 */
46
	private final HandlerAuthority handlerAuthority;
46
	public final HandlerAuthority handlerAuthority;
47
47
48
	/**
48
	/**
49
	 * Constructs a new instance of <code>CommandService</code> using a
49
	 * Constructs a new instance of <code>CommandService</code> using a
(-)Eclipse UI/org/eclipse/ui/internal/keys/WorkbenchKeyboard.java (-1 / +42 lines)
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();) {

Return to bug 95222