Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Open Java Editor in RCP
Open Java Editor in RCP [message #519845] Wed, 10 March 2010 03:28 Go to next message
Eclipse UserFriend
I am new with Eclipse. I want to open a Java Editor in RCP.
Here are my code:
IWorkbenchPage page = getViewSite().getWorkbenchWindow().getActivePage();
IPath location= new Path("C:\\Alert.java");
page.openEditor(new PathEditorInput(location), "org.eclipse.jdt.ui.CompilationUnitEditor");

It shows only "ERROR" text on the screen. I have already added "org.eclipse.jdt.ui" as dependency. Can anyone help me to find out the problems?

Thanks.
Terris
Re: Open Java Editor in RCP [message #522004 is a reply to message #519845] Fri, 19 March 2010 11:27 Go to previous message
Eclipse UserFriend
Terris wrote:
> I am new with Eclipse. I want to open a Java Editor in RCP.
> Here are my code:
> IWorkbenchPage page = getViewSite().getWorkbenchWindow().getActivePage();
> IPath location= new Path("C:\\Alert.java");
> page.openEditor(new PathEditorInput(location),
> "org.eclipse.jdt.ui.CompilationUnitEditor");
> It shows only "ERROR" text on the screen. I have already added
> "org.eclipse.jdt.ui" as dependency. Can anyone help me to find out the
> problems?
I suggest you use
org.eclipse.ui.ide.IDE.openEditorOnFileStore(IWorkbenchPage, IFileStore)

Dani
>
> Thanks.
> Terris
Previous Topic:How to limit the depth of .project file searching when importing projects
Next Topic:eclipse.incrementalBuild does nothing in headless build
Goto Forum:
  


Current Time: Fri Mar 21 16:18:21 EDT 2025

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

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

Back to the top