-
Notifications
You must be signed in to change notification settings - Fork 229
Add scope changed notification to SearchDialog #3097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4ca8ba8
Add scope changed notification to SearchDialog
jjohnstn fd5d6fd
Version bump(s) for 4.37 stream
eclipse-platform-bot 7d1a213
Update bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IScope…
jjohnstn 2460079
Update bundles/org.eclipse.search/search/org/eclipse/search/internal/…
jjohnstn 967551a
Update bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ScopeC…
jjohnstn 532116b
Use lambda to invoide scopeChanged method for listeners
jjohnstn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IScopeChangeProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2025 IBM Corporation and others. | ||
| * | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License 2.0 | ||
| * which accompanies this distribution, and is available at | ||
| * https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * IBM Corporation - initial API and implementation | ||
| *******************************************************************************/ | ||
| package org.eclipse.jface.dialogs; | ||
|
|
||
| /** | ||
| * @since 3.38 | ||
| * | ||
| */ | ||
| public interface IScopeChangeProvider { | ||
|
|
||
| /** | ||
| * Adds a listener for scope changes in this scope change provider. Has no | ||
| * effect if an identical listener is already registered. | ||
| * | ||
| * @param listener a scope changed listener | ||
| */ | ||
| void addScopeChangedListener(IScopeChangedListener listener); | ||
|
|
||
| /** | ||
| * Removes the given scope change listener from this page change provider. Has | ||
| * no effect if an identical listener is not registered. | ||
| * | ||
| * @param listener a scope changed listener | ||
| */ | ||
| void removeScopeChangedListener(IScopeChangedListener listener); | ||
|
|
||
| } |
31 changes: 31 additions & 0 deletions
31
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IScopeChangedListener.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2025 IBM Corporation and others. | ||
| * | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License 2.0 | ||
| * which accompanies this distribution, and is available at | ||
| * https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * IBM Corporation - initial API and implementation | ||
| *******************************************************************************/ | ||
| package org.eclipse.jface.dialogs; | ||
|
|
||
| /** | ||
| * A listener which is notified when the scope for the search page is changed. | ||
| * | ||
| * @see IScopeChangeProvider | ||
| * @see ScopeChangedEvent | ||
| * | ||
| * @since 3.38 | ||
| */ | ||
| public interface IScopeChangedListener { | ||
| /** | ||
| * Notifies that the selected scope has changed. | ||
| * | ||
| * @param event event object describing the change | ||
| */ | ||
| public void scopeChanged(ScopeChangedEvent event); | ||
| } | ||
68 changes: 68 additions & 0 deletions
68
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/ScopeChangedEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2025 IBM Corporation and others. | ||
| * | ||
| * This program and the accompanying materials | ||
| * are made available under the terms of the Eclipse Public License 2.0 | ||
| * which accompanies this distribution, and is available at | ||
| * https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * IBM Corporation - initial API and implementation | ||
| * Red Hat Inc. - copied and modified from PageChangedEvent.java | ||
| *******************************************************************************/ | ||
| package org.eclipse.jface.dialogs; | ||
|
|
||
| import java.util.EventObject; | ||
|
|
||
| /** | ||
| * Event object describing a page selection change. The source of these events | ||
| * is a page change provider. | ||
| * | ||
| * @see IPageChangeProvider | ||
| * @see IPageChangedListener | ||
| * | ||
| * @since 3.38 | ||
| */ | ||
| public class ScopeChangedEvent extends EventObject { | ||
|
|
||
| private static final long serialVersionUID = -2652600407410991930L; | ||
|
|
||
| /** | ||
| * The changed scope. | ||
| */ | ||
| protected int scope; | ||
jjohnstn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * Creates a new event for the given source and new scope. | ||
| * | ||
| * @param source the page change provider | ||
| * @param scope the new scope. In the JFace provided dialogs this will be an | ||
| * <code>ISearchPageContainer</code> constant. | ||
| */ | ||
| public ScopeChangedEvent(IPageChangeProvider source, | ||
| int scope) { | ||
| super(source); | ||
| this.scope = scope; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the new scope. | ||
| * | ||
| * @return the new scope. In dialogs implemented by JFace, this will be an | ||
| * <code>ISearchPageContainer</code> constant. | ||
| */ | ||
| public int getScope() { | ||
| return scope; | ||
| } | ||
|
|
||
| /** | ||
| * Returns the scope change provider that is the source of this event. | ||
| * | ||
| * @return the originating scope change provider | ||
| */ | ||
| public IScopeChangeProvider getPageChangeProvider() { | ||
| return (IScopeChangeProvider) getSource(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.