Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to fire a install jre changed event programmatically?
How to fire a install jre changed event programmatically? [message #251051] Tue, 29 January 2008 03:02 Go to next message
Eclipse UserFriend
Hi, all:

I notice that if project A use workspace default JRE, e.g. jdk1.6.0._03, if
I change the workspace default JRE setting to, e.g jdk1.5.0_09, from
"Perference... -> Installed JREs", the project A's decoration was refreshed
as well, in fact,
org.eclipse.jdt.internal.launching.JREContainer#getClasspath Entries() was
invoked.

and now, I have my own class that implement the interface
org.eclipse.jdt.core.IClasspathContainer, and a preference page similar with
"Intalled JREs", so how can I fire a event programmatically that will invoke
my
IClasspathContainer#getClasspathEntries() and refresh the project
decoration?

Any Clue?

Thanks in advance & Best Regards!

Nick
Re: How to fire a install jre changed event programmatically? (Resolved) [message #251066 is a reply to message #251051] Tue, 29 January 2008 05:20 Go to previous message
Eclipse UserFriend
Hi, I find a way out, follow is code snippet:


public class ProfileContainerUpdater implements IRunnableWithProgress {

public void run(IProgressMonitor monitor) throws
InvocationTargetException,
InterruptedException {
IPath oldContainerPath = StipletCore
.getSTIPletContainerPath(PreferenceManager.DEFAULT_PROFILE);
IPath newContainerPath = StipletCore
.getSTIPletContainerPath(PreferenceManager.getDefaultProfile ()
.getName());
try {
IJavaProject[] projects = JavaCore.create(
ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
for (int i = 0; i < projects.length; i++) {
IJavaProject javaProject = projects[i];
if (javaProject.getProject().hasNature(
BlueToolsCoreConstants.STIPLET_NATURE_ID)) {
IClasspathContainer container = new StipetClasspathContainer(
javaProject, newContainerPath);
JavaCore.setClasspathContainer(oldContainerPath,
new IJavaProject[] {
javaProject
}, new IClasspathContainer[] {
container
}, monitor);
}
}
}
catch (CoreException e) {
throw new InvocationTargetException(e);
}
}
}



"Nick Tan" <missedone@gmail.com> 写入消息
news:fnmmi7$r7s$1@build.eclipse.org...
> Hi, all:
>
> I notice that if project A use workspace default JRE, e.g. jdk1.6.0._03,
> if
> I change the workspace default JRE setting to, e.g jdk1.5.0_09, from
> "Perference... -> Installed JREs", the project A's decoration was
> refreshed
> as well, in fact,
> org.eclipse.jdt.internal.launching.JREContainer#getClasspath Entries() was
> invoked.
>
> and now, I have my own class that implement the interface
> org.eclipse.jdt.core.IClasspathContainer, and a preference page similar
> with
> "Intalled JREs", so how can I fire a event programmatically that will
> invoke my
> IClasspathContainer#getClasspathEntries() and refresh the project
> decoration?
>
> Any Clue?
>
> Thanks in advance & Best Regards!
>
> Nick
>
>
Previous Topic:Extend Content Assist questions
Next Topic:Prevent Content Assist from executing, if only one hit is found
Goto Forum:
  


Current Time: Fri Apr 18 10:06:14 EDT 2025

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

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

Back to the top