From bd9e6617827818fd043452c08c606f07b78014a0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- doc/umbrello/code_import_and_generation.docbook | 170 ++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 doc/umbrello/code_import_and_generation.docbook (limited to 'doc/umbrello/code_import_and_generation.docbook') diff --git a/doc/umbrello/code_import_and_generation.docbook b/doc/umbrello/code_import_and_generation.docbook new file mode 100644 index 00000000..8beffcc3 --- /dev/null +++ b/doc/umbrello/code_import_and_generation.docbook @@ -0,0 +1,170 @@ + +Code Import and Code Generation + +&umbrello; is a ¨ modelling tool, and as such its main purpose is to help you in the +analysis and design of your systems. However, to make the transition +between your design and your implementation, &umbrello; allows you to +generate source code in different programming languages to get you started. Also, if you +want to start using ¨ in an already started C++ project, &umbrello; can help you create a model +of your system from the source code by analysing your source code and importing the classes +found in it. + + +Code Generation + +&umbrello; can generate source code for various programming languages based on your ¨ Model +to help you get started with the implementation of your project. The code generated consists +of the class declarations, with their methods and attributes so you can fill in the +blanks by providing the functionality of your classes' operations. + + +&umbrello; 1.2 comes with code generation support for ActionScript, Ada, C++, CORBA IDL, &Java;, JavaScript, PHP, Perl, Python, SQL and XMLSchema. + + +Generating Code + +In order to generate code with &umbrello;, you first need to create or load a Model +containing at least one class. When you are ready to start writing some code, select the +Code Generation Wizard entry from the Code menu to +start a wizard which will guide you trough the code generation process. + + +The first step is to select the classes for which you want to generate source code. +By default all the classes of your model are selected, and you can remove the ones +for which you do not want to generate code by moving them to the left-hand side list. + + +The next step of the wizard allows you to modify the parameters the Code Generator uses +while writing your code. The following options are available: + + + +Code Generation Options + + + + + + Options for the Code Generation in &umbrello; + + + Options for the Code Generation in &umbrello; + + + + + + +Generation Options + + + +Code Verbosity + +The option Write documentation comments even if empty instructs the + Code Generator to write comments of the /** blah */ style even if the comment blocks are empty. +If you added documentation to your classes, methods or attributes in your Model, the +Code Generator will write these comments as Doxygen documentation regardless of what you set here, but +if you select this option &umbrello; will write comment blocks for all classes, methods and attributes +even if there is no documentation in the Model, in which case you should document your classes +later directly in the source code. + + +Write comments for sections even if section is empty causes &umbrello; to write comments +in the source code to delimit the different sections of a class. For example public methods + or Attributes before the corresponding sections. If you select this option &umbrello; + will write comments for all sections of the class even if the section is empty. For example, + it would write a comment saying protected methods even if there are no protected + methods in your class. + + + +Folders + +Write all generated files to folder. Here you should select the folder +where you want &umbrello; to put the generated sources. + + +The Include heading files from folder option allows you to insert a +heading at the beginning of each generated file. Heading files can contain copyright or licensing + information and contain variables that are evaluated at generation time. You can take a look + at the template heading files shipped with &umbrello; to see how to use this variables for replacing + your name or the current date at generation time. + + + +Overwrite Policy + + +This option tells &umbrello; what to do if the file it wants to create already exists in +the destination folder. &umbrello; cannot modify existing source files, +so you have to choose between overwriting the existing file, skipping the generation of +that particular file or letting &umbrello; choose a different file name. If you choose the option +to use a different name, &umbrello; will add a suffix to the file name. + + + +Language + +&umbrello; will by default generate code in the language you have selected as Active Language, but +with the Code Generation Wizard you have the option to change this to another language. + + + + +Generation Wizard Generation + +The third and last step of the wizard shows the status of the Code Generation process. +You need only to click on the Generate button to get your classes written for you. + + +Note that the Options you select during the Code Generation Wizard are only valid for the current +generation. The next time you run the wizard you will need to re-select all the options +(your headings folder, overwrite policy, and so on). You can set the defaults used by &umbrello; +in the Code Generation section of the &umbrello; settings, available +at SettingsConfigure &umbrello;... + + +If you have set your Code Generation options to the right settings and want to generate +some code right away without going through the wizard, you can select the entire +Generate All Code from the Code menu. +This will generate code for all the classes in your Model using the current settings +(including Output Folder and Overwrite Policy, so use with care). + + + + + +Code Import + +&umbrello; can import source code from your existing projects to help you build Model of +your systems. &umbrello; 1.2 supports only C++ source code, but other languages +should be available in future versions. + + +To import classes into your Model, select the entry Import Classes... from +the Code menu. In the file dialog select the files containing the C++ +class declarations and press OK. The classes will be imported and you will find them as part of +your Model in the Tree View. Note that &umbrello; will not create any kind of Diagram for showing +your classes, they will only be imported into your Model so that you can use them later in any +diagram you want. + + + +Code Import + + + + + + Menu for importing source code in &umbrello; + + + Menu for importing source code in &umbrello; + + + + + + + -- cgit v1.2.1