Community
Participate
Working Groups
UnassociatedEditorStrategyRegistry should not be static. See org.eclipse.ui.internal.registry.EditorRegistry as an example. Currently the registry is read each time one opens an editor.
So we should create a WorkbenchPlugin.getDefault().getUnassociatedFilesStrategyRegistry() method ?
(In reply to Mickael Istria from comment #1) > So we should create a > WorkbenchPlugin.getDefault().getUnassociatedFilesStrategyRegistry() method ? I would even think about putting the code into the existing editor registry.
(In reply to Dani Megert from comment #2) > (In reply to Mickael Istria from comment #1) > > So we should create a > > WorkbenchPlugin.getDefault().getUnassociatedFilesStrategyRegistry() method ? > > I would even think about putting the code into the existing editor registry. I like this proposal. I'll try that.
(In reply to Dani Megert from comment #2) > (In reply to Mickael Istria from comment #1) > > So we should create a > > WorkbenchPlugin.getDefault().getUnassociatedFilesStrategyRegistry() method ? > > I would even think about putting the code into the existing editor registry. Unassociated editor strategy is currently in org.eclipse.ui.ide (where the IDE.openEditor classes are), and EditorRegistry is currently in org.eclipse.ui.workbench. Should I move it and the extension point definition to org.eclipse.ui.workbench then?
(In reply to Mickael Istria from comment #4) > (In reply to Dani Megert from comment #2) > > (In reply to Mickael Istria from comment #1) > > > So we should create a > > > WorkbenchPlugin.getDefault().getUnassociatedFilesStrategyRegistry() method ? > > > > I would even think about putting the code into the existing editor registry. > > Unassociated editor strategy is currently in org.eclipse.ui.ide (where the > IDE.openEditor classes are), and EditorRegistry is currently in > org.eclipse.ui.workbench. > > Should I move it and the extension point definition to > org.eclipse.ui.workbench then? Uh oh. No. In that case leave it where it is.
What about accessing it as a (private static) field of the IDE class then?
(In reply to Mickael Istria from comment #6) > What about accessing it as a (private static) field of the IDE class then? *it* == ?
(In reply to Dani Megert from comment #7) > *it* == ? Sorry for the lack of context, let me try to state something more "stateless". What about adding a (private static) "unassociatedEditorRegistry" field to the IDE class, removing the "static" field on methods, and access them inside the IDE class by dereferencing the unassociatedEditorRegistry field?
(In reply to Mickael Istria from comment #8) > (In reply to Dani Megert from comment #7) > > *it* == ? > Sorry for the lack of context, let me try to state something more > "stateless". > > What about adding a (private static) "unassociatedEditorRegistry" field to > the IDE class static is static ;-). The registry has to be an instance/field of the plug-in instance.
New Gerrit change created: https://git.eclipse.org/r/67745
Gerrit change https://git.eclipse.org/r/67745 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7a96414a097129f863ff053184ab33a679467890