You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.5 KiB
77 lines
2.5 KiB
15 years ago
|
/** \class FileCreatePart
|
||
|
FileCreatePart is a template manager and wizard system to assist with creation of new files.
|
||
|
|
||
|
Assists with creation of new files.
|
||
|
|
||
|
For those who want to look beyond the GUI, the following illustrates the XML to configure the FileCreate part for a project. It simply consists of a list of filetypes that the user may wish to create for a particular project. At present, the "create" attribute is ignored.
|
||
|
|
||
|
The file create part looks for a file template called \@ext (i.e. the value of the ext attribute) in the *project's* templates directory (see the PyQT appwizard template for an example).
|
||
|
|
||
|
For subtypes, it looks for a template called \@ext-\@ref, so in the example below the following files would need to be present in the project's templates directory:
|
||
|
|
||
|
<code>
|
||
|
py
|
||
|
ui
|
||
|
ui-dialog
|
||
|
ui-mainwin
|
||
|
</code>
|
||
|
|
||
|
Example XML:
|
||
|
|
||
|
<code>
|
||
|
\verbatim
|
||
|
<kdevfilecreate>
|
||
|
<filetypes>
|
||
|
<type ext="py" name="Python" create="template"/>
|
||
|
<type ext="ui" name="QT Designer" create="template">
|
||
|
<subtype ref="dialog" name="Dialog"/>
|
||
|
<subtype ref="mainwin" name="Main window"/>
|
||
|
</type>
|
||
|
</filetypes>
|
||
|
</kdevfilecreate>
|
||
|
\endverbatim
|
||
|
</code>
|
||
|
|
||
|
You can also use global template definitions supplied with the FileCreate part:
|
||
|
|
||
|
<code>
|
||
|
\verbatim
|
||
|
<kdevfilecreate>
|
||
|
<useglobaltypes>
|
||
|
<type ext="ui" />
|
||
|
</useglobaltypes>
|
||
|
<filetypes>
|
||
|
<type ext="py" name="Python" create="template"/>
|
||
|
</filetypes>
|
||
|
</kdevfilecreate>
|
||
|
\endverbatim
|
||
|
</code>
|
||
|
|
||
|
If a type has subtypes, and no subtypes are specified, then all subtypes are assumed to be required (as in the example above). Otherwise, specific subtypes should be specified:
|
||
|
|
||
|
<code>
|
||
|
\verbatim
|
||
|
<useglobaltypes>
|
||
|
<type ext="ui">
|
||
|
<subtype ref="dialog"/>
|
||
|
</type>
|
||
|
</useglobaltypes>
|
||
|
\endverbatim
|
||
|
</code>
|
||
|
|
||
|
Usually, this XML forms part of the base .kdevelop file created by the appwizard.
|
||
|
|
||
|
\authors <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
|
||
|
\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
|
||
|
|
||
|
\maintainer <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
|
||
|
|
||
|
\feature friendly sidebar listing the types of new file that can be created for your project
|
||
|
\feature configurable per-project file types and global file types
|
||
|
|
||
|
\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=file+create&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">file create component at Bugzilla database</a>
|
||
|
\bug Arrangement of text in sidebar is not always perfect
|
||
|
|
||
|
|
||
|
*/
|