Tuesday, 15 June 2010

eclipse - adding annotations to file outside workspace -


I need to show comments on files outside the workspace.

I am able to show annotations on files in presentspace when I try to do this for files outside the workspace, then I need to create resources and the Eiffel object. How do I get it? I am unable to create an eighth object, so I can read the contents of the file outside the workspace.

Here I am doing that now:

  wins IEditorPart editor = (IEditorpart) [ii] .getPartService (). GetActivePart () IEditorInput = Editor .getEditorInput (); Ipath path = ((FileEditorInput) input) .getPath (); IFile File = Vertical .getRoot (). GetFileForLocation (path);    

In case of bus you do not know, is not for files and projects < / Em> on the workspace on the file system under the workspace folder.


Maybe you can add it as a file in a workspace and as a resource. I do not think an external file that is converted into an internal file loses any behavior, It can be as much as you want, one that I can think of, that source control plug-ins can then detect it

Or, you can tell the user to add the file to the workspace. The benefits And make them choices. You may be able to show a dialog so that it can be asked whether the new or existing project / folder is where to add it. Of course, if they reject, then you should remember and not again about that external file Should ask.

Update:

FileStoreEditorInput represents a file that is not part of the current workspace. To listen to external files, subscribe to each window with an IPartListener2.

  Public Sky Actuator applies to Astrot UIU Lugin iTartup {@ Override Public Wide Start Startup} {Final Part Listener Part Listener} New Part Listener (); (Last IWorkbenchWindow Window: getWorkbench (). GetWorkbenchWindows ()) {window.getPartService (). AddPartListener (partListener); } GetWorkbench (). AddWindowListener (new IWindowListener () {@Override Public Zero Window Opened (IWorkbenchWindow Window) {window.getPartService (). AddPartListener (partListener);}}); } Private class part listener applies IPartListener2 {@Override Public Zero partOpened (last IWorkbenchPartReference partRef) {if (partRef.getPart (example) editor of the example) {Final editor page editor = (EditorPart) partRef.getPart (wrong); If (editor.getEditorInput () instanceof FileStoreEditorInput) {Final FileStoreEditorInput Input = (FileStoreEditorInput) editor.getEditorInput (); Println (input.getURI ()); }}}}    

No comments:

Post a Comment