Dynamic web projects [message #212774] |
Tue, 22 April 2008 04:32  |
Eclipse User |
|
|
|
Hi,
I need to program a plugin that generates a HTML file. The HTML file
should be stored in a dynamic web project. Before the generation starts,
the user should be able to select an existing dynamic web project and
create a new one.This leads me to my two questoins:
1) How can I determine if a project a a dynamic webproject? Which natures
/ facets must be installed?
2) How can I call the "Create Dynamic Web Project" wizard? I could not fin
dthe class.
Thanks a lot,
Klaus
|
|
|
|
Re: Dynamic web projects [message #212854 is a reply to message #212774] |
Wed, 23 April 2008 15:17  |
Eclipse User |
|
|
|
I liked the idea of just launching the wizard when people need to create
a new web project. That way, I can't 'forget' any required tasks.
Here's how I do it: (inputName is a String passed in by the user from a
previous dialog)
try{
WebProjectWizard wpw = new WebProjectWizard();
org.eclipse.wst.common.frameworks.datamodel.IDataModel dm =
wpw.getDataModel();
dm.setProperty("IProjectCreationPropertiesNew.PROJECT_NAME", inputName);
dm.setProperty(" IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAM E ",inputName+"EAR");
final Listener l = new Listener () {
public void handleEvent (Event event) {
WSDLTool.confirmedSetProject(projectName);
}
};
WizardDialog dialog = new WizardDialog(shell, wpw) {
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Button finishButton = getButton(IDialogConstants.FINISH_ID);
finishButton.setText(IDialogConstants.OK_LABEL);
finishButton.addListener(SWT.Selection,l);
}
};
dialog.open();
}
catch(Exception e){
e.printStackTrace();
}
|
|
|
Powered by
FUDForum. Page generated in 0.06278 seconds