Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] Interpreter preferences not saved. How to add an interpreter in code?

Hi all,

I have an interpreter type and I want to create an interpreter that is
the default one when one starts my eclipse plugin. I have this code to
create it:

			InterpreterStandin install = new InterpreterStandin(new MyInstallType(), id);
			install.setInstallLocation(installLocation);
			install.setName("My Interpreter");
			install.setInterpreterArgs(null);
			LibraryLocation lib = new LibraryLocation(installLocation.getFullPath());
			install.setLibraryLocations(new LibraryLocation[] { lib });

			ScriptRuntime.setDefaultInterpreterInstall(coreSdk, null, true);

I have this code in my DebugUIPlugin.start(). Because this code is
executed before the MyInstallType class is loaded by DLTK (becuase of
the plugin.xml configuration) I have to put the following line of code
in the beggining:

			IInterpreterInstall install =
ScriptRuntime.getDefaultInterpreterInstall(entry);

Now in code, I can get my default interpreter, but this does not
appear in the Interpreters dialog and are not saved either in the
ScriptRuntime preferences (I passed true to the third param of
setDefaultInterpreterInstall). The following calls don't help either:

			ScriptRuntime.fireInterpreterAdded(install);
			ScriptRuntime.saveInterpreterConfiguration();
			ScriptRuntime.savePreferences();


Any ideas? Am I missing somthing? Is there a better place to write my
code rather than the plugin.start() method?

Thanks!

-- 
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034


Back to the top