Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Dynamic web projects
Dynamic web projects [message #212774] Tue, 22 April 2008 08:32 Go to next message
Klaus Schaefers is currently offline Klaus SchaefersFriend
Messages: 24
Registered: July 2009
Junior Member
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 #212846 is a reply to message #212774] Wed, 23 April 2008 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_whiteman.us.ibm.com

Klausen wrote:
> 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
>

Do you want to programmatically generate a dynamic web project? If so
you can use ProjectFacetsManager.create() to create the project, the
getProjectFacet() method to get the facet, and
IFacetedProject.installProjectFacet() to install it.

If you are just wanting to add special behavior to existing dynamic web
projects for generating HTML files, then you can build your own facet
using the framework. See the following article:
http://www.eclipse.org/articles/Article-BuildingProjectFacet s/tutorial.html

HTH,
David
Re: Dynamic web projects [message #212854 is a reply to message #212774] Wed, 23 April 2008 19:17 Go to previous message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
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();
}
Previous Topic:Re: Which version of JSDoc is supported ? | eclipse.webtools split ?
Next Topic:Need to launch the "Generate Java Bean Skeleton" Wizard
Goto Forum:
  


Current Time: Tue Apr 23 11:58:08 GMT 2024

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

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

Back to the top