Community
Participate
Working Groups
It should be possible to bulk-reset the default editor for a specific file which can be chosen manually via the Open With context menu actions. For example, I might have opened a couple of Java Files with the Text Editor instead of the Java Editor. Finding and resetting them manually is a cumbersome process. It would be nice to have a reset option on the File Association Preference Page (Prefs->General->Editors->File Assoc) to be able to remove the setting for all files of a certain type. The action should iterate over all the resources in the workspace, and call IDE.setDefaultEditor(file, null) for all matching files.
If anybody's interested in looking at this, http://wiki.eclipse.org/Platform_UI/How_to_Contribute PW -
Hi, I can take it. I would like to discuss which location would be best for the user to find the reset operation. Putting it in the FileEditorsPreferencePage would only allow to reset the whole workspace. If somebody likes to reset it for one project or folder only a context menu is a better option. It may also be easier to find, if it's located in the same group or if it's even a submenu action of the 'Open With' context menu. In addition the org.eclipse.ui.workbench where the FileEditorsPreferencePage is located, currently doesn't have access to the IDE.setDefaultEditor method in the org.eclipse.ui.ide plugin. Introducing a dependency is not possible, because it would create a cycle. Any opinions on this?
OK, try for a general context menu, the same segment that has Open With and Show In. You want to use org.eclipse.ui.menus/menuContribution/@locationURI="popup:org.eclipse.ui.popup.any?after=<needToFindOut>" You would use a visibleWhen on the o.e.ui.menus command contribution, so it was only visible on something that adapts to an IResource. Then you can write a handler that processes the selection, and resets the IResources attribute on it (for an IFile) or on its children (for an IFolder/IProject). PW
Finding out how to contribute to the menu in this area is the difficult part. As far as I can see it's all hard wired action groups. Any hints?
(In reply to comment #4) > Finding out how to contribute to the menu in this area is the difficult part. Start with popup:org.eclipse.ui.popup.any?after=additions and we'll go from there. PW
Created attachment 227852 [details] First idea for implementation
Here's a patch with a first shot of an implementation using the context menu. When 'Reset Editors' is selected from the context menu, a dialog pops up which asks the user to select the extensions of files which should be reset. Please add your comments.
(In reply to comment #6) > Created attachment 227852 [details] > First idea for implementation Thanks for the patch. It looks like it was created against a local commit in your repo (it doesn't apply), as it has sections like: diff --git a/bundles/org.eclipse.ui.ide/plugin.xml b/bundles/org.eclipse.ui.ide/plugin.xml index 66f3bc0..1822aaf 100644 --- a/bundles/org.eclipse.ui.ide/plugin.xml +++ b/bundles/org.eclipse.ui.ide/plugin.xml @@ -1001,10 +1001,9 @@ </command> <command categoryId="org.eclipse.ui.category.project" - defaultHandler="org.eclipse.ui.commands.ResetEditorHandler" - description="Reset Editor description" - id="org.eclipse.ui.editor.reset" - name="Reset Editor"> + description="%command.editorReset.description" + id="org.eclipse.ui.ide.editorReset" + name="%command.editorReset.name"> </command> </extension> where the removed section here looks like your original test code. One way to get into a good state would be to rebase your fix onto origin/master and then squash your commit, or in EGit use 'git reset --soft origin/master' and then create a new commit (which will contain only the changes to get to your final state from master). Also, when you get your new commit consider using Gerrit on eclipse.platform.ui. http://wiki.eclipse.org/Gerrit#Doing_Code_Reviews_with_Gerrit is a good link to get started. PW
Oh I'm sorry. I'm still struggling with GIT... Didn't even know I ever did a commit. Seems like there are some explanations for Gerrit in the Wiki and they are all a bit different. Have to give it a closer look.
I like to config these 2 properties (I've configured SSH keys, so that's what I use for my review.url) git config remote.review.url ssh://pwebster@git.eclipse.org:29418/platform/eclipse.platform.ui git config remote.review.push HEAD:refs/for/master Then if you're using EGit, you would do your work against master, and when you create your commit use the Git Staging view toolbar to add a Change-Id footer. Then you use 'Push...' and select the "review" remote to push. When you push, it will create a changeset on gerrit and return a URL in the dialog (like https://git.eclipse.org/r/#/c/10749/ ) that you can paste into the bug. You can use Show In>History on your git repository to make sure your history only includes one commit against master. PW
We have not received any update here in a while. I mark that as WONTFIX, please reopen if you intend to work on this with a Gerrit review.