Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to get Path of Editor in eclipse
icon4.gif  How to get Path of Editor in eclipse [message #1730045] Thu, 21 April 2016 07:09 Go to next message
Rahul Bhogavkar is currently offline Rahul BhogavkarFriend
Messages: 13
Registered: April 2016
Junior Member
How can I identify the specific path of an Editor in eclipse.
E.g. Eclipse has many editors such as Text-Editor, Code sample Editor
like wise I want to switch the things on DSL Editor when I click on my diagram elements.
Here is my code
try {
			if (((MouseEvent) operatingState).getClickCount() == 2) {
				String name = "";
				IPath path = new Path(name);
				IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
				FileEditorInput input = new FileEditorInput(file);

				IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
				page.openEditor(input, "bndtools.bndWorkspaceConfigEditor", true);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
Re: How to get Path of Editor in eclipse [message #1730594 is a reply to message #1730045] Wed, 27 April 2016 04:26 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

Where are you trying to do this? Do you have an open editor to work from, because the code you're showing opens an editor but doesn't show from what you're trying to get a path.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Where can I tweak this syntax highlighting (see image)
Next Topic:Where is it?
Goto Forum:
  


Current Time: Fri Apr 19 23:15:42 GMT 2024

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

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

Back to the top