java - why i can't access IPackageFragmentRoot? -


i'll try develop plugins. so, i'm studying plugins , listeners. , try develop examples using listener , javamodel. however, when access ipackagefragmentroot element, not doing want. so, debugged it. then, see ijavaproject element not open! still can access project in eclipse.

what's wrong in code? , how can access in ipackagefragmentroot?

these examples not open states.

project

pacakage

this code snippet. currentproject iproject selected in package explorer.

if (currentproject != null) {     try {         currentproject.open(new nullprogressmonitor());     } catch (coreexception e) {         e.printstacktrace();     }     ijavaproject javaproject = javacore.create(currentproject);     projecttreenode root = createtreenode(javaproject.getelementname());     ipackagefragmentroot srcfolder = javaproject.getpackagefragmentroot("src");     root = getcontents(srcfolder, root);     setinput(root); } 

add

i imported projects in new workspace.

enter image description here

is wrong way??

i assume using 'run eclipse application' run , test plugin.

when run plugin eclipse starts new instance of eclipse new workspace. none of existing code present in workspace. must create new projects containing projects want test in new workspace.


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

javascript - Why Selenium can't find an element that is graphically visible -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -