Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Programmatically close a Java file?
Programmatically close a Java file? [message #1065168] Mon, 24 June 2013 10:55 Go to next message
Eclipse UserFriend
When several java files are open in the Java editor and a user deletes one of these files in the Package Explorer, "Eclipse" removes the deleted java file from the java editor. How can I do this programmatically?

Thank you for your help.

(P.S. I posted a similar question the Newcomers forum. I hope that it is not too redundant to ask again here.)
Re: Programmatically close a Java file? [message #1065173 is a reply to message #1065168] Mon, 24 June 2013 11:12 Go to previous messageGo to next message
Eclipse UserFriend
Do you want an editor you've implemented yourself to behave this way?
It's generally done by using a workspace listener in your editor:

ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener,
IResourceChangeEvent.POST_CHANGE);



On 24/06/2013 4:55 PM, Eclipse Explorer wrote:
> When several java files are open in the Java editor and a user deletes
> one of these files in the Package Explorer, "Eclipse" removes the
> deleted java file from the java editor. How can I do this
> programmatically?
>
> Thank you for your help.
>
> (P.S. I posted a similar question the Newcomers forum. I hope that it
> is not too redundant to ask again here.)
Re: Programmatically close a Java file? [message #1065177 is a reply to message #1065173] Mon, 24 June 2013 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

Yes, I've extended org.eclipse.ui.editors.text.TextEditor.

Thank you for your help.
Re: Programmatically close a Java file? [message #1065257 is a reply to message #1065177] Tue, 25 June 2013 02:46 Go to previous message
Eclipse UserFriend
In EMF's generated editors we use a listener. You could look at the
source code:

http://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.ecore.editor/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java


On 24/06/2013 5:25 PM, Eclipse Explorer wrote:
> Hi Ed,
>
> Yes, I've extended org.eclipse.ui.editors.text.TextEditor.
>
> Thank you for your help.
Previous Topic:Getting compilation errors for a project over JDT markers produces wrong result initially
Next Topic:Java Content Assist in a Wizard
Goto Forum:
  


Current Time: Fri Jul 04 02:24:47 EDT 2025

Powered by FUDForum. Page generated in 0.12026 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top