'Eclipse , How to get the URI of a class

Class<?> clazz = IWorkbench.class ;

I wonder if there is any API that can help me get the URI of class , This URI is used to open an editor

tried to make my own URL and succeeded, but I still want to use the eclipse API

public static IEditorPart openClassInEditorFromURI(URI uri) {
    IWorkbenchPage page = BitFanUI.getLastActivateWindow().getActivePage() ;
    if( page == null ) {
        return null ;
    }
    try {
        IFileStore fileStore = EFS.getStore( uri ) ;
        return IDE.openEditorOnFileStore(page, fileStore);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null ;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source