Skip to content

Commit

Permalink
498553: Editors available on marketplace dialog ignores "do not ask m…
Browse files Browse the repository at this point in the history
…e again"

Workaround for platform bug 502514: Don't persist association to system
editors

Bug: 498553
Change-Id: I17b120e117c6094c753008b49abb8c8582af8d3f
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=498553
See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=502514
  • Loading branch information
creckord committed Oct 5, 2016
1 parent 10c65c7 commit 0c9520a
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -93,7 +93,9 @@ public IStatus runInUIThread(IProgressMonitor monitor) {
.getMarketplaceClientService();
IMarketplaceClientConfiguration config = marketplaceClientService.newConfiguration();
marketplaceClientService.open(config, new LinkedHashSet<INode>(nodes));
} else if (dialog.isAssociateToExtension()) {
} else if (dialog.isAssociateToExtension() &&
// FIXME bug 498553: workaround for platform bug 502514 - persisting system editor association leads to NPE
res.isInternal() && !AskMarketPlaceForFileSupportStrategy.isSystem(res.getId())) {
List<String> extensions = new ArrayList<String>(1);
extensions.add(fileExtension);
// need internal API:
Expand All @@ -112,6 +114,7 @@ public IStatus runInUIThread(IProgressMonitor monitor) {
newMapping.setDefaultEditor(res);
mappings[mappings.length - 1] = newMapping;
((EditorRegistry) editorRegistry).setFileEditorMappings(mappings);

((EditorRegistry) editorRegistry).saveAssociations();
}
return Status.OK_STATUS;
Expand Down Expand Up @@ -141,4 +144,8 @@ public Display getDisplay() {
return res;
}

private static boolean isSystem(String id) {
return IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID.equals(id)
|| IEditorRegistry.SYSTEM_INPLACE_EDITOR_ID.equals(id);
}
}

0 comments on commit 0c9520a

Please sign in to comment.