Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » [Help] How to change the local of generated files
[Help] How to change the local of generated files [message #509247] Thu, 21 January 2010 18:58 Go to next message
Fabricio Pellegrini is currently offline Fabricio PellegriniFriend
Messages: 36
Registered: July 2009
Member
Hi,

I use the mofScript editor on my aplication calling IWorkbenchPage page; page.openEditor(file, "org.eclipse.mofscript.editor.MofScriptTextEditor");
but I need to change de default dir of generated files.

How should i do that?
Re: [Help] How to change the local of generated files [message #512629 is a reply to message #509247] Fri, 05 February 2010 16:49 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Fabricio,

Not sure if this is what you are asking for but here is the Java code for
setting the output.

If you have the output dir, look at the bottom line.

public void setRootDirectoryProperty (IFile file) {
String rootDir = null;
try {
rootDir = file.getPersistentProperty(new QualifiedName("",
MofScriptPropertyPage.OUTPUT_DIRECTORY_PROPERTY));
if (rootDir == null) {
rootDir =
MofScriptEditorPlugin.getDefault().getPreferenceString(MofSc riptPreferences.ROOT_DIRECTORY);
if (rootDir != null)
file.setPersistentProperty(new QualifiedName("",
MofScriptPropertyPage.OUTPUT_DIRECTORY_PROPERTY), rootDir);
}
} catch (CoreException xec) {
rootDir =
MofScriptEditorPlugin.getDefault().getPreferenceString(MofSc riptPreferences.ROOT_DIRECTORY);
}
if (rootDir != null && !rootDir.equals(""))
ExecutionManager.getExecutionManager().setRootDirectory(root Dir);
}


Cheers,
G
Previous Topic:[Help] How to change the local of generated files
Next Topic:Find the Target for a message
Goto Forum:
  


Current Time: Fri Nov 28 02:02:28 GMT 2014

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

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