|
|
|
|
Re: Display HTML file in EditorPart [message #870162 is a reply to message #869755] |
Mon, 07 May 2012 01:46  |
Eclipse User |
|
|
|
I got a workaround to this problem. First I'm scanning the list of all available Editors and then selecting the Web Browser from that list. I'm using the following code:
IEditorDescriptor[] desc_arr = PlatformUI.getWorkbench().getEditorRegistry().getEditors(input.getName());
String descID = "";
for(int i=0; i<desc_arr.length; i++) {
if(desc_arr[i].getLabel().equalsIgnoreCase("Web Browser")) {
descID = desc_arr[i].getId();
break;
}
}
if(descID == "") //Open using default Editor
IDE.openEditor(page, input);
else
IDE.openEditor(page, input, descID);
Is there any better way of doing it?
Regards,
-Alok
|
|
|
Powered by
FUDForum. Page generated in 0.12666 seconds