Hi Shovik,

There is a way to open Java editor if you have pattern (something like
"package.class" or "package.class.method") in profiling and logging
environment.

Try to use following method:
openSource(String pattern, int javaType, IJavaSearchScope searchScope,
boolean switchToJavaPerspective)
of the class OpenJavaSource is located in
org.eclipse.hyades.ui.internal.util package.

Example:

...
import org.eclipse.hyades.ui.internal.util.OpenJavaSource;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.SearchEngine;
...
String pattern = "mypackage.MyClass.doSomething";
int javaType = IJavaSearchConstants.METHOD;
OpenJavaSource.openSource(pattern, javaType,
SearchEngine.createWorkspaceScope(), true);
...

The function will switch to Java Perspective, open MyClass.java and jump
to doSomething method of that class if it exists.


Thanks,
Ruslan.

>-----Original Message-----
>From: [EMAIL PROTECTED]
[mailto:tptp-
>[EMAIL PROTECTED] On Behalf Of shovikb
>Sent: Wednesday, May 16, 2007 1:06 PM
>To: tptp-tracing-profiling-tools-dev@eclipse.org
>Subject: [tptp-tracing-profiling-tools-dev] opening an editor in
>loggingpersp
>
>
>Hi,
>Im a newbie and i am facing some problems.I need to open a java editor
in
>the profiling and logging perspective where i want to display some java
>code.I cant figure out how to do it.IDE.openEditor(...) doesnt work
here i
>guess.Im not having too much luck with IWorkBenchPage.openEditor(...)
as
>well.Can nayone help out?
>
>Shovik.
>
>--
>View this message in context:
http://www.nabble.com/opening-an-editor-in-
>logging-persp-tf3762666.html#a10635959
>Sent from the Eclipse - Tracing and Profiling Tools - Dev mailing list
>archive at Nabble.com.
>
>_______________________________________________
>tptp-tracing-profiling-tools-dev mailing list
>tptp-tracing-profiling-tools-dev@eclipse.org
>https://dev.eclipse.org/mailman/listinfo/tptp-tracing-profiling-tools-d
ev
_______________________________________________
tptp-tracing-profiling-tools-dev mailing list
tptp-tracing-profiling-tools-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/tptp-tracing-profiling-tools-dev

Reply via email to