Skip to content

Instantly share code, notes, and snippets.

@anshumanatri
Created March 9, 2009 09:14
Show Gist options
  • Save anshumanatri/76185 to your computer and use it in GitHub Desktop.
Save anshumanatri/76185 to your computer and use it in GitHub Desktop.
public class CustomFlexProjectWizard extends FlexProjectWizard
{
//override to add custom stuff.
@Override
public boolean performFinish()
{
boolean retSuper = super.performFinish();
addSomeStuff();
return retSuper;
}
//open the main.mxml file created and add the necessary contents.
private void addSomeStuff()
{
try
{
IPath path = getCurrentProjectLocation();
path = getMainFilePath();
File f = path.toFile();
PrintWriter pr = new PrintWriter(f);
pr.write(str);
pr.flush();
pr.close();
this.project.getMainApplication().refreshLocal(0, null);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
String str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<mx:Application xmlns:mx=\"http://www.adobe.com/2006/mxml\"" +
"layout=\"absolute\">\n" +
"<mx:Label text=\"Hello Polestar\"/>\n" +
"</mx:Application>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment