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 41492 Details for
Bug 137091
[KeyBindings] Toggle Mark Occurrences shortcut is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
editor action bar patch v02
bug137091-ui.workbench-v02.txt (text/plain), 10.55 KB, created by
Paul Webster
on 2006-05-15 14:53:54 EDT
(
hide
)
Description:
editor action bar patch v02
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2006-05-15 14:53:54 EDT
Size:
10.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/EditorReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorReference.java,v >retrieving revision 1.14 >diff -u -r1.14 EditorReference.java >--- Eclipse UI/org/eclipse/ui/internal/EditorReference.java 4 Apr 2006 18:12:56 -0000 1.14 >+++ Eclipse UI/org/eclipse/ui/internal/EditorReference.java 15 May 2006 18:50:07 -0000 >@@ -405,7 +405,7 @@ > > EditorSite site = new EditorSite(this, part, manager.page, descr); > >- site.setActionBars(new EditorActionBars(manager.page, site, getId())); >+ site.setActionBars(new EditorActionBars(manager.page, site.getWorkbenchWindow(), getId())); > try { > part.init(site, input); > } catch (PartInitException e) { >Index: Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java,v >retrieving revision 1.30 >diff -u -r1.30 EditorActionBars.java >--- Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java 24 Feb 2006 18:36:11 -0000 1.30 >+++ Eclipse UI/org/eclipse/ui/internal/EditorActionBars.java 15 May 2006 18:50:07 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.ui.internal; > >+import org.eclipse.core.expressions.Expression; > import org.eclipse.jface.action.ActionContributionItem; > import org.eclipse.jface.action.ContributionManager; > import org.eclipse.jface.action.GroupMarker; >@@ -31,6 +32,7 @@ > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.SubActionBars2; > import org.eclipse.ui.actions.RetargetAction; >+import org.eclipse.ui.internal.expressions.LegacyEditorActionBarExpression; > import org.eclipse.ui.internal.misc.Policy; > import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory; > import org.eclipse.ui.services.IServiceLocator; >@@ -89,6 +91,7 @@ > > private IActionBarPresentationFactory actionBarPresentation; > >+ > /** > * Constructs the EditorActionBars for an editor. > */ >@@ -327,7 +330,6 @@ > super.partChanged(part); > if (part instanceof IEditorPart) { > IEditorPart editor = (IEditorPart) part; >- setServiceLocator(editor.getEditorSite()); > if (editorContributor != null) { > editorContributor.setActiveEditor(editor); > } >@@ -470,4 +472,16 @@ > } > } > } >+ >+ private LegacyEditorActionBarExpression fEditorHandlerExpression = null; >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.SubActionBars#getHandlerExpression() >+ */ >+ protected Expression getHandlerExpression() { >+ if (fEditorHandlerExpression == null) { >+ fEditorHandlerExpression = new LegacyEditorActionBarExpression(type); >+ } >+ return fEditorHandlerExpression; >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/EditorManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java,v >retrieving revision 1.109 >diff -u -r1.109 EditorManager.java >--- Eclipse UI/org/eclipse/ui/internal/EditorManager.java 30 Mar 2006 01:36:58 -0000 1.109 >+++ Eclipse UI/org/eclipse/ui/internal/EditorManager.java 15 May 2006 18:50:07 -0000 >@@ -301,7 +301,7 @@ > } > > // Create a new action bar set. >- actionBars = new EditorActionBars(page, site, type); >+ actionBars = new EditorActionBars(page, site.getWorkbenchWindow(), type); > actionBars.addRef(); > actionCache.put(type, actionBars); > >@@ -333,7 +333,7 @@ > > // Create a new action bar set. > // Note: It is an empty set. >- EditorActionBars actionBars = new EditorActionBars(page, site, type); >+ EditorActionBars actionBars = new EditorActionBars(page, site.getWorkbenchWindow(), type); > actionBars.addRef(); > actionCache.put(type, actionBars); > >Index: Eclipse UI/org/eclipse/ui/internal/PartSite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java,v >retrieving revision 1.86 >diff -u -r1.86 PartSite.java >--- Eclipse UI/org/eclipse/ui/internal/PartSite.java 8 May 2006 20:55:36 -0000 1.86 >+++ Eclipse UI/org/eclipse/ui/internal/PartSite.java 15 May 2006 18:50:07 -0000 >@@ -536,6 +536,8 @@ > buffer.append(getPluginId()); > buffer.append(",registeredName="); //$NON-NLS-1$ > buffer.append(getRegisteredName()); >+ buffer.append(",hashCode="); //$NON-NLS-1$ >+ buffer.append(hashCode()); > buffer.append(')'); > return buffer.toString(); > } >Index: Eclipse UI/org/eclipse/ui/SubActionBars.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/SubActionBars.java,v >retrieving revision 1.26 >diff -u -r1.26 SubActionBars.java >--- Eclipse UI/org/eclipse/ui/SubActionBars.java 8 May 2006 20:55:31 -0000 1.26 >+++ Eclipse UI/org/eclipse/ui/SubActionBars.java 15 May 2006 18:50:07 -0000 >@@ -50,14 +50,14 @@ > * over handlers contributed to the {@link IHandlerService}. > */ > private static final Expression EXPRESSION = new Expression() { >- public final EvaluationResult evaluate(final IEvaluationContext context) { >- return EvaluationResult.TRUE; >- } >- > public final void collectExpressionInfo(final ExpressionInfo info) { > info > .addVariableNameAccess(SourcePriorityNameMapping.LEGACY_LEGACY_NAME); > } >+ >+ public final EvaluationResult evaluate(final IEvaluationContext context) { >+ return EvaluationResult.TRUE; >+ } > }; > > /** >@@ -317,6 +317,17 @@ > } > > /** >+ * The expression used for action handler activation. This method should not >+ * be extended or overridden by subclasses. >+ * >+ * @return the expression for use with action handler activation. >+ * @since 3.2 >+ */ >+ protected Expression getHandlerExpression() { >+ return EXPRESSION; >+ } >+ >+ /** > * Returns the abstract menu manager. If items are added or removed from the > * manager be sure to call <code>updateActionBars</code>. > * >@@ -506,7 +517,7 @@ > final IHandler actionHandler = new ActionHandler(handler); > final IHandlerActivation activation = service > .activateHandler(commandId, actionHandler, >- EXPRESSION); >+ getHandlerExpression()); > activationsByActionId.put(actionID, activation); > } > } >Index: Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java >diff -N Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/expressions/LegacyEditorActionBarExpression.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ui.internal.expressions; >+ >+import org.eclipse.core.expressions.EvaluationResult; >+import org.eclipse.core.expressions.Expression; >+import org.eclipse.core.expressions.ExpressionInfo; >+import org.eclipse.core.expressions.IEvaluationContext; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.ui.ISources; >+import org.eclipse.ui.internal.services.SourcePriorityNameMapping; >+ >+/** >+ * <p> >+ * An expression representing the <code>part id</code> of the legacy editor >+ * action bar contribution. >+ * </p> >+ * <p> >+ * This class is not intended for use outside of the >+ * <code>org.eclipse.ui.workbench</code> plug-in. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public class LegacyEditorActionBarExpression extends Expression { >+ /** >+ * The seed for the hash code for all schemes. >+ */ >+ private static final int HASH_INITIAL = LegacyEditorActionBarExpression.class >+ .getName().hashCode(); >+ >+ /** >+ * The identifier for the editor that must be active for this expression to >+ * evaluate to <code>true</code>. This value is never <code>null</code>. >+ */ >+ private final String fActiveEditorId; >+ >+ /** >+ * Constructs a new instance of <code>LegacyEditorActionBarExpression</code> >+ * >+ * @param activeEditorId >+ * The identifier of the editor to match with the active editor; >+ * must not be <code>null</code> >+ */ >+ public LegacyEditorActionBarExpression(final String activeEditorId) { >+ >+ if (activeEditorId == null) { >+ throw new NullPointerException( >+ "The targetId for an editor contribution must not be null"); //$NON-NLS-1$ >+ } >+ fActiveEditorId = activeEditorId; >+ } >+ >+ public final void collectExpressionInfo(final ExpressionInfo info) { >+ info.addVariableNameAccess(ISources.ACTIVE_EDITOR_ID_NAME); >+ info >+ .addVariableNameAccess(SourcePriorityNameMapping.LEGACY_LEGACY_NAME); >+ } >+ >+ protected final int computeHashCode() { >+ int hashCode = HASH_INITIAL * HASH_FACTOR + hashCode(fActiveEditorId); >+ return hashCode; >+ } >+ >+ public final boolean equals(final Object object) { >+ if (object instanceof LegacyEditorActionBarExpression) { >+ final LegacyEditorActionBarExpression that = (LegacyEditorActionBarExpression) object; >+ return equals(fActiveEditorId, that.fActiveEditorId); >+ } >+ >+ return false; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.expressions.Expression#evaluate(org.eclipse.core.expressions.IEvaluationContext) >+ */ >+ public final EvaluationResult evaluate(final IEvaluationContext context) >+ throws CoreException { >+ if ("org.eclipse.jdt.ui.CompilationUnitEditor".equals(fActiveEditorId)) { //$NON-NLS-1$ >+ System.out.println(); >+ } >+ >+ final Object variable = context >+ .getVariable(ISources.ACTIVE_EDITOR_ID_NAME); >+ if (equals(fActiveEditorId, variable)) { >+ return EvaluationResult.TRUE; >+ } >+ return EvaluationResult.FALSE; >+ } >+ >+ public final String toString() { >+ final StringBuffer buffer = new StringBuffer(); >+ buffer.append("LegacyEditorActionBarExpression("); //$NON-NLS-1$ >+ buffer.append(fActiveEditorId); >+ buffer.append(')'); >+ return buffer.toString(); >+ } >+}
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 137091
:
41170
|
41357
|
41492
|
41588
|
41637
|
41713
|
42049