Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 40073 Details for
Bug 135535
[KeyBindings] Key bindings lost in the Java editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Extra debugging for commands v03
bug135535-debugging03.txt (text/plain), 11.43 KB, created by
Paul Webster
on 2006-05-02 13:57:45 EDT
(
hide
)
Description:
Extra debugging for commands v03
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2006-05-02 13:57:45 EDT
Size:
11.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.commands >Index: src/org/eclipse/core/commands/CommandManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.commands/src/org/eclipse/core/commands/CommandManager.java,v >retrieving revision 1.27 >diff -u -r1.27 CommandManager.java >--- src/org/eclipse/core/commands/CommandManager.java 23 Apr 2006 16:05:33 -0000 1.27 >+++ src/org/eclipse/core/commands/CommandManager.java 2 May 2006 17:38:48 -0000 >@@ -865,6 +865,8 @@ > while (commandIdItr.hasNext()) { > getCommand((String) commandIdItr.next()); > } >+ >+ System.out.println("CMDS >>>> setHandlersByCommandId"); //$NON-NLS-1$ > > // Now, set-up the handlers on all of the existing commands. > final Iterator commandItr = handleObjectsById.values().iterator(); >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java,v >retrieving revision 1.24 >diff -u -r1.24 HandlerAuthority.java >--- Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java 11 Apr 2006 13:53:54 -0000 1.24 >+++ Eclipse UI/org/eclipse/ui/internal/handlers/HandlerAuthority.java 2 May 2006 17:38:48 -0000 >@@ -11,6 +11,9 @@ > > package org.eclipse.ui.internal.handlers; > >+import java.io.PrintWriter; >+import java.io.StringWriter; >+import java.lang.reflect.Field; > import java.util.Collection; > import java.util.HashMap; > import java.util.HashSet; >@@ -23,7 +26,13 @@ > import org.eclipse.core.commands.util.Tracing; > import org.eclipse.core.expressions.Expression; > import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.IEditorPart; > import org.eclipse.ui.ISources; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchPartSite; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.LegacyHandlerSubmissionExpression; >+import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.commands.ICommandService; > import org.eclipse.ui.handlers.IHandlerActivation; > import org.eclipse.ui.internal.misc.Policy; >@@ -117,6 +126,10 @@ > */ > private final Map handlerActivationsByCommandId = new HashMap(); > >+ private IHandlerActivation tracingNullHandlerActivation; >+ >+ private Exception tracingNullStack; >+ > /** > * Constructs a new instance of <code>HandlerAuthority</code>. > * >@@ -149,6 +162,9 @@ > final SortedSet handlerActivations = (SortedSet) value; > if (!handlerActivations.contains(activation)) { > handlerActivations.add(activation); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, resolveConflicts(commandId, > handlerActivations)); > } >@@ -160,11 +176,17 @@ > handlerActivations.add(activation); > handlerActivationsByCommandId > .put(commandId, handlerActivations); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, resolveConflicts(commandId, > handlerActivations)); > } > } else { > handlerActivationsByCommandId.put(commandId, activation); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, (evaluate(activation) ? activation : null)); > } > >@@ -208,6 +230,9 @@ > handlerActivations.remove(activation); > if (handlerActivations.isEmpty()) { > handlerActivationsByCommandId.remove(commandId); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, null); > > } else if (handlerActivations.size() == 1) { >@@ -215,12 +240,19 @@ > .iterator().next(); > handlerActivationsByCommandId.put(commandId, > remainingActivation); >+ tracingNullHandlerActivation = remainingActivation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); >+ > updateCommand( > commandId, > (evaluate(remainingActivation) ? remainingActivation > : null)); > > } else { >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, resolveConflicts(commandId, > handlerActivations)); > } >@@ -228,6 +260,9 @@ > } else if (value instanceof IHandlerActivation) { > if (value == activation) { > handlerActivationsByCommandId.remove(commandId); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, null); > } > } >@@ -286,6 +321,11 @@ > final SortedSet activations) { > // If we don't have any, then there is no match. > if (activations.isEmpty()) { >+ if ((DEBUG_VERBOSE) >+ && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID >+ .equals(commandId)))) { >+ Tracing.printTrace(TRACING_COMPONENT, " rc-empty"); //$NON-NLS-1$ >+ } > return null; > } > >@@ -296,6 +336,12 @@ > while (activationItr.hasNext()) { > final IHandlerActivation currentActivation = (IHandlerActivation) activationItr > .next(); >+ if ((DEBUG_VERBOSE) >+ && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID >+ .equals(commandId)))) { >+ Tracing.printTrace(TRACING_COMPONENT, " rc-con : " + currentActivation); //$NON-NLS-1$ >+ } >+ > if (!evaluate(currentActivation)) { > continue; // only consider potentially active handlers > } >@@ -304,7 +350,7 @@ > if ((DEBUG_VERBOSE) > && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID > .equals(commandId)))) { >- Tracing.printTrace(TRACING_COMPONENT, " resolveConflicts: eval: " + currentActivation); //$NON-NLS-1$ >+ Tracing.printTrace(TRACING_COMPONENT, " rc-eval: " + currentActivation); //$NON-NLS-1$ > } > if (bestActivation == null) { > bestActivation = currentActivation; >@@ -346,6 +392,63 @@ > } > } > >+ if ((DEBUG_VERBOSE) >+ && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID >+ .equals(commandId)))) { >+ if (conflict || bestActivation==null ) { >+ >+ IWorkbenchWindow wwin = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); >+ if (wwin == null) { >+ Tracing.printTrace(TRACING_COMPONENT, " wwin is null"); //$NON-NLS-1$ >+ return null; >+ } >+ IWorkbenchPage ap = wwin.getActivePage(); >+ if (ap == null) { >+ Tracing.printTrace(TRACING_COMPONENT, " ap is null"); //$NON-NLS-1$ >+ return null; >+ } >+ IEditorPart ae = ap.getActiveEditor(); >+ if (ae == null) { >+ Tracing.printTrace(TRACING_COMPONENT, " ae is null"); //$NON-NLS-1$ >+ return null; >+ } >+ boolean foundOne = false; >+ for(Iterator it = activations.iterator(); it.hasNext();) { >+ IHandlerActivation activation = (IHandlerActivation) it.next(); >+ Expression ex = activation.getExpression(); >+ if (ex == null) { >+ Tracing.printTrace(TRACING_COMPONENT, " ex is null : " + activation); //$NON-NLS-1$ >+ } else { >+ if (!(ex instanceof LegacyHandlerSubmissionExpression)) { >+ Tracing.printTrace(TRACING_COMPONENT, " ex is not instanceof LegacyHandlerSubmissionExpression: " + activation); //$NON-NLS-1$ >+ } else { >+ LegacyHandlerSubmissionExpression lhex = (LegacyHandlerSubmissionExpression) ex; >+ try { >+ Field field = lhex.getClass().getField("activeSite"); //$NON-NLS-1$ >+ field.setAccessible(true); >+ IWorkbenchPartSite site = (IWorkbenchPartSite) field.get(lhex); >+ if (site == ae.getSite()) { >+ Tracing.printTrace(TRACING_COMPONENT, " found matching handler activation: " + activation); //$NON-NLS-1$ >+ Tracing.printTrace(TRACING_COMPONENT, " matching handler activation evaluates to: " + evaluate(activation)); //$NON-NLS-1$ >+ foundOne = true; >+ } >+ } catch (SecurityException e) { >+ e.printStackTrace(); >+ } catch (NoSuchFieldException e) { >+ e.printStackTrace(); >+ } catch (IllegalArgumentException e) { >+ e.printStackTrace(); >+ } catch (IllegalAccessException e) { >+ e.printStackTrace(); >+ } >+ } >+ } >+ } >+ if (!foundOne) { >+ Tracing.printTrace(TRACING_COMPONENT, " Did not find matching handler activation"); //$NON-NLS-1$ >+ } >+ } >+ } > // Return the current best. > if (conflict) { > return null; >@@ -429,13 +532,22 @@ > final Object value = handlerActivationsByCommandId.get(commandId); > if (value instanceof IHandlerActivation) { > final IHandlerActivation activation = (IHandlerActivation) value; >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, (evaluate(activation) ? activation > : null)); > } else if (value instanceof SortedSet) { > final IHandlerActivation activation = resolveConflicts( > commandId, (SortedSet) value); >+ tracingNullHandlerActivation = activation; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, activation); > } else { >+ tracingNullHandlerActivation = null; >+ tracingNullStack = new Exception(); >+ tracingNullStack.fillInStackTrace(); > updateCommand(commandId, null); > } > } >@@ -465,8 +577,24 @@ > final IHandlerActivation activation) { > final Command command = commandService.getCommand(commandId); > if (activation == null) { >+ if ((DEBUG_VERBOSE) >+ && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID >+ .equals(commandId)))) { >+ Tracing.printTrace(TRACING_COMPONENT, "updateCommand: - " + tracingNullHandlerActivation); //$NON-NLS-1$ >+ StringWriter wout = new StringWriter(); >+ tracingNullStack.printStackTrace(new PrintWriter(wout)); >+ Tracing.printTrace(TRACING_COMPONENT, "updateCommand: n " + wout.toString()); //$NON-NLS-1$ >+ } > command.setHandler(null); > } else { >+ if ((DEBUG_VERBOSE) >+ && ((DEBUG_VERBOSE_COMMAND_ID == null) || (DEBUG_VERBOSE_COMMAND_ID >+ .equals(commandId)))) { >+ Tracing.printTrace(TRACING_COMPONENT, "updateCommand: + " + tracingNullHandlerActivation); //$NON-NLS-1$ >+ StringWriter wout = new StringWriter(); >+ tracingNullStack.printStackTrace(new PrintWriter(wout)); >+ Tracing.printTrace(TRACING_COMPONENT, "updateCommand: s " + wout.toString()); //$NON-NLS-1$ >+ } > command.setHandler(activation.getHandler()); > } > } >Index: Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java,v >retrieving revision 1.37 >diff -u -r1.37 MultiPageEditorPart.java >--- Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java 21 Apr 2006 20:43:38 -0000 1.37 >+++ Eclipse UI/org/eclipse/ui/part/MultiPageEditorPart.java 2 May 2006 17:38:48 -0000 >@@ -806,8 +806,11 @@ > */ > public Object getAdapter(Class adapter) { > Object result = super.getAdapter(adapter); >- if (result == null && getActiveEditor() != null) { >- result = getActiveEditor().getAdapter(adapter); >+ if (result == null) { >+ IEditorPart innerEditor = getActiveEditor(); >+ if (innerEditor != null && innerEditor != this) { >+ result = innerEditor.getAdapter(adapter); >+ } > } > return result; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 135535
:
38014
|
38081
|
38093
|
38211
|
38847
|
39559
|
39562
|
39635
|
39637
|
40028
|
40073
|
40085
|
40106
|
40193
|
40201
|
40299
|
40316
|
40390
|
40407
|
40454
|
40455
|
40456
|
40470