Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Mandatory snippet variable values?
Mandatory snippet variable values? [message #171511] Fri, 16 June 2006 20:37 Go to next message
Malcom Zung is currently offline Malcom ZungFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

Is there a way to have the Snippets view variable replacement dialog issue
a warning or error if the user does not fill in a value for a Snippet
variable? What we'd like to create are essentially mandatory variables
that the user must fill in before the Snippet can be inserted into the
editor.

I've looked at the following classes but don't see an easy way to do this
from my plugin.

DefaultSnippetInsertion
VariableItemHelper
VariableInsertionDialog

Any help would be appreciated.

Malcom Zung
IBM Toronto Lab
Re: Mandatory snippet variable values? [message #171526 is a reply to message #171511] Fri, 16 June 2006 21:14 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2341
Registered: July 2009
Senior Member
Malcom Zung wrote:
> Is there a way to have the Snippets view variable replacement dialog
> issue a warning or error if the user does not fill in a value for a
> Snippet variable? What we'd like to create are essentially mandatory
> variables that the user must fill in before the Snippet can be inserted
> into the editor.

No, there is no support for declaring a variable as being required.
The extension point does allow you to specify a default value,
though, so that barring the user clearing it, a value will be
present. If that isn't enough, you'll need to either subclass the
DefaultSnippetInsertion dialog to provide a UI that enforces that,
or open a feature request:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Web%20To ols&component=wst.common&short_desc=[snippets]


--
- Nitin


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Mandatory snippet variable values? [message #171604 is a reply to message #171526] Mon, 19 June 2006 14:40 Go to previous message
Malcom Zung is currently offline Malcom ZungFriend
Messages: 2
Registered: July 2009
Junior Member
Nitin,

Thanks for the reply, I've opened an enhancement in Bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=147723

Malcom.
Previous Topic:EAR LIbrary container
Next Topic:anyone use Code Generator Wizard - eclipse Plug-in
Goto Forum:
  


Current Time: Fri Dec 19 17:39:03 GMT 2014

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

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