jbushmaster007 / anyedittools

Automatically exported from code.google.com/p/anyedittools
Other
1 stars 0 forks source link

Browse selection object directory #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

In AnyEdit plugin we have "Open file under cursor" but not "Browse selected
object directory", especially in if the selection is in the Package or
Project explorer
(like in MyEclipse plugins)

There is a way in java to do so :

String selectedDir = From: *"com.x.y.A.ext"* To : *
"c:/programs/eclipse/ws/project/com/x/y"*
Desktop.getDesktop().open( new File(selectedDir) );

If the Plugin is compiled with java 1.4 version, there is a solution !
1. In youer eclipse project settings > java compiler > Compiler compilance
level : select 1.4

2. In your eclipse project settings > java build path > libraries : replace
the jdk/jre 1.4 by jdk/jre 1.5

3. In your java code of the action "Browse selection object directory",
make a test like :
System.getProperty("java.version").compareToIgnoreCase("1.4") > 0
if it is ok, this mean that the java.awt.Desktop.class, and all its friends
classes, exists and the call mustn't throw any exception

Original issue reported on code.google.com by BerradaE...@gmail.com on 22 Jul 2009 at 12:24

GoogleCodeExporter commented 8 years ago
It is doable of course, but it is not so simply as you think. You have also to 
made 
the action invisible (I do not like always disabled actions)...

Thank you for your idea!

Regards,
Andrei

Original comment by iloveeclipse on 20 Aug 2009 at 5:18