Home

Forte for Java (Community Edition) User's Guide

image

Contents

1. 86 Javadoc oie Ga end Tam ER ete e ru e iP EL Fa ines abana ed Ta Ede e e sad cie RE 86 Pea M ET ee od aa M e E M TENET NE 86 Guide 16 the Object Browser odi caeteri e tea ix een FU NU AURA eco LEVE PU IA RN D PUER CETARR eas 86 Using the Object Browset coss debido da pdca ed ue re roe cu CHR del Led con RUE RENE A Us 88 Creatine AC RA Se INEST ua ea teta uae adco ens ord duros vt desta oen Rn adhe gio aps Dvd 89 Browsing and exploring objects and their elements eene 91 Elements of Java objects and member accessibility acero ord oen dede 92 Creating and modifying elements using the customizer esee 94 Source SvnchrontzafOH saos cvi o pO Ue pese WIRT UNS Ubi ea cta e Edi E E EERE 96 Source Synchronization property sh ctisisinis iiaa Grinder a leat iate bio 96 SVRCBEONIZIEE SQUE onus qoc comas eet canem Qu OR ed p edad ed UAR r dtt 96 Chapter 5 Developing and Customizing JavaBeans Components 98 Developing JavaBeans components esses eene eene enne nennen nnne nennen 98 Creatine DEODEEHOS ood anta c temas wR tme dunt eo ed esa OST ES 99 Creating indexed properties 5a acea eri tede bd rbd Pe a ld rta de oi aan Edi el nda a 100 Creatine event SeSi dete itte tet i ye Pt oe iiber ed Pv EA ES 101 ID Clete properties qtd evellt sels diotouitatbs b d bras devait Oo OR Pas aia Nites 103 Contents Genetratno Dean DEO oda ivan tad epu unde
2. Keyboard With no selected y With selected text shortcut text CTRL RIGHT Move the insertion point Deselect the text and one word to the right move the insertion point one wotd to the right CTRL LEFT Move the insertion point Deselect the text and one wotd to the left move the insertion point one wotd to the left CTRL SHIFT Create a text selection and Extend the selection one RIGHT extend it one word to the word to the right right CTRL SHIFT Create a text selection and Extend the selection one LEFT extend it one wotd to the wotd to the left left PgDown Move the insertion point Deselect the text and one page down move the insertion point one page down PgUp Move the insertion point Deselect the text and one page up move the insertion point one page up SHIFT Create a text selection and Extend the selection one PgDown extend it one page down page down SHIFT PeUp Create a text selection and Extend the selection one extend it one page up page up HOME Move the insertion point Deselect the text and to the beginning of the move the insertion point line to the beginning of the line END Move the insertion point Deselect the text and to the end of the line move the insertion point to the end of the line SHIFT HOME Create a text selection and Extend the selection to extend it to the beginning the beginning of the line of the line SHIFT END Create a text selection and Extend the selection to ex
3. sseeeese 150 R nning S PS voids dici deed d n Fn aaah CANNE RE dU I TOU di Fur eei Si Ferd Up a Ie er EL TEE 150 Specifying query patatetete ocsaso edem ect rct enel fid Fia qut pde pda nu Ed t ca 150 Restart the servet snidani cima dandam ae neun o Ue tanq etd 151 Configuring JSP Execution Lypes cuncodetee dia de reed ated tei e dei ripe ia iniii 151 Serre Eae web aT OW SER tenein ra eia caesa tera e Fein A venpacia fest Red 152 Chapter 8 Organizing work into projects cese 153 What is a project in Forte for TaydPaisoseteen eO see uei ea NON e aS DN ENTN ERR AN FIR EATNEK Y 153 Creating projects oerte ato USO RR Eei ETES SEC IR ID D UN RE EIE IR M COMNIS 154 Contents Je debo DEOIGCbun intus pao ned Flo o s ea rU ad EU reco Dad a a aiden 155 CHEATING ne EO OCLC a di esta spictiaicmstiie i tiet pd odores ep aie cd ueteri o ave AEN 155 Niki with FTO SC ES mo Orge os ted a den a tnc P za e Patet once 155 Adding packages and files to a project eene tentent R 156 Settiip the mam class inthe projeter as ero e Ir pE decet Seas eos tata enuia Cerei nEs rnEeE SSY 158 Accessing and working with files in projects eene nennen 158 Mounting different file systems for different projects ssssssssseseeeneeneteten 158 Compiling building executing and debugging projects sss 158 AdyjustingProject Settingsc uet te en rte a rere aie at bre an re es 159 TUI DD
4. 160 Switching between PrOjECts sssccassetsssssasssesoscnsssesssposastessbassadvasesaseaseasasasiasaasetanssodessvesoseordssobasoaessbandssetboss 160 Inpor ne pEoIecb So eatem ety b ate Sp Ret det ens 160 Chapter 9 Integrating a CVS version control system eene 162 How the CVS Support works is ein iri ep RE rra arr RU eU TU TIUS 163 Using the CVS module ust NEVER NER NER SERR NES RERRNR URN INTEUR RINT AT n YU NER NBC AREE S UAURVE 163 Betore VOU Depttiautisfabetba initia uat tit fa ier rativaleti biles ibo Feel Fo vetu ta isti uv vaa 163 Setting up the repository and working difecboty iode eiae ege ee a Era dR dd 164 Creattioa CVS projet earainn esie Na UP Vas P Fi AT aes i 164 CVS CODIEDATIGS ore bind Open POR pE e I va Om QU fex PNEU VR e se dau Va SEIN ORI eye HR TR ANN equ E US 166 Chapter 10 Searching and Creating Javadoc Documentation 168 Searching and browsing Javadoc csecisssisrcccisescesnsdarccccseseaacevaedasusaaenecsssvetecasaaecvcuasasieanedas 168 Preparing tbesBsplorer s Javadoc b ua Ag udbre esiti te ete den e e d diio 169 Browsing documentation for the selected class or element sss 170 Benrebine in Javadoc directores s na detulit RR M nak d NOR P RUP ERREUR M UE 170 SSA HE IMIG DOS acute deos a ibite dito a ta uud Dru ae aito Uif adio tetur tu s 171 Using Javadoc Auto COImnert i codes bodie ple E LEX Siess SUIS SR saad vondnn XR CO Yn E pul E TUER 172 Auto Comment Tool d
5. In the Project Settings window select Execution Types Applet Execution Applet Execution Click on the External Viewer property and type in the path and name of the browser ot applet viewer In the same custom property editor add any startup arguments that you require for the applet viewer To set up a viewer other than AppletViewer 1 2 3 Right click on Execution Types Applet Execution in the Explorer Choose New Applet Execution Service from the contextual menu A new node labelled Applet Execution with a number in parentheses to give it a unique name will appear You can select the node and modify its Identifying Name property Follow steps 2 through 4 from the procedure for changing the default applet viewer You can now use this new executor for particular objects 57 Chapter 3 Developing Java Applications Debugging Java classes The Debugger can be used to present snapshots of the system state during execution By placing breakpoints at key positions throughout your source code the Debugger can halt at these points and display details of the current environment at that point in the source You can effectively step through your code monitoring execution as it occurs You can also connect the debugger to an already running process Debugger Window The Debugger Window is a three tabbed display with tabs for Breakpoints Threads and Watches In the right half of
6. s sssssssssssssscssessssenssseessscossscvescossss 288 Colo BOHOEP EAE T Uie toas vibe eso EOE EE A TE ATI E L ETT 288 E ORCS Editot i ieu Poi Uum alid aiuti eq OR DENN A QE FCU B MM Iq Dr timate mE Deci 289 Border EIE rini eon E ena be IU URINE PURA FIRE TINER RUNS PA ART URP eNe QUE CN TRU Ct RR 289 Cutsoft Editor ee re e E Ye PORE HR ARR FARINAM ERR AA REEF RES VER EIE RE E 290 String EditoE aide ona cotene sansa tes canta E in t epron ia bed e dem obe Fea b UR 290 Icon BAUGGE quM ccnaedvnnsaauvevadadussccdudusdsisadetsuavessadsddheeddas a i i e 290 Dim enston Editor i vue Dra UO EPOR APP pA EEEE E A EDE EE at 290 Bounds BIIOE essersi oerein pides eUP deb vis EE P uE P uar SN E MUR Ma iQ RP RVA SS ETENEE 290 ASCE SUS INGOT caduta ter thus ant nantes daa ua gt ui EAE 291 Modifiers Editor osi ode Dead coop E E diver pi a ER E DEC EE DNE E Ane A ERE CVM IR 291 Paramete rs BEOIOE coeur eme n ee e ie ax uiis t eei vs 291 Exceptions EdHtor uos te RAMUS SANE BARON INN GAS LUE M NEU Ed E DR E UP ANT EUR V elie 292 12 Contents Error Expression Ei toro eei onore eer HEN SI RAN RSEN EUN IA SI CUPS RISE S EA VENE TURA NET Oed vee Customizer dialog DO ooo esten ined ue etreeolegt eh emere o da alga 13 Preface This book describes how to develop with and customize Forte for Java Community Edition This document is intended for software engineers who implement Java applications and applets with Forte for Java Community Ed
7. Appendix B Default Editor Abbreviations e Expands To pgin lt page info peit lt page isThreadSafe pel lt page language pgs lt page session tg request getParameter sg session getValue sp session putValue st session removeValue telb lt taglib uri 245 Appendix C Main Window Menus and Toolbars Menus The following sections provide lists and short descriptions each of the entries on the Main Window menus File Menu New From Template create a new object The Templates folder will open enabling a predefined template to be used as the basis for the new object Available template categories are AWT Forms Classes Dialogs Other and Swing Forms See Using templates on page 200 for more information on templates Open Explorer open a new Explorer window Appendix C Main Window Menus and Toolbars Object Browser open the Object Browser window OpenFile open a file that is currently in the IDE or mount a file system to the IDE and open a file in it e Sae save the current object If there is more than one object currently open in the multi tab Editor window the source in the currently selected tab is saved If there is more than one Editor window open that is one or more sources have been undocked the object in the currently selected Editor is saved Save is disabled when no modified objec
8. Connect connect the Debugger to an already running process 249 Appendix C Main Window Menus and Toolbars Finish Debugging end the current debugging session e Suspend All Suspend all threads in the Debugger e Trecelnto trace into the method the debugger has halted at Go To Cursor execute the current statement and all ensuing statements until it reaches the line that the insertion point is on e Trace Over trace over the method the debugger has halted at Step Out halt execution after the current method finishes and control passes to the caller Add Remove Breakpoint switch a breakpoint on or off at the current line The line will be highlighted in blue when a breakpoint is set e New Breakpoint add a new breakpoint A dialog will appear prompting you to type where it should it be set Add Watch watch a variable Debugger Window open the Debugger Window Resume All Resume debugging of all threads in the Debugger Tools Menu Add Directory mount a new directory under the Filesystems tab in the Explorer Add JAR mount a new JAR archive as a file system under the Filesystems tab in the Explorer Remove Filesystem unmount the selected file system from the Explorer JSP Wizard run a wizard to create a Java Server Page e Search Filesystems search for a file in a file system mounted in the Explorer by file name
9. Using the Event ListenerList support class from the javax swing event package 4 Follow steps 4 and 5 in the procedure for adding unicast events Deleting properties and event sets Properties and event sets can be easily deleted from classes using the Explorer or Object Browset To delete a property or event set using the Explorer 1 Navigate to the property s node under the class s Bean Patterns node in the Explorer 2 Right click the property and choose Delete from the contextual menu To delete a property or event set using the Object Browser 1 Open the Object Browser select the package in the Packages pane and the object Objects pane 2 Select the Bean filter in the Members pane to display the members as bean properties and event sets 3 Inthe Members pane right click the property or event set and choose Delete from the contextual menu Generating Bean Info A BeanInfo class contains information about the JavaBeans component such as properties event sets and methods BeanInfo is an optional class and you can choose what information will be included in it In BeanInfo you can also specify additional properties of the JavaBeans properties and BeanInfo including icons display names and so on By default all superclass beaninfo public properties and event sets are included in BeanInfo permitting customization of various attributes and all public methods are discovered by introspection 10
10. Default Editor Abbreviations on page 241 For information on changing or adding abbreviations see Customizing Editor abbreviations on page 211 Compiling JSPs Once you have edited your JSP file you can validate it by compiling it into a class file The compilation proceeds in two stages First the JSP page is translated into a servlet Then the servlet is compiled into a class file To compile a JSP 0 Right click on the JSP file in the Explorer or Object Browser and choose Compile from the contextual menu Handling compilation errors Any compilation errors encountered in either of these stages are displayed in the compiler Output Window If the translation to servlet succeeds you can view the servlet source to better identify and analyze any errors which may have occured in the second stage To analyze servlet source for compilation errors Right click on the JSP file in the Explorer or Object Browser and choose View servlet from the contextual menu The Editor window will appear with the servlet code displayed Once you determine the error you can fix it in the JSP page The servlet itself may not be modified since it will be regenerated the next time you compile the JSP 149 Chapter 7 Developing Java Server Pages Selecting a compiler You can choose which compiler to use for compiling the servlet into a class To select a compiler for the JSP O In the file s property sheet select the Execution tab sel
11. executes the project by executing the main class If necessary the project is first compiled You can also set the default compiler executor or debugger for the whole project in the Projects Settings window on the property sheet for Java Sources See Adjusting Project Settings below Adjusting Project Settings You can save a unique configuration of Project Settings for each project you have created When you open a project the IDE is automatically reconfigured to the state it was in when you last saved that project When you close the IDE any changes you have made to Project Settings during the session will be saved to the current project Important Whenever you change Project Settings it only affects the current project Howevet if you subsequently create a new project it will start with the default Project Settings To adjust any of the Project Settings for a project 1 Open up the Project Settings window by choosing Project Settings from the main menu 2 Select the node you want to change in the left pane and then adjust the properties you wish to change in the right pane Project Settings lu v m 9 Filesystems Settings X El EJ amp Workspaces Automatic parsing delay 2000 bb Execution Types Default Compiler FastJavac Compilation y Debugger Types w2 Compiler Types Default Debugger Standard Debugging a Search Types Default Executor External Execution lir Lr i rie
12. 143 adding menu item events 143 adding menu items 143 adding menus 142 creating a menu bar 141 creating a popup menu 142 menus IDE 22 215 217 complete list 246 configuring contextual menus 219 customizing 215 options 183 Index Modifiers Editor 291 modules 194 199 adding and updating See Update Center help 199 uninstalling 199 Modules node 183 mounting file systems 75 mounting files 77 multi tab windows 190 N null layout See layout managers O Object Browser 86 262 contextual menus 88 filtering objects 87 Members pane 88 Objects pane 87 package filters 89 Packages pane 87 settings 181 Object Types options 184 objects 80 contextual menu commands 82 Open File command 77 Open File server opening files from external processes 224 options 186 Open File Server options reference 274 Output Window 70 compiler errors 70 debugger output 70 options 186 reference 275 P packages contextual menu commands 79 working with 78 Parameters Editor 291 parser database 45 Print Settings reference 276 Print Settings node 187 Process Descriptor dialog box 206 Project Settings 29 177 254 Compiler Types 180 Debugger Types 180 Execution Types 179 Fileystems Settings 178 Java Sources 181 Object Browser 181 Project Options 181 Search Types 180 Workspaces 179 Project tab 86 projects adding packages and files 156 building 158 compiling 158 creating 154 debugging 159 default 155 exe
13. You can also change these values manually in the left pane 4 Once you have the approximate position of the components you can adjust the other constraints of each component in the left pane Follow these steps in whatever order you prefer to position each component a Select a component in the right pane b Further adjust its horizontal and vertical position if necessary by setting its X and Y grid positions c Adjust the Grid Width and Grid Height parameters to determine how many grid positions are allocated for the component in each direction The values of 126 Chapter 6 Designing Visual Classes with the Form Editor Remainder allocates the rest of the space in the given row or column for the component and Relative are also available You can also adjust these settings with the Grid Width buttons Pushing the right most button with yellow shading in each group sets the value to Remainder Adjust the weight settings of the component to determine how much space it should be given relative to that of the other components For example a component with a Weight X value of 5 has twice as much horizontal space allotted to it as a component with a value of 25 for this parameter The sum of the values of the components in a given row or column should not add up to more than one When a form is resized these settings affect which components are resized and by how much Components with a value of 0 for one of these parameters r
14. display the Configure Shortcuts dialog box in order to add delete or change keyboard shortcuts e Global Options display the Global Options window enabling you to change various IDE settings e Settings display the Project Settings window This command is available only when the Projects module is disabled or uninstalled Window Menu e Clone View clone the current window opens a second view of the current window as a new tab on the multi tab window or in a separate window if the original window is not tabbed Undock Window undock the current window from the parent multi tab window Opens in a completely separate and independent multi tab window Dock Into dock the selected single pane window or the current pane of the selected multi tab window to one of the windows listed in the submenu e NextTab flip to the next tab in the multi tab window e Previous Tab flip to the previous tab in the multi tab window Windows open a submenu of workspaces each of which has a submenu of windows in 251 Appendix C Main Window Menus and Toolbars that workspace If you choose one of these windows it will open in the current wotkspace Help Menu e Documentation view the Forte for Java User s Guide in the JavaHelp viewer If extension modules with their own documentation are installed in the IDE this menu item will have a submenu that enables you to choose which documentation
15. e The Period of Automatic Update Check combo box enables you to set the frequency that the IDE will prompt you to check the Update Center If the Show dialog before automatic update check check box is checked in the future you will be prompted with the Automatic Update Check dialog box before the IDE checks the Update Center If the Show check results even if no update available check box is checked the Automatic Update Check dialog box will reappear after the check even if no new or updated modules are found in the check In the Update Center Registration Number field you can type your Update Center registration numbet so that you do not have to type it evety time that you access the Update Center e If you press the Configure Proxy button you can adjust your proxy settings See Adjusting proxy and firewall settings below You can also adjust these settings in the Global Options window See Global Options on page 182 Adjusting proxy and firewall settings If you are using Forte for Java from behind a firewall or you access the internet through a proxy server you will need to configure the IDE to use your proxy settings Configuring Forte for Java to use an HTTP proxy You can configure Forte for Java s HTTP Proxy settings in Forte for Java in the Update 196 Chapter 11 Configuring and customizing the IDE Center wizatd in the Global Options window or on the command line To specify the HTTP prox
16. only one of those files is visible at any one time At times it is useful to look at different files or views simultaneously side by side Forte for Java makes this possible with its docking feature which enables you to dock move objects into multi tab windows and undock move object views to single view windows 190 Chapter 11 Configuring and customizing the IDE The Explorer with the Global Options window docked into it Explorer Global Options Ey Global Options Th Modules E Toolbars Abbreviations java util Map Q Actions Add Space before Curly E Fase X Menu F Object Types Compound Bracket on Ne Fase E E Startup E Component Palette Delay of Java Completion 2 Bookmarks Expand Tabs to Spaces LI Documentation Z Editor Settings Fonts and Colors Fonts amp Colors E Java Editor Key Bindings java util List I Plain Editor amp HTML Editor E JSP Editor We Execution Settings Line Numbers True Ey Global Options Undocking Any object open in a multi tab window with at least two objects open can be undocked and presented in its own stand alone independent window In this way you can simultaneously view separate sources side by side Undocked windows may also be docked back to the parent multi tab window See Docking below To undock the active tab of the active window 0 Choose Undock Window from the
17. texteditor tutorial E readme amp D FortedJrcisources J Filesystems Navigation When you first start Forte for Java and open the Explorer you will see a multi tab window with tabs labeled Filesystems Project Runtime and Javadoc Click on a tab to go to that part of the Explorer Navigating the hierarchy within each category is simple Click on the expand button for Metal t for CDE Motif and E for Windows next to each item to expand the tree Each tree node represents an object and the object types are visually distinguished with icons See Object Types on page 184 for an overview of available object types Right click on any item to access its contextual menu which contains the context sensitive set of operations as well as access to the property sheet available for that item 23 Chapter 2 IDE Essentials Default operations In the Explorer window double clicking on an item or selecting the item and pressing ENTER performs the default operation on that object The default operation varies for each object type The most common operation is opening the selected object in an Editor window Double clicking on a Java object opens the source in the Editor Double clicking on a method or variable of a Java class as displayed under a parent opens the Editor window and positions the insertion point on the line where that method or variable is declared Double clicking on an HTML file opens it i
18. Applications This chapter explains how to use the Forte for Java Community Edition IDE to create and run applications Specifically we ll show you how to generate and edit Java objects and code using the Editor Object Browser Explorer and templates You will also learn how to compile run and debug your applications as well as create JavaBeans components and add Javadoc comments to your code A separate chapter is devoted to using the Form Editor to design visual applications see Designing Visual Classes with the Form Editor on page 111 Creating new classes In Forte for Java Community Edition you create new classes as well as other objects with templates The template setves as a skeleton for the class and includes basic source code for that class If you prefer to write all of the code yourself you can choose the Empty template and a file will be generated with the only code being the name of the package where you have created the template A wide range of templates come with the IDE and you can also create Chapter 3 Developing Java Applications your own For more on templates see Using templates on page 200 Classes are created using the New From Template wizard You can access this wizard from the Main Window the Explorer and the Object Browser When you access the wizard from the Main Window you select the type of object you want to create from the first page of the wizatd which also provides short des
19. Component Palette customizing 221 options 184 Concurrent Versions System See CVS containers 113 Is Container property 108 Continue command 66 Cursor Editor 290 Customize Criteria dialog box 84 Customizer 94 292 CVS commands 166 creating a project 164 downloading CVS 163 in Forte for Java 163 setting up repository and working directory 164 D Debugger configuring 69 Debugger Settings 185 setting the debugger 68 switching default debugger type 69 Debugger Settings reference 263 Debugger Types 180 reference 260 setting in templates 70 Debugger Window 60 debugging 60 70 Index breakpoints 61 changing threads 67 connecting to a running process 67 resuming 67 session 66 suspending 67 threads 62 watches 64 watches fixed 65 deleting class files 51 Dimension Editor 290 docking windows 190 192 Documentation property sheet See Javadoc documentation See help E Editor 37 209 215 abbreviations 41 abbreviations complete list 241 abbreviations customizing 211 bookmarks 43 clipboard functions 40 code formatting 49 configuring 209 contextual menu 39 Editor Settings 185 file navigation 41 find and replace 43 fonts and colors customizing 213 formatting options 212 highlighting caret row 213 Java code completion 44 Java code completion customizing 212 Java shortcuts 46 jump list 42 keyboard shortcuts complete list 233 keyboard shortcuts customizing 209 layout 38 matching bra
20. Container class java awt Container p e Alc o Container Constructor for class java awt Container f amp Container amp ccessibleAWWTContainer class java awt Co iu Container amp ccessibleAWTContainer Container Constr protected class Container AccessibleAVWTContainer AccessibleContaine Container AccessibleAWTContainer ae Container AccessibleAWTContainer AccessibleContaine extends Container Adapter class java awt event Container amp dapt Component AccessibleAWTComponent o Container amp dapter Constructor for class java awt eve ContainerEvent class java awt event ContainerEvent Inner class of Container used to provide io ContainerEvent Component int Component Construct default support for accessibility This class is ContainerListener interface java awt event ContainerLis not meantto be used directly by application The Javadoc Search Tool will then begin searching for your string Search dialog box The top part of the Javadoc Search Tool dialog box has a combo box for selecting or typing the search string and a Find button for starting the search after the search is started it changes to Stop Next to the Find button is the Show Source button which you can click to open the source file in the Editor assuming the source is mounted in Filesystems The three icons to the right of the Show Source icon serve as toggles for sorting the pages found Selecting the first sor
21. Important Absolute Layout is not recommended for production applications The fixed location of components in the form does not change even when the environment changes Therefore significant distortions in appearance can occur when such an application is run on a different platform or using a look and feel different than the one in which it was created If you design a form using Absolute Layout it is recommended that you switch the layout manager to GridBag Layout and then fine tune it before you distribute the application Note Absolute Layout is not in the standard Java layout sets Rather it is provided with the IDE and can be found at com netbeans developer awt AbsoluteLayout and 124 Chapter 6 Designing Visual Classes with the Form Editor com netbeans developer awt AbsoluteConstraints If you do keep Absolute Layout in your application these two classes must be distributed with it They are ready for deployment in the AbsoluteLayout zip file in the SFORTE4J_HOME lib ext directory You can freely redistribute this archive with applications developed with the Forte for Java IDE The source code is also redistributable and is available in SFORTE4J__HOME sources com netbeans developer awt Null Layout You can also disable Absolute Layout and design forms with a null layout if you wish To use null layout 1 Choose Tools Global Options from the main menu select the Form Objects node and switch the value of its
22. Source synchronization The Java source synchronization feature can save you time by automatically generating all of the implementation methods used by your source code 20 Chapter 2 IDE Essentials This chapter provides a brief overview of the parts of the Forte for Java graphical user interface GUI that you will first encounter when you start using the IDE Once you have familiarized yourself with the concepts outlined here you will have a clearer understanding of how to work in the IDE where to look for commands for various tasks and how to access help documentation if you do not immediately find what you are looking fot User interface The core of the user interface consists of the Main Window the Explorer the Editor the Project Settings window and the Global Options window In this section we outline the function of these windows as well as that of the Form Editor which is a tool that simplifies the building of visual applications Other tools that work closely with core IDE such as the HTML browser the Component Inspector the Object Browser the Debugger the Execution View and the Output Window will be discussed in later chapters For information on how to adjust the default set of windows workspaces and tools to match Chapter 2 IDE Essentials your preferences see Configuring and customizing the IDE on page 177 Main Window The Main Window opens when Forte for Java is launched and remains open a
23. and automatically updating all source files mounted in the Explorer that implement the interface when you change a method in or add a method to that 7 Guide to the Explorer IRE HIER 7 Guide to the Object B Ef Browsing and explori Source synchronization works with all interfaces shown D Creating and modifyi sla VIR PREMIER tab in the Explorer and all C Source synchronizati standard interfaces in the Java 2 SDK You can choose A to synchronize source automatically iust after parsing B Source synchronization To search the documentation click the third icon and enter your search string in the Find field that appeats just under the icons JavaHelp will search the entire User s Guide for that string and then present you with a list of topics pertaining to that string You can then select one of those topics to have its contents displayed Note The JavaHelp search engine is context sensitive Context Help You can also obtain help for specific features of the IDE by pointing to a specific window dialog box or icon with the mouse cursor and pressing F1 You can obtain context help for menu items and nodes such as nodes in the Explorer and Debugger windows by selecting the node and pressing F1 For menu items hold the cursor over the menu item so that it is 31 Chapter 2 IDE Essentials selected but do not click or release the mouse button to select the command Most dialog boxes have a Help b
24. double click the variable to select it and then right click to bring up the context menu 62 Chapter 3 Developing Java Applications A dialog box requesting the name of the variable to watch will open Once you have entered the name of a variable in your source and clicked OK it will be listed in the Watches tree 2 Click on this item in the Watches tree to select it and display its property sheet 3 Continue running the application and watch the variable change Fixed watches Whereas a standard watch refers to the value of variable of that mame currently in scope it is possible to create a fixed watch which always refers to the variable itself that it was created on To add a fixed watch o Right click on the watch and choose Create Fixed Watch from the contextual menu A new node will appear in the Watches tree showing the value of that specific variable If the context changes and the new context contains a different variable of the same name the watch will show the value of the vatiable currently in scope and the fixed watch will show the value of the particular variable it was created on 8 Debugger Window Watches E tefie e Q E mv examples advanced Memory view examp i w em Ej A accessible Cont e eni A isPacked booka mere changeSupport java beans PropertyChang ae ei A yae ow Q windowClosingException java lang Runtim A inputMethodListener java awt event Input A mouseMotionList
25. in the form of param1 valuel amp param2 value2 Restarting the server When you execute a JSP page more than once the server is not restarted Instead a new version of the page is loaded into the server This saves startup time for the page However any other classes used by the page are not reloaded So you may need to restart the server if for example you change a bean used by your JSP To restart the server o Right click on the JSP s node in the Explorer or Object Browser and choose Execute restart server from the contextual menu Configuring JSP Execution Types Sometimes you may want to change settings of the server used for execution These are all accessible in the property sheet for JSP Execution To access the JSP property sheet for execution 1 Select the JSP s node in the Explorer 2 Choose View Properties from the main menu to open the Properties window 3 Inthe Properties window select the Execution tab click the Executor property and select the button that appears The Executor property editor will appear In the left pane JSP Execution will be selected In the right pane are properties including the following Execute unregistered servlets when false links to servlets in the form URL servlet package ClassName ate disallowed MIME types specifies mapping of file extensions to MIME types Port port on which the server runs Make sure that the port number d
26. or bean patterns as well as apply filters to customize what is displayed Using context menus in the Object Browser you can open files access their property sheets compile and execute applications and more Multi threaded debugger Forte for Java provides full support for multi threaded debugging and standard debugging features such as breakpoints watches trace into trace over and trace out Project functionality It is possible for you to organize your work into projects with different IDE configurations for each CVS support You can easily integrate CVS Concurrent Versions System with Forte for Java to make it easier to apply version control to your files and work on team projects 19 Chapter 1 Welcome to Forte for Java Community Edition Javadoc support Forte for Java provides you easy access to Java API documents from within the IDE You can also have Javadoc comments automatically generated for your files and produce your own Javadoc documentation Update Center The Update Center feature enables you to connect to Forte for Java s web site straight from yout IDE and download and automatically install new and updated modules Special support for JavaBeans components Forte for Java provides special support for creating JavaBeans components including generation of properties event sets and bean info You can also customize them and add them to the IDE so that they can be easily dropped into applications
27. 3 3I 32 33 initComponents setSize 500 300 private void initComponents jMenuBarl new javax swing JMenuBar jMenul new javax swing JMenu jMenuIteml new javax swing JMenultem jMenuItem4 javax swing JMenultem jMenuItem5 javax swing JMenultem jMenultem6 javax swing JMenultem jMenultem javax swing JMenultem jMenu2 new javax swing JMenu jMenuItem2 new javax swing JMenultem new new new new Project Settings and Global Options windows These two windows hold the IDE s configurable settings The Project Settings window which can be opened by choosing Project Settings from the main menu holds settings which can be configured separately for individual projects Examples of Project Settings include Compiler Types Executor Types and Java Sources The Global Options window available by choosing Tools Global Options from the main menu enables you to configure settings which apply to IDE as a whole These settings include Menus Toolbars Component Palette and proxy settings found under System Settings See Project Settings on page 177 and Global Options on page 182 for detailed descriptions of the items in each window 29 Chapter 2 IDE Essentials JavaHelp context help and tool tips As you ate getting to know Forte for Java you may have questions about certain parts of the IDE Forte for Java s implementation of JavaHelp with se
28. 4 On the first page of the wizatd select the Install manually downloaded modules radio button and click Next to move to the second page 5 Click Add to bring up the file chooser navigate to the directory where you placed the files select the directory and click OK 6 Click Nextto go to the third page of the wizard and proceed according to steps 4 through 6 of the previous procedure for updating through the web site You can also add modules manually by right clicking on the Modules node and choosing New Module from File The Open dialog box will appear enabling you to browse for the JAR file containing the module If you select a valid module and click OK the module will be installed into the IDE Uninstalling and reinstalling modules If you rarely use certain modules you may want to uninstall them from the IDE Doing so can decrease IDE startup time and possible lower memory usage To uninstall a module 1 Choose Tools Global Options from the main menu 2 Expand the Modules node and select the module you want to delete 3 On the property sheet select the Enable property and set it to False Any features provided by the module will be removed from the IDE The next time you start Forte for Java Community Edition the JAR file for that module will not be loaded into the IDE Should you wish to later reinstall the module you can repeat the same procedure but switch the Enable property to True Module help If
29. ALT k go to the previous entry in the jump list ALT 1 go to the next entry in the jump list ALT SHIFT k go to the next jump list entry ot in the current file ALT SHIFT 1 go to the next jump list entry oz in the current file For example if you are editing line 7 of a file then you scroll to line 100 and enter text you can press ALT k to go back to line 7 and then ALT 1 to go back to line 100 40 Chapter 3 Developing Java Applications Using Editor bookmarks You can set up Editor bookmarks not be confused with bookmarks for web pages to matk places in files that you return to often You can then navigate to these bookmarks with a simple keyboard shortcut To bookmark a line in a file O0 Put the insertion point in the line you want to bookmark and press CTRL F2 The line will then be highlighted turquoise To jump to a bookmark Press F2 The insertion point will move to the next bookmark in the file If the end of the file is reached without a bookmatk being found the search will continue from the top of the file To remove a bookmark O Put the insertion point in the bookmarked line and press CTRL F2 Find and replace To find or replace text in a file open in the Editor window press CTRL f to bring up the Find dialog box or press CTRL r to bring up the Replace dialog box The Find Replace dialog box gives you checkboxes which enable you to choose any combination of the following options Hi
30. CVS file systems In parentheses are the command line CVS equivalents where they differ in name e Refreh cvs status 1 refreshes the file status of the file or files in the selected package e RefreshRecursively cvs status 1 recursively refreshes the file status of all files in the selected package e Init initializes the CVS repository This is necessary only after creation of a new repository directory Update updates the file with changes that other developers have made to the source in the CVS repository and if necessary merges local changes e Commit use this to incorporate your changes to the CVS repository When you choose this command you will be prompted by the Reason dialog box where you can enter a brief explanation of changes you have made Add use this command to add new files with status Local to the CVS repository After this command you have to use Commit to actually incorporate the file to the CVS repository e Remove use this to eliminate the file from the CVS repository The file s node will remain in the working directory but the file status will change to Locally Removed The removal is not final until you run Commit 166 Chapter 9 Integrating a CVS version control system Import this command imports the whole directory structure to the CVS repository e CheckOut this command makes a local copy of the CVS repository in your working directory e Status displa
31. Developing and Customizing JavaBeans Components Adding JavaBeans using the beans directory You can have a JAR file installed automatically each time the IDE is started by putting it into the beans directory under the root of the installation By default each bean is put into a Palette category with the same name as the JAR file You can control which beans are loaded and what Component Palette categories they are loaded into by adding a beans properties file 110 Chapter 6 Designing Visual Classes with the Form Editor Forte for Java provides the Form Editor which enables you to build forms for graphical user interfaces visually and have the code for them automatically generated You can select items such as panels scroll bars menus and buttons in the Component Palette and then place them directly on the Form Editor window As you do the IDE automatically generates the Java code to implement the design and behavior of the application The Form Editor also uses yout chosen layout manager to control the design time layout of the form in the Form Editor window If you change the layout manager or its parameters the changes are displayed immediately In addition you can manage event handlers and customize the way code is generated for components Opening the Form Editor To open the Form Editor for existing forms double click on the form object in the Explorer or choose Open from its contextual menu Chapter 6 Designing Visual
32. Form Editor includes advanced support for Java layout managers including the GridBag layout customizer which makes the most complex standard Java layout manager 18 Chapter 1 Welcome to Forte for Java Community Edition easier to use The GridBag customizer dialog box provides you with a dynamic visual representation of the components in their respective grid bags and gives you different ways of adjusting the constraints such as dragging direct entry of values and tool icons The Form Editor enables you to immediately to use any JavaBeans component for visual development Because they use standard Abstract Window Toolkit AWT and Java Foundation Classes JEC components generated forms do not depend on any proprietary code or components No classes need to be bundled with your forms as the Form Editor generates code that is entirely independent of the IDE unless you use Absolute Layout a special Forte for Java feature which is an improvement on null layouts Explorer and Properties window The Explorer provides a unified hierarchical view of Java classes and their elements Javadoc documentation and running and debugging processes The Properties window enables you to view and edit the properties for the object represented by the node selected in the Explorer Object Browser With the Object Browser all of your sources are logically presented in one streamlined view You can view your applications by package object and member
33. Go to the File Types tab 2 See if there is some kind of entry for Java source files the name may vary depending on what software has been installed the entry should specify the file extension java Click New Type if necessary otherwise select the entry and click Edit 3 In the Actions box you need at least one action which opens the file in the IDE you can name it whatever you like usually Open Click New or Edit as appropriate 4 In the resulting action dialog box supply whatever name you like and give as the application the command you typed before but replacing the filename with 1 C jgdk1 2 2 jre bin javaw jar C Program Files forte4j modules utilities jar 1 5 Normally you will also click Set Default it will be bold if it is the default to make it the default action for double clicks 6 If desired you may similarly associate other file types recommended are properties ser form class jar zip and so on Now you should just be able to double click any of these files in the Windows environment and the IDE will open them for you For other systems such as Solaris and Linux if you use a file browser such as from KDE or Gnome or a separate browser you can similarly set up file associations Customizing file opening The Open File launcher has several options which can be used to customize the process of opening files remotely You may pass these on the command line to the la
34. Go to the line in the Editor corresponding to the selected component Install New JavaBean Install a JavaBeans component into the Compo nent Palette Set Layout Set the layout Show Grid Display a grid in the Form Editor window for Absolute layout Test Mode Put the Form Editor in test mode Table 66 Help Actions Action Description About Display the About dialog box Bookmarks Show the bookmarks submenu Documentation Open up the available documentation including the Forte for Java User s Guide in the internal web browset Forte4J EAP Connect to the Forte for Java Early Access Pro gram web site Forte4 Home Connect to the Forte for Java home page Forte4J Open APIs Connect to the Forte for Java Open APIs web site Getting Started Open the Forte for Java tutorial in the internal web browser Help Show the context help for the item that the cursor is pointing to Javadoc Index Search Conduct a search the Javadoc documentation mounted in Filesystems Tip Of The Day Display the Tip of the Day dialog box Tutorial Open the Forte for Java tutorials in the internal web browser 282 Appendix E Actions Action Description Update Center Connect to the Update Center and check for new and updated modules Table 67 Project Actions Action Description Add New Clas
35. Index apply to the whole BeanInfo class In these two properties you can specify a default property or event that may be declared in the BeanInfo to be customizable The values are the indexes of the default property and default event set in the Propert yDescriptor and Event SetDescriptor arrays respectively and are set to 1 if there is no default property For more information on these and the other properties see BeanInfo in the API documentation that comes with the Java 2 SDK or check Sun s web site 104 Chapter 5 Developing and Customizing JavaBeans Components http java sun com products jdk 1 2 docs api java beans BeanInfo html Properties and Event Sources nodes These nodes have only one property Get From Introspection By default this property is set to False If you set the value to True then when the bean is used all information about the properties or event sets will be taken from introspection Thus the generated BeanInfo will return a null value instead of an array of descriptors of properties or event sets This feature is particularly useful if you want to customize either JavaBeans properties or event sources but not both Thus you can customize one properties or event sources and have the information about the other taken from introspection If you right click on either of these nodes you can choose from the contextual menu to either include or exclude all of the JavaBeans properties or event sets fro
36. New JavaBean from the main menu 107 Chapter 5 Developing and Customizing JavaBeans Components 2 In the dialog box select the path and JAR file of your new JavaBeans component and click Open 3 A list will appear with available JavaBeans Select the ones you want and click Install Note If the beans you expect do not appear the required attribute Java Bean True is missing from the beans entries in the JAR manifest See the JavaBeans specification for details on proper packaging of JavaBeans 4 Inthe Palette Category dialog box that appears next choose where in the Component Palette under which tab you would like to place the bean s and click OK You will then see the new bean s appear under the tab you indicated ready to use in an application Some JavaBeans components have their own icon In cases where this is not true the IDE assigns a default icon to the bean To see the name of each installed JavaBean position the cursor over the bean and a tool tip will appear Is Container property A component s Is Container property enables you to choose whether or not to have the component treated as a container To access a component s Is Container property 1 Choose Tools Global Options from the main menu to display the Global Options window 2 Expand the Component Palette node and the component s palette category node 3 Select the node for the component The Is Container property for that component
37. O d Object Browser Parse class files False Project Options Strings table USER pkeeganO 3 Save the project by selecting Project Save Project from the main menu If you do not save the project it will be saved automatically when you exit the IDE 159 Chapter 8 Organizing work into projects For more information on the various configurations available for projects see Project Settings on page 177 Saving projects When you exit the IDE any changes made to the current project are automatically saved When you switch to a different project you are prompted whether or not to save any changes made to the project you are closing You can also save changes to a project without leaving it To save a project without closing it Choose Save Project from the Project menu Note When you save a project you do not actually save the files you have associated with the project Only the project information such as the IDE state Project Settings and a record of which files you have associated with the project is affected To save the files themselves select File Save All from the main menu This will save all files that have been modified whether they have been modified or not Switching between projects If you have more than one project saved you can easily switch between them by opening a different project To switch projects On the Projects menu in the Main Window choose Open Project or Expand the Proje
38. Page Header Fotmat You can set the header with a combination of text and the following tags 0 for page number 1 for date and 2 for file name Wrap Lines If True lines are wrapped Table 58 Print Settings properties by individual Editor type Property Description Print Fonts and Col Provides access to a custom propetty editor where back ors ground and foreground colors as well as fonts can be set for various syntax tokens Print line numbers If True line numbers appear in printouts 276 Appendix D Reference Guide to Project Settings and Global Options Property Sheet reference Table 59 Property Sheet properties Property Description Disabled Property The text color of read only properties Color Display Editable Whether to show only properties that are editable or that Only have a custom property editor Painting Style Indicates if values are shown always as text preferably as text or preferably as graphics Plastic Whether to enable animation of buttons in the property sheet to make the active property more visible Sorting Mode Sets the criteria for sorting properties on the property sheet by name by type or unsorted Value Color The text color of property values in the property sheet System Settings reference Table 60 System Settings Property Description Confirm Delete If True a d
39. Wizard is finished 136 Chapter 6 Designing Visual Classes with the Form Editor Connection target The second step enables you to specify the operation that is to be performed on the target component There are four options which can be changed using the radio buttons along the top of the dialog box e Set Property enables you to set a property on the target component In the next step you specify the property value e Method Call enables you to call a method on the target component In the next step you specify the parameters for the method call e User Code enables you to write the code by hand When you choose this option the Next gt button changes to Finish meaning there are no settings remaining in the wizard and the target component is ignored by the wizard The insertion point in the editor is then placed into the new event handler enable you to write the handling code by hand EY Connection Wizard Step 2 of 3 Connection Target Target Component jTextField1 C Set Property Method Cal User Code action Event Object add Component Object add String Component add Component int add PopupMenu add Component Object int add Component addActionListener ActionListener addAncestorListener AncestorListener addCaretListener CaretListener addComponentListener ComponentListener addContainerListener ContainerListener addFocusListener FocusListener ad
40. and customizing the IDE 2 Inthe Global Options window expand the Editor Settings node and choose an editor type Java HTML Plain Text or JSP 3 Click the Properties tab of the property sheet 4 Click in the value field for the Fonts and Colors and click the button to bring up the Fonts and Colors property editor a Property Editor Fonts and Colors E3 Font Honospad v Inherit highlight bracket rForeground Cola ava Identifier Java Method Call B black v Inherit rBackaround Colg L white i Inherit Preview Error In Sources Line Number id Long Integer Literal 5 In the Syntax panel click the token you would like to change the coloring of 6 The right pane of the dialog consists of the following four panels e Font where you can modify the face style and size of the font Foreground Color where you can set the color of the text Background Color where you can set the background color for the text e Preview which displays the font and color scheme you have chosen 7 The first three panels each have an Inherit checkbox If you check this box in a category the text type will inherit the font or color from the default text type ot from another token it is dependent on These panels each have a button showing the current font or foreground or background color or font for the selected token in the left pane Press one of these buttons if you wan
41. and pressing the DELETE key on your keyboard Note When you cut or copy source files and paste them to a different package the sources package declarations are automatically updated to reflect the new package If you copy and paste a file to the same package the pasted copy is automatically given a unique name which you can change either from the contextual menu or by clicking on it in the Explorer to select it and then clicking again for an in place rename The contextual menu commands available on nodes in the Explorer enable a wide range of 78 Chapter 4 The Explorer and Object Browser operations from creating new packages to changing properties The following is a list of menu items that appear in various contextual menus Table 1 Package contextual menu commands Command Description Explore from Here Opens a new Explorer window with the selected package as the root Find Enables you to conduct a search of files in directories mounted in the Explorer Refresh Folder Updates the view reflecting any changes to files in the folder made outside the IDE Compile Compiles all uncompiled ot modified objects in the selected package at the selected level in the hierarchy Compile All Compiles all uncompiled ot modified objects in the selected package and recursively in all sub packages Build Compiles or re compiles all objects whether already com piled or not in the selected package
42. appears select the Actions radio button to view a list of all actions by category and the keyboard shortcuts applied to them 3 Select one of the listed actions E3 Configure Shortcuts r view Shortcuts By Actions C3 Shortcuts Actions 9 Cf Build 3 Build Ait F3 Build Ai Clean Ctri 7 D Clean All 3 Compile F3 3 Compile Alt 3 Execute Ctri F9 D Execute restart server D Generate Javadoc Shortcuts Add Remove 4 Inthe Shortcuts pane press the Add button 5 In the Add Shortcut dialog box that appears type the key combination that you wish to be the shortcut For example for CTRL ALT 7 hold down the CTRL and ALT keys and type 7 6 Close the two dialog boxes by pressing the OK button in each of them 220 Chapter 11 Configuring and customizing the IDE To remove a keyboard shortcut 1 Select Tools Configure Shortcuts from the main menu 2 Inthe Configure Shortcuts dialog box that appears select the Shortcuts radio button to view a list of all shortcuts currently assigned 3 IntheShortcuts pane select the shortcut you would like to remove and then press the Remove button 4 Close the Configure Shortcuts dialog by pressing the OK button Note You can have multiple keyboard shortcuts for the same action Customizing the Component Palette You can also customize the Component Palette In the Global Options window under Component Pale
43. bracket or parenthis matching the one the insertion point follows Edit shortcuts include the cutting copying and deleting of various segments of text Java shortcuts only apply to Java files and include Java code completion and applying Java prefixes to identifiers Navigation shortcuts Table 17 Shortcuts with standard navigation keys Keyboard With no selected y With selected text shortcut text RIGHT Move the insertion point Deselect the text and one character to the right move the insertion point one character to the right LEFT Move the insertion point Deselect the text and one character to the left move the insertion point one character to the left DOWN Move the insertion point Deselect the text and to the next line move the insertion point to the next line UP Move the insertion point Deselect the text and to the previous line move the insertion point to the previous line SHIFT RIGH Select the character to the Extend the selection one T right of the insertion character to the right point SHIFT LEFT Select the character to the Extend the selection one left of the insertion point character to the left SHIFT DOW Create a text selection and Extend the selection to N extend it to the next line the next line SHIFT UP Create a text selection and Extend the selection to extend it to the previous the previous line line 233 Appendix A Default Keyboard Shortcuts
44. by clicking on their tabs when you are designing the form In the property sheet for the CardLayout node you can set the Current Card property to card1 card2 and so on In code the methods show next previous first and last can be used to select cards For example the following code selects the next card in panell when buttonl is clicked private void buttonlActionPerformed java awt event ActionEvent evt Add your handling code here CardLayout cards CardLayout panell getLayout cards next panell See the JTabbedPane component if you want to design a visual form that has tabbed panes in run time GridBag Layout GridBag Layout not to be confused with Grid Layout lets you set almost any layout you want using a complex set of constraints You can create a GridBag layout one of the following three ways e By using Forte for Java s Customize Layout command on a form to bring up the customizer dialog box which enables you to visually adjust the placement and constraints of the components See Using the GridBag customizer on page 125 for mote information e By setting the constraints yourself under the Layout tab of the property sheet of every component within the layout e By creating an Absolute Layout and then switching to GridBag to have the constraints code generated automatically If you use this option you might want to go back and 123 Chapter 6 Designing Visual Classes with the Form Editor
45. changing the X value of its Bounds property For items with a Bounds propetty click on Bounds in the property list Click on the button that appeats to open the Bounds Rectangle Editor Use the X and Y fields to set the default location on the screen where you want the window to open Use the Width and Height fields to set the default size of the window Insets Editor Determine the position of components within a cell in a layout manager with the Insets Editor For items with an Insets property click the property name to get the button Click the button to open the Insets Editor Specify a value for each field to position a component within its cell in the layout Modifiers Editor Change a class or method modifier with the Modifiers Editor Click the Modifiers property of a class or method and click on the button to open the Modifiers Editor Only those modifiers that are permissible for the selected item are active Choose the accessibility type from the Access list and choose the field modifier you want to apply from the Other Modifiers panel Click OK to confirm the selection Parameters Editor Add edit or remove a method parameter with the Parameters Editor Click the Parameters property and click the property editor dialog box button to open the Parameters Editor The default method parameter is displayed in the parameter list To add a parameter click Add A dialog box opens in which you can choose the param
46. choose a package for the template You can do this either 32 Chapter 3 Developing Java Applications by typing a package name in the Package field or by selecting one of the packages shown in the tree view just below it EY New From Template Target Location Name MyClass m m P e I m a g m ct a package for the newly created object or enter the package name below Q E D Forte4JrciDevelopment Q C3 examples Q C3 advanced G test G texteditor tutorial amp D FortedJrcisources Package examples advanced test Previous Next Cancel Help 5 Press Finish to exit the wizard The object will then be created Note The first time you create an object from template you will be prompted whether or not you want to add the file to the current project If you select Yes the new file will be visible under both the Filesystems and Project tabs of the Explorer and will be among the classes affected if you compile by project If you select No the new file will not be visible under Project If you select Always this new class and all subsequent classes created from the wizard will be added to the current project If you select Never classes will not be automatically added to the current project unless you are adding them to a directory that is already included in the project You can later add or remove files from projects and change whether files are automatically a
47. create in the Debugger Window to display the current value of any variable of that name currently in scope You can monitor the value of the variable as it changes during the execution of the program zal Debugger Window atches olx Watches aA PE Q E m examples advanced Memory view examp A l E Q accessibleContext javax accessibility Acc Name of Variable componentSerializedDataVersion int 3 examples advanced Memo A privateKey java lang Object java lang Ob 2 isPacked boolean true Inner type examples advanced Memo ee MA Value examples advenced Memor Value examples advanced Memo Q window ClosingException javalang Runtim P id A inputMethodListener java aw event Input AQ mouseMotionListener java awt event Mous Q mouseListener java awt event MouseListe Q keyListener java awt event KeyListener Q hierarchyBoundsListener java awt event Q hierarchyListener java awt event Hierarch AQ focusListener java awt event FocusListen A componentListener java awt event Compo Q newEventsOnly boolean true componentOrientation java awwt Compone A prefSize java awt Dimension null Watches To set a watch 1 Choose Add Watch from either The Debug menu on the Main Window The contextual menu of the root Watches item on the Watches tab of the Debugger Window e From the contextual menu of a variable you have selected in the Editor
48. file text or date Install New JavaBean install a new JavaBeans component to the Component Palette e Tools Create Group create a group object composed of links to one or more files enabling you to access them from the same place in the IDE e Tools Auto Comment enable you to comment your source code automatically and view all parts of your source code methods constructors inner classes variables and so 250 Appendix C Main Window Menus and Toolbars on and document them individually e Tools Generate Javadoc generate Javadoc documentation for the selected classes or elements and place it in the directory that you specify e Tools Add to Component Palette Add the selected object to the Component Palette e Tools Synchronize force synchronization of the selected source file with the interfaces it implements Tools Set As Project Main Class set the selected project as the class to be executed when you choose the Execute Project command e Tools Update Parser Database update the Java parser database with the classes of the selected package thus making those classes available in addition to the standard Java 2 Platform SDK classes when using the Java code completion feature in the Editor e Tools Add to Project add the selected class to the project making it subject to compilation when you choose the Compile Project command Configure Shortcuts
49. firing PropertyChangeEvents for bound properties and VetoableChangeEvents for constrained properties will be generated in the bodies of the setter methods In addition code to declare and initialize the property change support object is generated Creating indexed properties You can also create indexed properties Indexed properties are usually implemented as arrays or vectors and enable you to set and get values using an index Indexed getter and setter 100 Chapter 5 Developing and Customizing JavaBeans Components methods have a parameter which specifies the index of the element to be read and written To create an indexed property in a class source 1 2 5 Find the class in the Explorer expand its node and right click on Bean Patterns In the contextual menu choose New Indexed Property The New Indexed Property Pattern dialog box will appear which will enable you to customize the code to be generated for the property Proceed according to steps 3 through 6 above in the instructions for creating a simple non indexed property Check the items in the Options section appropriate for the property These four options are analogous to the options for a simple property In addition the indexed properties may have getter and setter methods which enable reading and writing all elements the whole array The checkboxes in the Non Index Options panel enable you to add a getter with or without a return statement and
50. from the Cursor Editor dialog box String Editor Create or change the content of a tool tip or other text string with the String Editor Click on a text property value to get the box button Click the button to open the String Editor In the textfield type the text for the string Click OK to establish the change Icon Editor Assign icons to represent an object or to denote an object s state with the Icon Editor For items with an icon property click on the property name then click on the button to open the Icon Editor Click the radio button that corresponds to the image soutce a URL file or classpath In the Name field enter the path of the image or click the dialog box to open a file chooser The preview pane below the Name field displays the image Click OK to assign the icon to the property Dimension Editor Set the maximum minimum or preferred size for a selected component with the Dimension Editor Click an item s size property to get the button Click the button to open the Dimension Editor Enter the desired width and height values and click OK to set the property values Bounds Editor Change the default size and location of individual top level windows with the Bounds or 290 Appendix F Custom Property Editors Rectangle Editor For example the Explorer window has default settings that place it to the far left of the screen You can change the default setting to place the window to the far right by
51. generates the Java code to implement the design and behavior of the application The code is visible in the Editor window The Form Editor also uses your chosen Java layout manager which controls the appearance of the components in a window to control the layout in the Form Editor If you choose a different layout manager or change its parameters the Form Editor displays your 26 Chapter 2 IDE Essentials changes immediately The Form Editor consists of three parts the Form Editor window the Component Inspector and the Editor window Form Editor window The Form Editor window shows the design time view of the form you are creating You can add components to the form by selecting them in the Component Palette and then clicking on the Form Editor window You can also manipulate the components within the Form Editor window by dragging them or by right clicking on them and choosing commands from the contextual menu to do things such as change their order delete them rename them and access their property sheets Form Ted olx Fie Edit Help For a comprehensive guide to using the Form Editor see Designing Visual Classes with the Form Editor on page 111 Component Inspector The Component Inspector is the part of the Form Editor that resembles the Explorer except that it shows only information specific to the active form It lists all of the form s components including non visual ones such as layout managets an
52. gerne du oap d lut pa mis 141 Menu edHOES aereas Pen na an anea M WAR IN Scri sit de RE IV EORR E P AN ETE HEAA 141 Creating a menu DAE doeoibiterecosm d ri tato e Eb cl tea ced tar dca date iri e reed tta adi 141 Adding menus to th menu bat s cem uates qune ara ean adn ces tain nUR en edd 142 Creatine d DODUD TGA sco niini nii e o derepente an o M eade i n oranda Minds 142 Addo Her OL GEL Sas oe oet De Fatti et lubet lia lo eto oes cc obe ei eint dn ud 143 Meno dei events oie ose hein deat rat ieiba a aa aa a dnd 143 Components with special sSuppOFt iicio seis pU eU RUD RARE CAEDE OUI SEED Va Ee TY 143 TecrollPane Scri aHe qoem etes vd p sivi red rtv tite tired orbe E A 143 JTabbed Datis ies tai oss dabit but atis D BERE cO Oo oS n Palo ior f oda Hate f lias 144 JUI NP EE 146 MDI Applications Using JDesktopPane and JInternalFrames eee 146 Mj S 147 Configuring the Form Editot ucee cnr rH Od DARE aged Ua UAR Ea tank VES EXYUR EGRE S V G M DR VUE 147 Chapter 7 Developing Java Server Pages ccccccccsccsssessscssssesssssesseeseseseees 148 Creating and editing Java Server Pages eese eene eene 148 Compune SAS ests emir ewe EEE on rab qa E m ana aU Nea ese 149 Handligo Compllattob eEtOPSS certa idt ase R CRESCE DRE I CORTAS mann sR RN IR Das 149 Seleciinp quc oimiple Bist aed e ts a ate dancus codcm Ute epo e era Polenta end ert 150 Included beans others JSPs and error pages in compilation
53. in the Editor Explorer or Object Browser CTRL F1 Do Javadoc index search if Javadoc module is installed Project Shortcuts These shortcuts keys mirror commands available in the Project menu Table 14 Project shortcuts Press To SHIPT F9 Compile project CTRL SHIFT F9 Execute project CTRL SHIFT F5 Debug project Build Shortcuts These shortcuts keys mirror commands available in the Build menu 231 Appendix A Default Keyboard Shortcuts Table 15 Compile Build shortcuts Press To F9 Compile all out of date files under selected node ALT F9 Build compile all files under selected node ALT c Stop Compilation ALT F7 Go to Previous Error Line ALT F8 Go to Next Error Line CTRL F9 Run Debugger Shortcuts These shortcuts mirror commands available in the Debug menu Table 16 Debugger shortcuts Press To F5 Start Debugging ALT F5 Continue Debugging SHIFT F5 Finish Debugging CTRL F8 Add Remove Breakpoint SHIFT F8 Add Watch F7 Trace Into F4 Go to Cursor F8 Trace Over CTRL F7 Trace Out ALT 5 Open Debugger Window 232 Appendix A Default Keyboard Shortcuts Editor Shortcuts Keyboard shortcuts in the Editor can be loosely divided into three categories navigation edit and Java Navigation shortcuts encompass everything from using the arrow keys on the keyboard to finding the brace
54. informa tion Must be turned on to debug with source tracking Deprecation If True the compiler treats the use of deprecated methods as errors Identifying Name The name for the compiler type by which classes reference it Encoding If True character encoding is used in Java sources Optimize If True the compiler optimizes generated bytecode See http java sun com products jdk 1 2 docs tooldocs solatis javac html for more information on Javac 257 Appendix D Reference Guide to Project Settings and Global Options Execution Types reference Table 32 External Execution service properties Property Description External Process Path to Java launcher You can use the custom property edi tot to define the process and arguments using a set of sub stitution codes See Process Descriptor property editor on page 206 Identifying Name The name for the execution type by which classes reference it Boot Class Path Boot class path of Java including installed extensions Class Path The startup class path used by the IDE that is transferred to the external process Environment vati A list of environment variables in the form Name Value ables If the value is nu11 the IDE s default settings are used Filesystems Path Read only value showing the current class path from File systems Library Path List of modules and special libraries the IDE uses Working Directoty A working di
55. iof instanceof ir import pe protected pt private psf private static final psfb private static final boolean pst private static final int psfs private static final String pst printStackTrace pu public re return sert System err printin sh short sout System out println st static sw switch sy synchronized tds Thread dumpStack th throws tr transient tw throw twn throw new twne throw new Error twni throw new InternalErrot wh while 243 Appendix B Default Editor Abbreviations Table 27 JSP Editor abbreviations a Expands To ag application getValue ap application putValue ar application removeValue cfgi config getInitParameter jg lt jsp getProperty name jspf lt jsp forward page jspg lt jsp getProperty name jspi lt jsp include page jspp lt jsp plugin type jsps lt jsp setProperty name jspu lt jsp useBean id oup out print oupl out println peg pageContext getA ttribute pegn pageContext getAttributeNamesInScope pegs pageContext getAttributesScope per pageContext removeA ttribute pes pageContext setAttribute pg lt page pga lt page autoFlush pgb lt page buffer pge lt page content Type pgerr lt page errorPage pgex lt page extends pgie lt page isErrorPage pgim lt page import 244
56. method Once execution has halted whether on a breakpoint or just after the main method use the Trace Into Go To Cursor Trace Over Trace Out and or Continue menu or toolbar items under the Main Window Debug menu or the keyboard shortcuts F7 F8 CTRL F7 and F5 respectively to proceed Trace Into steps into the method at which the Debugger is currently stopped if there is a method call on that line and breaks at the start of the called method enabling you to observe execution incrementally If there is no method call on the current line then it behaves like Trace Over Go To Cursor executes the current statement and all ensuing statements until it reaches the line that the insertion point is on Trace Over executes the current statement without breaking and stops at the next statement Trace Out halts execution after the current method finishes and control passes to the caller Continue resumes execution which continues until it reaches the next breakpoint or the end of the application Finish Debugging ends the current debugging session By stepping through your code like this you can monitor whatever parts of the system you choose during execution of the code 64 Chapter 3 Developing Java Applications Suspending and resuming debugging The Debug menu and toolbar also have Suspend All and Resume All options which enable you to pause execution at any time and then continue from the point execution was suspe
57. more than one component is selected their common properties are displayed To select a component in the Component Inspector s tree click on it To select multiple components hold down the CTRL key and click each one You can also select a consecutive group of components by clicking on the first one holding the SHIFT key and then clicking on the last component in the group Connection mode In connection mode you can statt the Connection Wizatd in which you can link two components together with an event 115 Chapter 6 Designing Visual Classes with the Form Editor Connection mode Re TA See Using the Connection Wizard on page 135 for more information Moving components to a different container If when adding a component to your form the component is added to the wrong container the easiest way to put the component into the proper container is to cut and paste the component in the Component Inspector To move components 1 Select the item in the Component Inspector or the Form Editor window hold down the SHIFT or CTRL key to enable selecting of more than one item 2 Right click the item s and choose Cut from the contextual menu 3 Choose the destination container in the Component Inspector or the Form Editor window and choose Paste on its contextual menu The components will be moved with all properties and events intact although events are maintained only if pasting within the same form Copying co
58. o fre reir ee ie retia koe arent taies reseau 211 Customizing Java code completion s tete reed e i e e ied 212 Java Editor formatting Options nite ae od IIT MERI RUD REGEM EO HIM ne 212 Catet row highlightitio tete nete re eere ert eere ee He dove Eine etie n 213 Setting fonts and text coloring in the Editor sse 213 Using an external editori eret tret itera ttr iaai 215 Additional Editor Settings erret perte torti e ab PEOR Hle R e Reti ER EoR ebat 215 C stomizing me us atic toolbatss deri iiie prb ra Gab n Sad eq aed n vea 215 Changing commands in menus and toolbars ssssssssseeeeeeeeeeeetennens 215 Creating new menus and toolbars sane canon dns ainmin aan HER a Aah eedhnennaushacs 217 Dragpine toolbats ida sini eire oomen e pr rere o ie b od s e ted t ades 217 Toolbar contextual menu and toolbar configurations sss 217 Changing commands in contextual menus ssesseeeeeee eene teens 219 C stomizine IDE SHOEUTS oie dei en ea i ver tette edens b peint ga RE emet 219 Customizing the Component PATOEEE addo dit cal ca aede ah qudd Du re RD dero p 221 Customizidg WOLKS ACES i p didi ende ni iania mie a an aaan 222 Opening files from outside of the IDE eese eene 224 Using the remote launcher tiara lly dese RE eden a Dora geo pen deeem du A RR 224 Associating the launcher with a type of Dileasun ie Geist te tbt del tue Fen iq ede 224 Customizing file opening oes qoia iota eed ede i
59. of editor you want to configure abbreviations for 3 Select the Abbreviations property and click on the button This will bring up a custom property editor for abbreviations 4 Select the abbreviation that you want to change in the list box and click Edit 5 Another dialog box will appear with a combo box list for the abbreviations Action with the selected one showing and a field showing the selected expansion Key Change either ot both values and click OK to make the changes or Cancel to go back to the Abbreviations dialog box To add abbreviations Follow the same steps as for changing abbreviations but click Add in the Abbreviations dialog box instead of Edit 211 Chapter 11 Configuring and customizing the IDE Customizing Java code completion Changing the key bindings for code completion Just as you can with other Editor shortcuts you can change the shortcut assignments for Java code completion To change the keyboard shortcut assignments for code completion 1 Choose Tools Global Options from the main menu 2 Inthe Global Options window expand the Editor Settings node and select Java Editor 3 On the property sheet select the Key Bindings property and click on the button This will bring up the Key Bindings custom property editor 4 Inthe custom property editor select the shortcut assignment you want to change jcompletion show help or jcompletion hide and press Edit 5 In the Edi
60. polish up the details using the two previous options GridBag Layout is particularly useful for multi platform Java applications because it enables you to create a free form layout that maintains a consistent appearance even when the platform and look and feel change Box Layout The Box Layout is part of the Swing API It lets multiple components be arranged either vertically along the Y axis or horizontally on the X axis Components do not wrap even when the container is resized By default they are arranged from left to right or top to bottom in the order they are added to the container See Reordering components within the same container on page 117 for changing the order of the elements Box Layout is similar to Grid Layout except that it is one dimensional that is there can be multiple components on one axis but not both Absolute Layout Absolute Layout is a design aid that enables you to place components exactly where you want to in the form and move them around by dragging Ease of use makes this layout particularly useful for making prototypes You do not have enter any property settings and there are no formal limitations within the layout It is a substitute for null layout for which there is no layout constraints object and provides and places components in absolute positions more cleanly You can have a grid displayed on the Form Editor window when using Absolute Layout by pressing the Show Grid icon
61. property sheet by using the contextual menu of a node the properties for that node will remain displayed in this window even if you later select a different node The Component Inspector Debugger Window Project Settings window and Global Options window each have their own property sheet pane which displays the property sheet for the item selected in the top pane of that window 24 Chapter 2 IDE Essentials Contents of the property sheet The property sheet consists of paired names and values Each row of the property sheet represents a single property of one or more if multiple objects are selected items A name value pair may be dimmed if it represents a read only property that is not connected with a custom property editor a dialog box tailored to the specific property enabling editing or input of more complex values Each property name has a tool tip label which gives a brief description of the property To access the tool tip rest the mouse over the property name for a moment until the tool tip appears Properties Window class Me M E3 javax swing JFrame Javadoc Comment org openide src JavaDoc Nene encnvew Properties For JavaBeans properties the name of the property is derived from the display name of the bean property The tool tip for each property name displays its accessibility information and a short description for that property Accessibility details are shown in parent
62. qt e ebd pn Re Cl aa reia Se Pe 225 Open Pile Serv r properties dide id t aaia aa Msn aat fes na ita UD 226 10 Contents Appendix A Default Keyboard Shortcuts eene 228 Global SHOTECUES e 229 Foti Editor SHOMCHUtS NR 229 Explorer Shortcuts cese p M e eers TOREM ans E Ea AEE Ee EAE EE ea aaa eaS 230 Window ShOrtCUtS rerea EE RNE EE EET ENE 230 Project SHORE CUESu i i e E OE as EV eds a edt nre Mess Oa 231 Build Shortcuts snese enlm inta das Unt eni ad eqs ea L UMS OMA IE NAA LUN RS n UU LUNES CR PUN S SEA 231 Bini dli c 232 Editar SBortCHEssd ao canted ensuite Eat o eaters ecd eu I causam reap edu cub Fc de 233 Navigation shortcuts oce de ped udis Rede ute De epa Rt Fea de qn Honda a aaas 239 ju sipicd stores mM 237 Special Javas ott US ares ema iet il aine dre E Dn dd onem evt gonna 239 Appendix B Default Editor Abbreviations eee 241 Appendix C Main Window Menus and Toolbars eese 246 jg E wang dacs 246 Tale TORIS n Nee oe tae prd uta p ee Mu bL utate DM de eu PNE 246 Edit Mehi abs ain isti ae Erin APA GT p MEI QR P bn del Linda nipote ded FERE tre Fo eeu 247 View DN OOo nuit e at ue lu o Fun EE A ae c eu o eA Su 247 Project MERU mei ale inte sue Pin sedeo etate Cuota lute deat bale p Se etui bebo GE RASA LU 248 Douleur uet bah ai cu dus dc Me alc er dde denda onmes 249 195Dus IMC EIU n iet ehties aa be tere hts rant had au cO e
63. right click on the root Project node and choose 156 Chapter 8 Organizing work into projects 6 Add New from the contextual menu gl Explorer Project t3 olx Add Existing Compile Build Execute Ctrl Fa Rename Tools Properties In the New From Template wizard that appears expand the appropriate template category node for example Classes and then select one of the templates In the right panel of the dialog a description of that template will appear Press Next to move to the Target Location page of the wizatd In the Name field type the name you want to give the object Do not type the extension for the file type It will be added automatically In the same page of the wizard choose a package for the template You can do this either by typing a package name in the Package field or by selecting one of the packages shown in the tree view just below it Press Finish to exit the wizard and have the template created You can also create new files in existing packages much as you would under the Filesystems tab in the Explorer To add a new file to a package in the project 1 2 Select the Project tab in the Explorer right click on a package in its hierarchy and choose New From Template from the contextual menu and navigate the submenus to choose a template The second page of the New From Template wizard will appeat Fill in the wizard page as described in steps 4 and 5 of t
64. the Component Inspector and select the Events tab on the property sheet 134 Chapter 6 Designing Visual Classes with the Form Editor 2 Select the event in the property sheet and then press button that appears to bring up the Handlers custom property editor 3 In the Handlers For dialog box click Rename and then enter the new name for the handler in Rename Handler dialog that appears Adding multiple handlers for one event The IDE also enables for the possibility of adding multiple handlers for one event with a custom property editor To add multiple handlers for an event 1 Select the object in the Component Inspector and select the Events tab on the property sheet 2 Select the event in the property sheet and then press button that appears to bring up the Handlers custom property editor Using this editor you can add and remove multiple handlers Using the Connection Wizard The Connection Wizard enables you to set events between two components without having to write much or any code by hand When you choose two components to be connected the first is the one that will fire the event and the second one will have its state affected by the event To start the Connection Wizard 1 Switch to connection mode on the Component Palette see Connection mode on page 115 fs ar 2 Next click on the two components first the component with the source event and then the target component You ca
65. the IDE at the project level such as changes in workspaces and Project Settings when you end your session with the IDE Creating new projects When you create a project you give a name to the current IDE state and then that information is stored in the IDE Current Project Settings such as settings for compiling execution and debugging are saved for the new project The only Project Settings not saved are the Filesystems Settings Any directories mounted under Filesystems except for the Default system directory the default Javadoc directory and Timerbean jar are removed from the new project To create a new project 1 Choose New Project from the Projects menu 2 When prompted type a name for your new project and click OK 3 You will be prompted whether to use the file system or file systems currently mounted in Filesystems ot whether to remove them and mount a new one If you click New the Development directory and any other directories or JAR files you have mounted in Filesystems will be removed and a file chooser will appear for you to select a new file system to mount If you click Old all file systems currently mounted in Filesystems will remain there 4 You will be prompted whether to save the current project If you click Yes any changes you have made to your current project will be saved before it is closed and the new project is opened 5 The file chooser will then appear prompting you to pick a directory to mount und
66. the Projects tab and work with them just as you would under Filesystems Mounting different file systems for different projects You can mount different file systems for different projects When you create a new project all Filesystems are removed from the Filesystems tab in the Explorer You ate then prompted to mount file systems that you need for that project See Mounting file systems on page 75 Likewise you can configure Filesystems Settings such as whether to display or hide each mounted file system individually for each project See Filesystems Settings on page 178 Compiling building executing and debugging projects You can simultaneously compile or build all files you have added to a project and execute or debug a project according to the main class you have set You can access these commands from the Project menu or with the keyboard shortcuts given below e Compile Project SHIFT F9 compiles all classes in the projects which are not compiled or have been changed It recursively goes through all packages added to the project like Compile All does Build Project recompiles all classes in the project recursively going through all packages 158 Chapter 8 Organizing work into projects added to the project like Build All Execute Project CTRL SHIFT F9 executes the project by executing the main class If necessary the project is first compiled Debug Project CTRL SHIFT F5
67. the calls to your version control system for example to retrieve status information happen automatically behind the scenes However there are some actions that must be performed manually such as committing changes When you have mounted a CVS file system a new node appears under the Filesystems tab of the Explorer with the label CVS your CVS To dispatch commands to the version control system right click on the file or directory you want to apply the command to choose CVS from the contextual menu and then choose the command from the submenu Note Since the CVS module is designed to work across many platforms and operating systems some configuration is necessaty to get the systems interacting properly CVS is called from within the context of a command shell Using the CVS module Before you begin If you have not already done so download and install CVS on to your system The GNU web site at http www gnu org is one place whete you can obtain a copy of CVS as well as more information You will then need to configure the CVS module accotding to your needs and set up the wotking directory it will use see the sample project below Important If you have not worked much with CVS we strongly recommend that you take the time to familiarize yourself with the documentation for it The documentation is available from http www gnu otg manual cvs 1 9 html chapter cvs toc html 163 Chapter 9 Integrating a CVS version contro
68. the window is the property sheet pane which displays the properties and their current values for the selected node in the left pane By default the Debugger Window opens as part of the Debugging workspace when you start debugging an application zal Debugger Window Breakpoints 13 Breakpoints ES A ly m M Line examples advanced Memory View 238 ie B examples advanced Memo ES Breakpoints Note This window is a separate view of debugging information available in the Explorer under Runtime Debugger with the Properties window open 58 Chapter 3 Developing Java Applications Breakpoints The Breakpoints tab simply lists the currently set breakpoints showing the class name and the line number or method on which the breakpoint has been set To add a new breakpoint to your code 1 2 or Position the insertion point at the desired line in the Editor window Choose Add Remove Breakpoint from the Debug menu ot toolbar in the Main Window right click on the line in the Editor and choose Add Remove Breakpoint from the contextual menu or use the keyboard shortcut CTRL F8 The current line will be highlighted blue to indicate that the breakpoint has been set Choose New Breakpoint from the Debug menu or toolbar to bring up the Add Breakpoint dialog box Choose the type of breakpoint either exception method or line from the combo box Enter the settings exception class name class
69. to bring up the Proxy Configuration dialog box See Adjusting proxy and firewall settings on page 196 for more information Click Next to move to the second page The IDE will access the Forte for Java web site where the latest versions of all modules ate available Depending on your system network configuration this may mean your machine will dial and connect to your ISP Once connected to the Forte for Java Auto Update web page it will determine which modules are missing or not current in your IDE Wait for the IDE to finish its check of the web site When the check is finished the status line at the bottom of the wizard page will report whether any new or updated modules are available If it reports Done Updates Available click Next to move to the third page The third page of the wizard displays a list of modules that you do not have the most recent vetsion or any version of In the Available Modules list select the ones you would like to install and click Add or Add All if you want to update all of the modules If any modules have interdependencies for example new module A requires the updated module B the required additional module updates are automatically selected Note After you select a module or modules to be downloaded and click Add or Add All you will be presented with the license agreement which you will need to accept before any modules can be downloaded 6 The Details panel provides informa
70. using in place editing of the name in the Explorer Workspace clipboard operations act recursively copying a workspace copies all windows present on that workspace If you then paste the new workspace to the workspace hierarchy these windows are copied to that new workspace On the property sheet for each workspace node is the Toolbar Configuration property where you can choose from among different sets of toolbars to display in the workspace See Toolbar contextual menu and toolbar configurations on page 217 for information on creating your own toolbar configurations To create a new workspace 1 Choose Project Settings from the main menu 2 Right click on the root Workspaces node and choose New Workspace from the contextual menu A dialog box will open enabling you to specify the name of the new workspace 3 Type the workspace name and click OK 222 Chapter 11 Configuring and customizing the IDE The new item will appear in the given tree in the Project Settings window and immediately be displayed on the Main Window If you need to expand the workspace tab area on the Main Window to see your new wotkspace click and drag the workspace tab divider to the right If there are more workspaces than are visible in the workspace tab area left and right scroll buttons will be displayed enabling you to scroll through all available workspaces To delete a workspace Right click on the workspace s tab in the Main Window and ch
71. word that begins like the current word and complete the current word so that they match CTRL4 1 Word Match find the next word that begins like the cur rent word and complete the current word so that they match DELETE Remove character after the insertion point SHIFT SPACE Insert space without expanding abbreviation ALI Select the word the insertion point is on or deselect any selected text Table 23 Indentation shortcuts Keyboard With no selected y With selected text shortcut text TAB Insett tab Shift selection right SHIFT TAB Shift selection left CTRL t Shift line right Shift selection right CTRL d Shift line left Shift selection left Alt f Reformat the entire file Reformat the selected lines Table 24 Capitalization shortcuts Keyboard With no selected y With selected text shortcut text ALT u then u Make the character after Make the selection upper the insertion point upper case case ALT u then Make the character after Make the selection lower the insertion point lower case case 238 Appendix A Default Keyboard Shortcuts Keyboard With no selected i y With selected text shortcut text ALT u then r Reverse the case of the Reverse the case of the character after the inser selected text tion point ALT u then f Reverse the case of the Reverse the case of the first character of the iden first character of the tifier the insertion point is selected identifier on Al
72. workspace to change when you run a class To set the workspace the IDE switches to for debugging 1 Choose Tools Global Options from the main menu to open the Global Options window and select the Debugger Settings node 2 Click on the value of the Workspace property to access the drop down list of available workspaces and then choose a workspace You can also set this property to None if you don not want the workspace to change when you start the Debugger 223 Chapter 11 Configuring and customizing the IDE For more information on workspaces see Workspaces on page 188 Opening files from outside of the IDE Many programs have the ability to associate specific commands with file types generally by extension or MIME type so that the user may select a program to view ot edit that type of file Examples include the Microsoft Windows desktop and Explorer assorted file browsers available for Unix and other operating systems as well as alternatives on Windows machines web browsets version control systems mail programs and so on If you wish you can associate the IDE with certain file types such as Java sources or property bundles so that the IDE s editor will be opened when you double click on the file In Windows installations of Forte for Java the installer gives you an option to associate java files with Forte for Java If you select this option you can double click on java files outside of the IDE to open them i
73. 3 Chapter 5 Developing and Customizing JavaBeans Components Bean To generate Beanlnfo for a class 1 Right click on the Bean Patterns node in the class and choose Generate Beaninfo from the contextual menu The Generate Bean Info dialog box will appear The left panel shows the three main nodes Bean Info Properties and Event Sources and the right panel shows the properties of the selected node Generate Bean Info Bean Info Q B Properties m4 x Icon 16x16 Color A ai Icon 16x16 Mono 4 background 44 rootPane Icon 32x32 Color A dropTarget Icon 32x32 Mono 734 i dni Default Property Index 44 locationonScreen Default Event Index 2 bounds 24 components 26 layout 2 JMenuBar MJA uaczDana 2 Make any desired changes to the properties and then click OK Note The JavaBeans component properties referred to in the Properties node should not be confused with the word properties as generically used in Forte for Java to refer to characteristics and settings as displayed in each object s property sheet of parts of the IDE and objects stored in it Thus in the Bean Info Generation dialog box we refer to properties of JavaBeans properties nfo node The first four properties example Icon 16x16 Color enable you to designate icons for the bean by entering the relative path to and name of a graphic file using a resource path The next two Default Property Index and Default Event
74. 9 Chapter 3 Developing Java Applications See Navigation shortcuts on page 233 for a complete list Text scrolling shortcuts These shortcuts enable you to scroll the text without moving the insertion point CTRL UP Scroll the text one line up while holding the insertion point in the same position CTRL Down Scroll the text one line down while holding the insertion point in the same position ALT t scrolls the text up so that the insertion point moves to the top of the window while remaining at the same point in the text ALT m scrolls the text so that the insertion point moves to the middle of the window while remaining at the same point in the text ALT b scrolls the text down so that the insertion point moves to the middle of the window while remaining at the same point in the text If you add SHIFT to any of the last three key combinations in this list the insertion point moves to the top middle lower part of the window and the text does not scroll Navigating files with the jump list You can move through a file or files by using keyboard shortcuts to jump straight to parts of the file where you have been previously working The Editor maintains a jump list where each entty represents a point in a file where you have added or deleted text or which you have navigated to with the find function You can use the following keyboard shortcuts to navigate to points in your files according to the jump list
75. CR COR E ub cu RA 184 Start MM MD M E HN EN 184 Component Palette zz oso nox acetate carie a i I UTI EU OR det e aa D EI IUS 184 PBC LATHES coi tet eiit bees tio a Piu resisto Caelio Stace anil Bolt ad tup ymin tts alt at ana yt 184 NDS PSST Set neo o diee aibi ovibitaia D Ge Motel d ird aita bates ted a ovi Fabia ol 185 Bie uris aire DE 185 Editor Setting sss oin n hein cM RM defines ayaa a tollet ER ROIG indo d 185 Execution Setalibsu can what mda aem a nq d E 185 DO Cb LS ossa aira aah ls tdt putida dto dm otiosus cR LAU MA 185 HEMI BOWS GE n dt deua cio br Di tco eco Bao iu v nd Unc ch Pn ubi a a 186 HELE SEO ato esten DD foe d d Dude Roe a niet teftc a 186 JSP etcetera ene nee er ce e eu he BAPE REMO Qu Siu Mt dus 186 Java Elementen oq epos eere D eli b itte ee eodd n e a rie Pt add aad vas dha e etae does 186 Ope A Pile Server de bed n bad de tne Nd PRI atu do ee 186 Output Wind Wiens maanani naaa o awn fla fa Cherie ER aber a aim to 186 PET OCINE S PM aT dM Mp M EA T 187 Property eel uoa aie nut s estelar Minh a old CU uoa E Minn vont HEU DE 187 Syste SOCUTISS coc simui aedium ta dtt edt eite a lena midi cule ea TREE 187 Update Center ae tect pati tech m daa pata dee a a el yh Gute UNA ain PVA c rix e 187 Window tamdg SIGN Es s ieiivca putent eerie U ep nora Fr sid d UN2 6 ne Dias ep i SF whedon ei Ple vkI Ee e UO XE Eee 187 fenore M S 188 NIcnnricelbgecnre d a 188 Auto
76. Chapter 11 Configuring and customizing the IDE _ NAME name of the class PACKAGH name of the package that the class is in PACKAGE SLASHES name of the class s package but delimited with slashes instead of periods QUOTES inserts a double quote mark This macro is necessary if you want to place a macro between quote matks If you enter directly quotes text substitution for any macros occurring with the quotes will not be performed when an object is created from the template Creating and editing macros The IDE also has the USER macro signifying the user of the IDE which you can edit in the Strings Table property editor In addition you can add your own macros To edit macros or create new macros for use in templates 1 Choose Project Settings from the main menu to open the Project Settings window 2 Select the Java Sources node select the Strings Table property and click the button to open its custom property editor You will see a list of the macros in the form MacroName Value without the two underscores both before and after MacroName 3 Make any desired changes to the macro values or add new macros to the list Advanced macro feature The IDE also provides a feature enabling you to determine the suffix in the instantiated object conditionally The syntax for this feature is MacroNameS Parami Param2 Param3 where Param2 replaces Param if the value of MacroName ends
77. Classes with the Form Editor When a fotm is opened the IDE by default switches to the GUI Editing wotkspace and the following three windows are displayed e Form Editor window the design time view of the form e Editor window contains the Java source for the form If the Editor is already open the form is opened on a new tab within that Editor window Component Inspector displays the hierarchy of components on the active form including the layout managers menus buttons and non visual components such as timers The current selection of components is highlighted Tabs on the property sheet in the bottom panel display the general expert code generation and layout properties as well as the events of the selected component See Property Sheet pane in the Component Inspector on page 117 Fi Editor MyNewClass E x Component Inspect Miel E3 2 Explorer Filesystems 3 Filesystems E MyNewClass JDislog 1 Q9 D Fore4JCE 488 Development EJ Non visual Components 2 MyNewClass java Q examples Ei BorderLayout 3 G advanced 4 E Memory View 5 E Memory ViewLocale 6 7 texteditor z Gi tutorial E MyNewClass Uem Hora a background C 204 204 204 Default Cursor Dialog 12 Plain Bl black False dialog cursor defeuliCloseOpereti font MyNewClass 17 public MyHewClass java
78. Customizer is a dialog box which can be used for advanced customization of a whole object at once It is available by selecting Customize from an object s contextual menu or by tessine the Customize icon on an objects property sheet P 8 J property 292 BM jikes E Index Index A abbreviations in Editor 41 complete list of 241 customizing 211 absolute layout See layout managers access modifiers 93 action pool 183 complete list 279 applet viewer 59 AWT palette colors 289 B Bean Patterns See JavaBeans components bookmarks 184 Border Editor 289 border layout See layout managers Bounds Editor 290 box layout See layout managers Build All command 50 Build command 50 C Capabilities tab 179 card layout See layout managers class path 75 classes creating 33 creating with the customizer 94 Clean All command 51 Clean command 51 cloning windows 193 code completion See Java code completion code generation 128 131 container generation properties 130 modifying 128 options 130 Color Editor 288 color properties AWT palette colors 289 RGB 289 Swing palette colors 289 Compile All command 50 Compiler Types 180 reference 256 setting 54 switching 51 compilers built in support 51 configuring 54 switching 52 compiling 49 54 Build All command 50 Build command 50 disabling compilation for a class 53 packages 50 single classes 50 Component Inspector 27 112 property sheet pane 117
79. Debugger Trace Into Trace into the method the debugger has halted at 280 Appendix E Actions Action Description Trace Out Halt execution after the current method finishes and control passes to the caller Irace Over Trace over the method the debugger has halted at Table 64 Edit Actions Action Description Copy Copy selected object to the clipboard Cut Cut the selected object keeping a copy in the clip board Delete Delete the selected object Find Find specified text in Editor Goto Go to specified line number in the Editor Paste Paste from the clipboard Redo Redo undone action Replace Replace in text Undo Undo last action Table 65 Form Actions Action Description Add to Component Palette Add the selected class to the Component Palette Component Inspector Go to the selected component in the Component Inspector Component Palette Install the Component Palette Customize Layout Bring up the customizer dialog for GridBag Lay out Design Mode Put the Form Editor in design mode Events List events for selected component Goto Form In the Form Editor window go to the selected component 281 Appendix E Actions Action Description Goto Inspector In the Component Inspector go to the node for the selected component Goto Soutce
80. E jumps to when a form object is opened Apply Grid to Posi If True the position of components is snapped to grid if a tion grid is used Apply Grid to Size If True the size of components is snapped to grid if a grid is used Connection Border Color Color of components selection border during connection mode Drag Border Color Color of components drag border duting dragging Selection Border Color Colot of the boxes around a component which mark it as selected Selection Border Size Size in pixels of the boxes around a component which mark it as selected 270 Appendix D Reference Guide to Project Settings and Global Options HTML Browser reference Table 50 HTML Browser properties Property Description Default Background Background color of HTML pages Fixed font The base fixed width font used in HTML pages Proportional Font The base proportional font used in HTML pages HTTP Server reference The last two properties in the following table can be found under the Expert tab of the property sheet Table 51 HTTP Server properties Property Description Grant access to Specifies machines which enable access to the HTTP servet Machines are entered as a comma separated list of IP addresses Host Host has two possible settings Any Host ot Selected Hosts Selected Hosts restricts access so that only the mac
81. E key BACK SPACE e TAB key TAB e INSERT key INSERT d DELETE key DELETE e LEFT arrow key LEFT e RIGHT arrow key RIGHT e UP arrow key UP e DOWN arrow key DOWN e HOME key HOME 210 Chapter 11 Configuring and customizing the IDE END key END Page up key PAGE UP Page down key PAGE DOWN Multi step keyboard shortcuts where a combination of keys of pressed and released and then another key is pressed are marked in the form A1tU P f meaning press ALT u and then press f Note You cannot set a keyboard shortcut for anything that is not in the Action combo box in the Edit dialog box To change keyboard shortcuts for a specific editor type 1 Choose Tools Global Options from the main menu 2 Expand the Editor Settings node in the Global Options window and select the subnode for the editor type you want to set the shortcut for 3 Select the Key Bindings property and click on the button This will bring up the Key Bindings custom property editor 4 Follow steps 4 and 5 of the previous procedure Customizing Editor abbreviations For each type of editor you can set and modify abbreviations for use in the Editor window By default abbreviations are already set for the Java and JSP editors To change the Abbreviation table 1 Choose Tools Global Options from the main menu 2 Inthe Global Options window expand the Editor Settings node and select the subnode for the type
82. Editor Using the Form Connection property editor on page 139 55 Property Editor foreground Color ColorEditor Form me r Get Parameter From O Value Bean Property No Property Selected Method Cal ho Method Selected User Code Advanced Reverting to the default value for a property If you have changed a value that you later decide you would like to change back to its default right click on the property name and choose Set Default Value from the contextual menu If the value was changed in a custom property editor you can press the Default button in the custom property editor to revert to the default Working with layouts A layout manager is a special Java class that manages the positions and sizes of components in a container Frame Panel or any other visual component that can contain other components 119 Chapter 6 Designing Visual Classes with the Form Editor The Form Editor in Forte for Java has advanced support for layout managers In addition to absolute positioning complex forms based on Flow Layout Border Layout Card Layout Grid Layout GridBag Layout or Swing s Box Layout are supported See Standard layout managers on page 122 for descriptions of these layout managers Various containers come with different predefined layout managers Frame JFrame Dialog JDialog and JInternalFrame have the Border Layo
83. Editor window contextual menu You can access many of the commands you need in the Editor window by right clicking and choosing the command from the contextual menu The following commands are available when you ate editing a Java file Show Javadoc assuming that the proper Javadoc directory is mounted under the Javadoc tab of the Explorer opens the web browser on the Javadoc documentation for the identifier that the insertion point is on or immediately before or after Go to Source opens the soutce file for the the identifier that the insertion point is on or immediately before or after and moves the insertion point to the relevant section of code For this command to work the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source See Adding your own classes to the parser database on page 43 Go to Declaration moves the insertion point to the declaration for the method or field that the insertion point is on or immediately before or after For this command to work the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source See Adding your own classes to the parser database on page 43 Reformat code regenerates the automatic code formatting for the current file or for the selected text if any text is selected Save saves the current source file Compile compiles the current s
84. Generate Null Layout propetty to True 2 When designing your form select the Absolute Layout layout manager Using the GridBag customizer Forte for Java Community Edition provides a customizer to simplify the creation of GridBag layouts To use the visual GridBag customizer 1 Add the components you want to use and make sure that you have GridBag Layout set Note It is helpful to sketch out the way you want your layout to look before you open the customizer 2 Right click on the GridBagLayout node in the Component Inspector and choose Customize Layout from the contextual menu ot choose the Customize button on the property sheet pane The Customizer Dialog will open with a property sheet for GridBag constraints and buttons for adjusting the values of the constraints in its left pane and a 125 Chapter 6 Designing Visual Classes with the Form Editor rough depiction of the placement of your components on the form in its right pane E Customizer Diao rmn rz m 3 You can reposition the components in the right pane by dragging them As you drag the component its Grid X and Grid Y properties will change to reflect its new position Be aware however that this panel only serves as a rough guide and does not reflect the absolute positions of the components The position of each component is largely govetned by other constraints set in the left pane The Form Editor window more closely reflects how the components will look
85. ITE ONLY or both methods READ WRITE generated Check the Bound meaning that property change events must be fired when the property changes and or Constrained meaning that the property change can be vetoed options if applicable to the property The usefulness of checking these options is enhanced if you 99 Chapter 5 Developing and Customizing JavaBeans Components also check the Generate Property Change Support option see below i New Property Pattern LX Property Name x Mode Read Vwrite m _ Bound Type _ Constrained Options _ Generate field Generate return statement Generate set statement Generate property change support ECEN M If you click OK after these steps the definitions of the methods will be generated However you can also check all or any combination of the following options e If you check the Generate field option a private field is generated This field will have the same name and type as the property e If you check the Generate retum statement a statement that returns the field for example return myProperty isinsetted in the body of the getter method e If you check the Generate set statement option a statement setting the value of the property field to the value of the setter parameter will be inserted into the body of the setter method If you check Generate property change support all of the code needed for
86. RU dag ln 263 Editor Settings reference oie rae eek ad RENTA EDU CYVAN RR RENE EDR UE RERO ER VU VM AMAN VR TUYO TUE 265 Global Editor settings a aito tesi a Oise dC iP dl ad dae disi ib aso a aid avi dita ois 265 Editor setings DYAVOQ OL COLO ta naniii qua Rauquet ub t d Pte T UO HR Rd UE 266 Execution Settings fefetence ouo eio ran ERR CI cowl FUHR RUE LEVA CAE CY TREE GR caves 2 MR XE IUE 269 Fotin Objects reference eouno cusa auta n od sun Rn a UR Ua i s MR MIN MR Ida 269 HTML Browser feference osi uisus PI EE NEAN RI AW RON WA M CUP SEE EUR S tX VE QE TE I EUM 271 H TIP Servet reference uve eoi ex auae Iu venu ha Pod pn eese o t una pU Sasuke i tas 271 JSP and Servlets Fefere nee oues scoe mi rsen P Nd HUN ESAME PEE F UE I LEE rr a RAM IA EAR 272 Java Elements reference voiiei es qoi qe pelo E PORK E ANS POR SEQ PE RAS FORI APO RENE Pet MA pE e E PARURE 272 Open File Server reference uit ais o OUR OR ERAS D MOI n MO E 274 Output Window reference oec eth Ia OR IAS IE PER IRIS ES ERES PEN RORIS AERE D NS DER QV USE ta VN UNTEN 275 Print Settings eference acento inte i teer fer Leno tere afe d Odi 276 Property Sheet refe ke nce io sio ibt en Or EO Dea EVA ans SEN AEE EEE TN REE 277 System Settings reference varred iain eiiiai eaae aieia aeea PASS aaaea Sa ieda oaeiai nak 277 Update Center reterence s uou a ieee ERE EEEN ENE CERERE ENECO 278 Appendix EA CHONG dor eet eeaeee een aM UM sp e M Et ERI 279 Appendix F Custom Property Editors
87. Ry Sun microsystems Forte for Java Community Edition User s Guide Sun Microsystems Inc 901 San Antonio Road Palo Alto CA 94303 U S A 650 960 1300 Fax 650 969 9131 Part no 806 4570 10 Revision 1 February 2000 Copyright 2000 Sun Microsystems Inc 901 San Antonio Road Palo Alto California 94303 U S A All rights reserved This product or documentation is protected by copyright and distributed under licenses restricting its use copying distribution and decompilation No part of this product or documentation may be reproduced in any form by any means without prior written authorization of Sun and its licensors if any Third party software including font technology is copyrighted and licensed from Sun suppliers Sun Sun Microsystems the Sun logo Java JavaBeans Forte and NetBeans are trademarks or registered trademarks of Sun Microsystems Inc in the U S and other countries U S Government approval required when exporting the product DOCUMENTATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO ANY KIND OF IMPLIED OR EXPRESS WARRANTY OF NON INFRINGEMENT OR THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE Copyright 2000 Sun Microsystems Inc 901 San Antonio Road Palo Alto Californie 94303 Etats Unis Tous droits r serv s Ce produit ou document est prot g par un copyright et distribu avec des licence
88. V utbs 249 Dools COU s d eres Eo rali ba ted re Da po bat ait bind eri pais teda Putat bale ita ta EPI 250 Window MORI meia ardeat atus ado NUR lc S ue A m MD P ULL ola ha AV SENA Le 251 HeD Nis air pM ED E Mt 252 STOOIDAES ode noted en erue tei desti ade a a ndis ensure ideis 252 Appendix D Reference Guide to Project Settings and Global Options 254 Filesystems Settings TELETEN CE oec epe uev HEN ERRE UN cand ousevuhadeusetusudsavuevuncavaiveseniederen 254 Workspaces reference PM 255 Compiler Types reference usse ra een SD ede EAR Up GO SION EVE SEU NE Ere E 256 Exeeuton Lypes feferenees usos eee PASS AR RE Orie a EaR TUR GNE ER QUR YS PAINT U E TERT INI SSES 258 Debugger Types teference ooi e nieve ir P Fibre EX MX ER UHR ESFERA RE LER VEN REN MA RARE V AEU 260 Search Types tefepence sostiene C NEU AN SDASEVAINS UR TE RUNS ERAS VES V AEN AS CAES IR RINT NER 260 Java Sources settings fCFerences ove es esee mei e p rf o o ne n al eds 261 Dolrcesviiehror Abo tio pope ARR p aa E ORE EAD Die E Mens pu steh Dvd beneath NE 262 Object Browser settings reference ccccsssscccssssrccesessnsccesssseceesssseesessesseseesssssaeeeesenseees 262 11 Contents Project OPLOHDS ondes Oben ASIE OE v eub m RA OP II QE AEE EE ESENS O oa EUM EU a EINER QS 262 Debugger Settings reference accedente en eei nbi aged eode ei nei ai aded euh edis 263 Documentation settings reference 2 oett ten a rta eS ASR REI RARE LEE FEET ERR a EUR o
89. Window menu on the Main Window or 0 Choose Dock into New Single Frame from either the Window menu on the Main Window or e the tab s contextual menu available by right clicking on the tab The active object will be removed from its original window and will appear in a new window This new window may be repositioned resized moved to another workspace and even closed all independently of the parent window You can position the windows side by side to view sections of source simultaneously or copy and paste code between windows Docking Docking windows enables you to reduce clutter on your desktop without having to close any objects and to view objects in a window that is more convenient for you 191 Chapter 11 Configuring and customizing the IDE You can dock any window tab or single window into any named container window such as e the Output Window the Debugger Window e the Editor window e the Explorer window Of other windows such as the Debugger Window Object Browser and Form Editor window when they are already open Of a new unnamed multi tab or single frame window Almost any single frame window or frame from a multi tab window can be docked into one of the windows above These include single frame windows such as the Properties window Object Browser internal web browser Execution View Javadoc Index Search User s Guide Auto Comment Project Settings Global Options Search Results and F
90. a setter with or without a set statement Click OK Creating event sets You can also add event sets to your bean To add an event set deliverable to only one listener 1 2 Right click on the Bean Patterns subnode of your class and choose New Unicast Event Source from the contextual menu The New Unicast Event Set dialog box will appear on the screen Use the combo box in the Type field to select or type in any listener interface event class 101 Chapter 5 Developing and Customizing JavaBeans Components type that extends java util EventListener gl New Unicast Event Set LX Event Set Type ad java awt event ActionListener java awt event ContainerListener java awt event FocusListener Celaya awt event java awt event MouseListener 3e java awvt event MouseMotionListener pdava awt event VvindowListener Com vm 3 Click one of the two radio buttons below the Type field to choose how you want the event set implemented The choices are e Generate empty generates an empty implementation Generate implementation generates a simple implementation for one listener 4 Check the Generate event firing methods box if you want to generate a method corresponding to every method in the listener interface to fire the event to all listeners 5 To specify how the event will be transferred to this method check the option Pass event as parameter This adds parameters
91. a hierarchical view of all files you use with the IDE including applications you are developing and Javadoc files and a view of running and debugging processes In the Explorer you can also mount directories that are on your local system ot netwotk so that they can be accessed from within the IDE The Object Browser which provides a Java oriented view of your classes From these two windows you can have code automatically generated for new classes and for specific elements of these classes In addition you can synchronize sources by having the methods for interfaces generated when you implement the interfaces in your code Through the Explorer you can easily generate JavaBeans components See Developing and Customizing JavaBeans Components on page 98 Chapter 4 The Explorer and Object Browser Guide to the Explorer The Explorer is not only a place where you can manage files but also a place where you can create objects and manage their properties using The contextual menu available for each node by right clicking on the node The Properties Window which is open by default in the Editing workspace and otherwise accessible by choosing View Properties from the main menu or Properties from the contextual menu of each item amp Explorer Filesystems Iof x 3 Filesystems Q G D Forte4J 489 Development Q X3 examples Q 3 advanced Q Ej MemoryView p class MemoryView e E Memory View JFrame E Memor
92. able if you generally work with non default service types for compilers executors and debuggers You can modify the content of a template in the Editor and the properties of a template on its property sheet To modify the contents of a template 1 Choose Tools Global Options from the main menu 2 Inthe Global Options window expand the Templates node and navigate to the template 3 Right click on the template s node and choose Open from its contextual menu The template will open in the Editor where you can edit its contents To modify the properties of a template 1 Choose Tools Global Options from the main menu 2 Inthe Global Options window expand the Templates node and navigate to the template 3 Make the necessary changes in the property sheet Tip If you want to make the same change to multiple templates for example switch all of them to JPDA debugging you hold down the CTRL key and select multiple template source files Any changes you then make on the property sheet will apply to all of the selected templates Using macros in templates You can also use macros in your templates to have various strings automatically generated when you create objects from template Macros are called in templates in the form __MacroName__ with two underscores before and two underscores after the macro name The following macros are provided by the IDE and are available for use in templates but can not be modified 202
93. ace The name of the workspace to which the IDE switches when the debugger starts or None if the workspace should not be switched Documentation settings reference Table 42 Internal Javadoc options Option Description 1 1 style If True comments are generated in JDK 1 1 style Encoding The source file encoding name such as EUSJIS SJIS If this option is not specified the platform default con vetter is used Extdits The directories where extension classes reside Locale The locale that Javadoc uses when generating documenta tion Use the name of the locale as described in java util Locale documentation such as en_US English United States Membets Determines which members will be included in the docu mentation If public shows only public classes and mem bers If protected shows only protected and public classes and members If package shows only package protected and public classes and members If private shows all classes and members 263 Appendix D Reference Guide to Project Settings and Global Options Option Description Overview File containing text to be used on the Overview page overview summary html Verbose If True Javadoc provides more detailed messages when running Table 43 Standard doclet options Option Description Author If True includes the author tag in the do
94. al Options Source synchronization Table 38 Source synchronization properties Property Description Return generation Generate either nothing an exception or the string return mode null when creating a new method declared to return a value Synchronization If False all synchronization is turned off enabled Object Browser settings reference Table 39 Object Browser properties Property Description Package Filter Custom property editor available to add delete and rename package filters to the Object Browser Project Options Table 40 Project Options Property Description Add to project If set to Ask each time you create a class from template you will be prompted whether or not to add the class to the cutrent project If set to Never you will not be prompted and the class will not be added to the current project when you create it If set to Always you will not be prompted and the class will automatically be added to the current project when you create it 262 Appendix D Reference Guide to Project Settings and Global Options Debugger Settings reference Table 41 Debugger properties Property Description Action on Trace Into The action that will occur when you use the Trace Into command on a method without available source Choose between Trace Out and Stop Run Compilation Compile sources before debugging Worksp
95. all applications currently being run within the IDE This window is actually a view of the Explorer hierarchy under Runtime Processes Execution View Iof x Q examples advanced Memory View By default the Execution View is opened on the Running Workspace When no applications are running it simply displays No Processes Running When an application or applet is running it is listed by name Each currently running process is listed As for many objects in the IDE a displayed process has a contextual menu In this window the menu contains just one item Terminate Process This enables you to force termination of the selected process Execution categories and executors You can run typical Java applications using either internal or external execution each of which have their advantages and disadvantages Applets can be run using Applet Execution see Applet viewer settings on page 57 for more information Java Server Pages can be run using JSP Execution see Configuring JSP Execution Types on page 151 Other execution categoties can be installed by extension modules External Execution Most applications use external execution and the templates that come with the IDE use it by default A new virtual machine VM is used for executing the application This enables you to run applications that require a special VM or need to do operations that are not possible with internal execution see below You can sp
96. also an Events entry on object contextual menus in both the Component Inspector and Explorer A new component does not have event handlers defined the values are all none Defining event handlers To define an event handler using the property sheet 1 Select the Events tab in the form object s property sheet either in the Component Inspector or the Properties window 2 Click on the value it should be lt none gt of the one of the events in the list Component Inspector jButt SEE MyNewClass JDialog E Non visual Components BorderLayout I jTextField1 JTextField jButton1 JButton on j jButton2 JButton Br pi acne me 2MousePressed v xc EIE 3 Choose a name for the event by e Pressing ENTER to have the default name automatically generated Typing a new name over the default name and pressing ENTER 133 Chapter 6 Designing Visual Classes with the Form Editor After you press ENTER the code for the listener and the empty body of the handler method will be generated If you do not press ENTER your changes will be ignored To define an event handler using the contextual menu 1 Expand the source file s node in the Explorer and then right click on its form object subnode 2 Choose Events and then move through the two submenus to choose the event The default name will be given to the event If multiple events ate of the same type for example foc
97. an open up a new Explorer window showing a limited part of the hierarchy by right clicking on a node in the Explorer and selecting Explore from Here from the contextual menu Redisplaying windows obscured by windows from other 193 Chapter 11 Configuring and customizing the IDE applications When switching back and forth between Forte for Java and other applications by clicking on the windows much of the Forte for Java IDE may remain obscured by windows from the previously active application To redisplay the entire Forte for Java IDE 1 Minimize the Forte for Java Main Window 2 Redisplay Forte for Java by clicking the icon for Forte for Java s Main Window All of the open windows will then be displayed over the windows of any other open applications If you select the icon for an individual Forte for Java window that window will be made active but it does not ensure that all of the other open IDE windows will be displayed over windows of other applications Modules in Forte for Java Forte for Java s modular architecture means that all parts even those central to the functionality of the IDE like the Editor Debugger and Form Editor are in module form There are also base modules for things such as the HTTP server the web browser and the creation of JavaBeans components In addition you can create your own modules ot add third party modules Updates to existing modules and new modules can be easily obtained and add
98. arch capability as well as its context help and tool tips can provide answers to many of your questions JavaHelp You can view the User s Guide through a JavaHelp browser by choosing Help Documentation User s Guide from the main menu The JavaHelp viewer is divided into two panes The left pane lists topics and the right pane provides the content of the topic selected in the left pane The toolbar at the top of the left pane has three icons which enable you choose what is shown in the topics list Clicking the first button displays the User s Guide s table of contents and clicking the second icon displays the index The table of contents appears as a tree with 30 Chapter 2 IDE Essentials expandable nodes and sub nodes TESTER EIFE Master Index Preface D Before you read this D How this book is orga 77 Conventions Used In D Contact Information F Chapter 1 Welcome to Foy Source synchronization Product features 2 Chapter 2 IDE Essentials 7 User interface 7 JavaHelp context hel Source synchronization is a feature that helps to keep your Java source files current by Creating new classes 7 Editing Java sources 7 Compiling Java sourc Eal Running Java classes 77 Debugging Java class Using the Output wine 3 Internal web browse automatically generating an interface s methods for you when you implement that interface in a source file
99. ard tutorial regular expression To add an expression to a filter 1 Select the filter and click Add 2 Click the radio button for wildcard or regular expression and type the expression in that field 3 Click Change To change an expression in a filter 1 Select the filter in the list of filters in the Package Filter dialog box and select the expression to be changed in the Details list for example com 2 Continue with steps 2 and 3 of the add filter procedure Other buttons Pressing Remove takes the selected filter expression out of the selected filter e Pressing Delete removes the entire filter from the pull down menu 90 Chapter 4 The Explorer and Object Browser Browsing and exploring objects and their elements You can view members of classes in both the Object Browser and the Explorer Source files in a file system are represented as Java objects Each source file node contains at least one class node as well as code representing members such as methods constructors and variables In the Object Browser the top level and inner classes are shown in the Objects pane with all of their members appearing in the Members pane In the Explorer classes named inner classes and members are all represented hierarchically in subtrees of the Java objects If you want to change the way the nodes for elements are labeled you can choose Tools Global Options from the main menu select
100. are prompted to check for updates See Adding modules with the Update Center on page 194 for information on using the Update Center Window management Forte for Java has the following features which when combined give you a great deal of flexibility in managing windows on your desktop 187 Chapter 11 Configuring and customizing the IDE Workspaces meaning window sets each geared toward a given task for example editing GUI editing browsing running or debugging When you switch workspaces the current set of windows closes and a another set opens Multi tab windows which hold multiple open files at once and enable you to flip between files by clicking on a tab Docking of windows which enables you to change the windows in which window contents are displayed for example you can move a source file from a multi tab Editor window to its own window or to a different already existing container window such as the Output Window Cloning of windows which enables you to have the same file open in two different windows making it easier to work on two different parts of the file at the same time Cloning is available for the Editor web browser and help windows Workspaces As you progress through the development cycle write compile debug execute edit and so on when working on any significant project the screen can become cluttered with windows While all of these windows ate necessary for development they are ge
101. at controls the number of rows and columns the titles object types and so on To open the custom property editor for a JTable or JList 1 Access the object s properties for example through the Component Inspector 2 Choose the Properties tab 3 Click on the button for the entry for the model property The JTable custom property editor has tabs for Table Settings and Default Values The JList custom property editor enables you to add delete and rearrange list items Note These custom editors only provide the ability to edit simple models of relatively fixed structure More demanding applications can not use these visual editors For live data with changing structure create your own model in code and assign it to the table or list in the form s constructor or as the value for the model property using the Form Connection property editor MDI Applications Using JDesktopPane and JInternalFrames Swing makes MDI Multiple Document Interface windows within windows easy to implement The model is like traditional computer windowing systems In a windowing system you have a desktop with windows on it With the Swing MDI you use a JDesktopPane with JInternalFrames on it The user can position the JInternalFrames like windows on a traditional desktop as well as resize close and minimize them Forte for Java Community Edition lets you lay out and define all of this interactively You typically start with a JFrame and then add a JD
102. at the selected level in the hierarchy Build All Builds all objects in the selected package and recursively in all subpackages Cut Copy Delete Rename Standard clipboard style operations Paste Copy Pastes a copy of the object most recently copied under the selected node Paste Create Link Creates a link under the selected node to the most recently copied object The object remains stored in the location where it was copied but it can also be opened from the node where the link is pasted Paste Instantiate Creates a new instance of the copied template only avail able when a template is on the clipboard Paste Serialize Serializes the instance of the copied JavaBeans object and places it in the selected package Paste Default instance Places the default instance of the copied JavaBeans object in the selected package meaning that the name of the class is stored and the class name is provided as the default con structor in the pasted copy 79 Chapter 4 The Explorer and Object Browser Command Description New Package Creates a new empty package as a sub folder of the selected package New from Template Creates a new object in this package using one of the pre built templates available under the Templates node in the Explorer Tools Update Parser Database Updates the Java parser database with the classes of the selected package thus
103. ation LO A Clas Siccin Po oven eleme i uet es ied A 53 coner Comple Systema ia aa a E A du Dc Ebo Ss 54 Setting compiler types in templates uie ciet terat che cd nid tege el bre ai aA 54 Runnin Java Classes pios PAG EASY S EURSVER EEE EXHHXAN PASSEN EASIER PA NENT REA veunedonpearceonvesvenas 54 Fete CUM OM d Tm 55 Execution categories and executofs oque dete ee iare bri hl o i teeta Fade deeded 95 Ida doceri M 56 Switching the default xecutot iunaueisnononetaupab sion nio ei ir iei re i RRRA 57 Contipurino external executots z auae eed Iu er E SEU Hn et eed 58 Setting executors n templates ere eere ien eee eere ae epe eed rere 58 Passing command line arguments to executed applications sssssssseeee 58 Execution Settings NOL Erni o pede orte eter i b oix ed aee as ie 59 Applet Viewer Seinos Cite aout Mash Bu det ud eb ee aD UR b s dn NU c DD 59 Debugeins Java classes usce o I S EE KHH AERE 3 SAX EEE EK RARE AE YN NES ARKS QE XX EN MEAN RR EEEE 60 Debugger Windo Wust eot le ei Edible aic n de nativi dtf capat a ted lrae iwi Cai LORE 60 Break olio va e oos son deant ufui s rea o ta wl date Moti Me EUN 61 AT FAG MM EU NE 62 Contents Watches o dedans tasti iati toco fed iri Xd toca dev br Vo i tei co p LER a a SEU 64 he Cebus SS SES SIO coat nanni ec babita Rute i Dui ie iso d d C entra ODE DAN npa 66 Suspending and resuming debugging sse tenentes 67 Changing the current th
104. ation of toolbars and create a name for it thus creating a new configuration You can set the toolbar configuration separately for each workspace To set a toolbar configuration for a workspace 1 Choose Project Settings from the main menu 2 Select the node for the workspace under Workspaces in the Project Settings window 218 Chapter 11 Configuring and customizing the IDE 3 On the workspace s property sheet choose the configuration from the drop down list on the Toolbar Configuration property Changing commands in contextual menus You can also change commands that appear in various contextual menus in the Actions property editor The items in the various contextual menus are determined by the type of object the menu is for To open the Actions property editor for an object type 1 Open the Global Options window by choosing Tools Global Options from the main menu 2 Expand the Object Types node and select the subnode for the object type you would like to change the contextual menu for You can determine which object type to change by matching the icon of one of the nodes you want a different menu for and finding the same icon in the list of object types 3 Select the Act ions property and then press the button that appears A two pane custom property editor will appear The left pane displays available commands that you can add to the contextual menu The right pane displays the commands cutrently in the co
105. atus The files should appear with the status Up to date Begin editing one of the files You can now work with your files as you wish Try adding some code to one of the classes you haved added and save your changes If you then right click on the class and choose the CVS Refresh command from the contextual menu the results will show that the files have changed Then right click on the class s node and choose CVS Commit from the 165 Chapter 9 Integrating a CVS version control system contextual menu Your file s status will change from Locally Modified to Up To Date Note If you use CVS keywords such as Log ina file you will be prompted with a dialog box informing you that yout file has been updated outside of the IDE when you choose the CVS Commit command on that file Tip At any time you can use the CVS Refresh command on any file or directory to refresh the status information Use the CVS Refresh Recursively command to start asynchronous status retrieval of an entire directory tree This can improve the speed of browsing files on large projects otherwise Refresh commands are dispatched to the version control system as you open folders It is advisable to refresh recursively after major changes to your version control directory structure The refresh process can be stopped at any time if desired CVS commands The following are the vatious CVS commands available under the CVS submenu in the contextual menu for
106. available documentation for Forte for Java extension modules any available modules that are not patt of the base Community Edition can be found under Help Documentation ModuleName The help file is part of the module itself and becomes available once the module is installed in the IDE 199 Chapter 11 Configuring and customizing the IDE Using templates Templates are a powerful IDE tool You can use them to create new objects which then can be used as a basis for creating more complex objects Java components such as Swing and AWT containers are one type of template There are also various templates for classes dialog boxes and other objects such as HTML files text files and bookmarks Even empty classes have templates You can also create your own templates Creating new objects from templates You can create a new object from a template in one of the following ways By using the New From Template wizatd which you can access from the Main Window Explorer or Object Browser For details see Creating new classes on page 33 e By double clicking on the template itself either under the Templates node in the Global Options window ot in the Explorer under the Filesystems tab if the object has been set as a template there e Bycopying the template using the Copy command from the Edit menu or toolbar contextual menu or keyboard shortcut and then selecting the target folder and choosing Paste Instantiate fr
107. awt Frame parent boolean modal 18 super parent modal 19 initComponents foreground private void initComponents 29 addWindowListener new java awt event Windowhdapter 30 public void windowClosing java avt event WindowEvent evt closeDialog evt If the Explorer is open a form node which is given the name of the class followed by the type of form in brackets will appear in the source file s hierarchy If you have closed or minimized one of these windows and need to redisplay it right click on the form node in the Explorer or Component Inspector and select Goto Form for the Form Editor window Goto Source Editor window or Goto Inspector Component Inspector Note In Forte for Java Community Edition forms are stored in the XML format When opening forms saved with NetBeans Developer 2 0 2 1 X2 or eatly betas of 3 0 you will be 112 Chapter 6 Designing Visual Classes with the Form Editor asked whether you want to convert the form to a new format If you click No the form editor will have the same features as in X2 and the saved form will be compatible with X2 However some of the new features such as multiple property editors per property and most code generation properties on components will not be available If you click Yes the form will be saved in the new format and it will not be possible to open it in these versions of NetBeans Develop
108. b in the Explorer right click on the root Project node and choose Add Existing from the contextual menu 2 Inthe Select Objects dialog box that appears browse to the directory package or file you want to add to the project and select OK You can also add existing files or packages to a project by selecting files or packages under the Filesystems tab in the Explorer and then choosing Tools Add to Project from the contextual menu of Tools Tools Add to Project from the main menu When you switch to the tab of your project in the Explorer the files you have added will appear under the main project node You can work with the files from either the project s tab or the Filesystems tab in the Explorer Important The package or file that you have added will appear under the Project tab as a link If you delete its node the files in its hierarchy will be deleted from the project but will remain in Filesystems However if you delete any of other the nodes in the hierarchy those files will be completely deleted from Filesystems When you are working in the Explorer with the Project tab selected you can create new objects by using the contextual menus of the Explorer nodes When you create new files this way the objects are added to the selected file system as represented on the Filesystems tab and to the project as represented on the Project tab To add a new file to the root of a project 1 Select the Project tab in the Explorer
109. be used as a search criterion Substring A literal string of text to be used as a search criterion Modified After The seatch will match files that were last modified on or after the date entered here Modified Before The seatch will match files that were last modified on or before the date entered here 260 Appendix D Reference Guide to Project Settings and Global Options Property Description Modified Within The search will match files that were last modified within Previous Days the previous number entered here days Java Sources settings reference Table 37 Java Sources properties Property Description Automatic parsing Parser auto start time out in milliseconds delay Default compiler The compiler type that serves as the default for new type sources Default debugger The debugger type that serves as the default for new type sources Default executor The execution type that serves as the default for new sources Parse class files If True class files are parsed for their Source property This is useful if you are using sources that have package pri vate top level classes Java 1 0 style and you want such class files to be correctly associated to the source file How ever setting this property to True slows down the IDE Strings table Table of substitution keys for templates 261 Appendix D Reference Guide to Project Settings and Glob
110. ble clicking on Debugger or click on the Debugger property s value and choose a type from the pull down menu Properties Window MemoryView es Execution 66 Chapter 3 Developing Java Applications Switching the default debugger type It is possible to switch the default debugger type When you switch the default debugger type this switch affects all classes and templates for which the user has not specifically assigned a debugger type To switch the default debugger type 1 Choose Project Settings from the main menu to open the Project Settings window 2 Select the Java Sources node in the left pane of the Project Settings window 3 Select the Default debugger type property and choose a new default debugger type from the dropdown list Project Settings Project Settings W m m J Filesystems Settings A zm B E Workspaces Automatic parsing delay 2000 sd Dp Execution Types Default Compiler FastJavac Compilation 5 Debugger Types we Compiler Types Default Debugger Standard Debug w Search Types Default Executor Q Java Sources 3 Source Synchronization Parse class files Applet Debugging R E 3 do not debug amp Object Browser Strings table epe dam Project Options Note Once you change a class or template s debugger type the IDE will never again recognize the class as using the default debugger type even if you switch the debugg
111. bout displaying popup menus in its specifications for PopupMenu and JPopupMenu 142 Chapter 6 Designing Visual Classes with the Form Editor Adding menu items The Component Inspector displays the hierarchy of menu bars and popup menus under Non visual Components Every menu whether it is on a menu bar or it is a popup menu of submenu starts with one menu item displayed as a subnode To add new menu items submenus or separators to a menu bar or popup menu 1 Inthe Component Inspectot select the menu you would like to add an item to 2 Right click on the menu and choose New and then the item you want from the submenu Menu item events You can use the same mechanism for assigning event handlers to menu items as with any other component For menu items you can also add the actionPerformed event handler by actually selecting the item from the menu in the Form Editor window To add an event handler to a menu item 1 Select the component in the Component Inspector and either use the popup menu or event properties to attach the event handler 2 Use the Connection Wizard by clicking on the Connect icon and then in the Component Inspector clicking on the connection source and target See Using the Connection Wizard on page 135 Components with special support Forte for Java Community Edition s Java based architecture enables it to support interactive design with components including the AWT ScrollPane and the Swing JScrollPa
112. categories has Move Up and Move Down buttons and also enables you to re order items by 221 Chapter 11 Configuring and customizing the IDE drag and drop To change the order of a component within a category 9 In the Global Options window under Component Palette right click on the node for the component and choose Move Up or Move Down from the contextual menu or Q Right click on the node of the component s category and choose Change Order from the contextual menu to bring up the Customize Order dialog box To remove a component or component category from the Component Palette 9 In the Global Options window under Component Palette right click on the node for the component or the category and choose Delete from the contextual menu For information on adding JavaBeans components to the Component Palette see Adding JavaBeans components to the IDE on page 107 Customizing workspaces Workspaces are entirely customizable through the Workspaces node in the Project Settings window Choose Project Settings from the main menu and expand Workspaces to see a list of current workspaces These workspace nodes can in turn be expanded to see a list of currently open windows on each workspace Each level of this hierarchy can be cut copied and pasted using commands on either the contextual menu or the Edit menu of the Main Window Existing workspaces can be renamed again through the contextual menu the workspace s property sheet or
113. ccess to a custom property editor where back ground and foreground colors as well as fonts can be set for various syntax tokens Key Bindings Clicking on the property and then clicking on the button brings up the Key Bindings property editor which enables you to add remove and edit key bindings Line Numbers If True the lines are numbered Number of Spaces Number of spaces a block is indented when you enter TAB per Tab 266 Appendix D Reference Guide to Project Settings and Global Options Property Description Tab size Number of spaces between each tab stop in the editor The tab stops are used when importing files into the editor Table 46 Expert properties available separately for each editor type Property Description Caret Blink Rate Rate in milliseconds that the insertion point caret blinks Display Text Limit If True shows a vettical line to mark suggested maximum Line line width for example for printing Highlight Caret Row If True the row where the insertion point is highlighted Highlight Matching Itf True whenevet the insertion point is immediately after a Bracket brace bracket or parenthesis the matching brace bracket parenthesis is highlighted Insert Caret The type of insertion point that appears when in insert mode From the drop down list you can choose between line thin line and block Insert Caret Color Choose a co
114. ces 48 miscellaneous shortcuts 48 mouse functions 40 navigation shortcuts 41 opening files 39 settings 49 settings reference 265 tabs 39 text scrolling shortcuts 42 updating parser database 45 word match 47 Error Expression Editor 292 event handlers defining 133 multiple 135 removing 134 renaming 134 events 133 139 Connection Wizard 135 Exceptions Editor 292 execution 54 59 categories 55 command line arguments 58 configuring executors 58 Execution Settings node 59 executors 55 external execution 55 internal execution 56 setting execution 56 setting executors in templates 58 switching executors 57 Execution Settings 59 185 reference 269 Execution Types 179 reference 258 Execution View 55 Explorer 23 24 74 86 Debugger node 86 Filesystems 75 Javadoc tab 86 Processes node 86 Project tab 86 Runtime node 85 F File systems 75 mounting 75 mounting order 77 Filesystems Settings 178 reference 254 Filesystems tab 75 find and replace in the Editor 43 finding files See Searching Filesystems Finish Debugger command 66 Index flow layout See layout managers Font Editor 289 Form Editor 26 29 111 adding components 114 code generation 128 code generation options 130 configuring 147 connection mode 115 container code generation properties 130 copying components 116 custom form property initialization 139 design mode 132 events 133 guarded text 128 menu editor 141 modifying forms externally 131 modifying ge
115. ck on a visual source node to open the Form Editor on that node See Designing Visual Classes with the Form Editor on page 111 for more information Creating package filters If you have a lot of packages in mounted in the IDE you may want to create custom package filters in the Package pane of the Object Browser to define which of them you want to view To create a new package filter 1 Make sure that the Show as tree icon is selected 2 Click the button in the upper right corner of the Packages pane to bring up the Package Filter dialog box 3 In the Package Filter dialog box click New 4 Now a Change Filter Name dialog box will appear Enter a name for the new filter and click OK Next you will need to enter the specifications for your filter In the details panel of the Package Filter dialog box is a list of filter expressions By default the expression com is created for all new filters There ate two ways to create a filter e Using the wildcard option you can enter prefix for example com netbeans suffix for example debugger or infix for example debugger expressions to narrow down the number of displayed packages Using the regular expression option you can create more complex filters using regular 89 Chapter 4 The Explorer and Object Browser expressions in standard POSIX format Package Filter Idcard filter tutorial Add Change Remove i wildc
116. comment marks from the selected lines e CTRL u delete text in the following cycle when using the shortcut successive times first the text preceeding the insertion point on the same line then the indentation on the line then the line break then the text on the previous line and so on e ALT F1 open the web browser on the Javadoc file pertaining to the item that the insertion point is on As with ALT o and ALT g the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source for this shortcut to work In addition the Javadoc documentation for that source must be mounted under the Javadoc tab in the Explorer When the insertion point is positioned after a brace bracket or parenthesis you can also press CTRL b to move to the matching bracket If you press CTRL SHIFT b the text within the braces is selected Word match The word match feature enables you to type the beginning characters of a word used elsewhere in your code and then have the Editor generate the rest of the word To use the word match feature 0 Type the beginning of the word and press a CTRL k to search backward through the text for a match or b CTRL 1 to search forward through the text for a match If a match is found the rest of the matching word will be generated You may type CTRL k or CTRL 1 multiple times to find additional matches in the document The IDE searches for a match not only in the cur
117. cquired from Java reflection 80 Chapter 4 The Explorer and Object Browser Icon Object Type Serialized prototypes Files with a ser extension which are ij serialized objects HTML object Represents an HTML file Text object Represents a text file Image object Represents GIF or JPEG images You can view m these with the built in image viewer There are several ways of creating new objects including choosing the New From Template command in e The Main Window toolbar The File menu An Explorer package s contextual menu See Creating new objects from templates on page 200 for more information You can also copy objects from one package and paste them in another using Copy and Paste from the contextual menus There are special paste options for JavaBeans objects Objects can be removed by pressing DELETE on the keyboard Three advanced operations can be done with JavaBeans and serialized prototypes You can e Customize them using the Customize Bean command and make serialized prototypes from the customized object e Copy and paste them into the Component Palette e Copy and paste them directly into the Component Inspector without the need to install them in the Component Palette first The following table shows some of the commands available in the contextual menus for the various types of objects 81 Chapter 4 The Explorer and Object Brows
118. criptions of each template When you access the wizard from a contextual menu in the Explorer or the Object Browser you skip straight to the second page of the wizard In addition the package information is automatically entered for you based on where you right clicked To create an object through the Main Window 1 Choose New From Template in one of the following ways from the File menu from its toolbat icon e using the CTRL n keyboard shortcut In the New From Template wizard that appears expand the appropriate template category node for example Classes and then select one of the templates In the right panel of the dialog a description of that template will appear EY New From Template Template Chooser LX r Select a template Template Description Templates 7 AWT Forms Using this template you can design a Beans new JFC Swing Frame 5j Classes Sample Forms JSP and Servlet E Other Q E Swing Forms main user interface to the application Frames are typically used as standalone top level windows as the JApplet JDialog Most Swing applications are built JFrame starting from this form E JinternalFrame JPanel Press Next to move to the Target Location page of the wizard In the Name field type the name you want to give the object Do not type the extension for the file type It will be added automatically 4 Inthe same page of the wizard
119. ct node in the Global Options window right click the node for the project you want to open and choose Open from the contextual menu A dialog box will appear enabling you to choose the project you want to switch to Once you have selected a project the IDE will prompt you to save changes to the previous project before it opens the next one The name on the root node under the Project tab in the Explorer will then change to indicate the project you have just switched to and the IDE state will change accordingly These changes include the current Project Settings and the files shown under the Project tab Importing projects If you have projects created in other Java IDEs that you would like to work on in Forte for Java you can import those projects and have them mounted under the Filesystems tab in the Explorer To import a project 160 Chapter 8 Organizing work into projects 1 Choose Import Project from the Projects menu 2 Using the file chooser that appears search your computer for the project You can specify Microsoft J JBuilder or Visual Cafe projects in the Files of Type field 3 Once you have selected a project file click Open to have the file mounted 161 Chapter 9 Integrating a CVS version control system In team development projects where more than one developer may work on the same code there ate a number of challenges such as knowing who changed what and when e knowing why a given change wa
120. cting the Execution Types JSP Execution JSP Execution node All of the properties are shown in the right pane of the window Note You can only compile and execute JSP pages located on a local filesystem You can not compile and execute pages packed in JAR or WAR files 152 Chapter 8 Organizing work into projects Forte for Java Community Edition enables you to organize your files into projects This enables you to save different IDE configurations for each project as well as to conveniently complle execute and debug by project What is a project in Forte for Java A project in Forte for Java physically consists of its own subdirectory stored in the Projects folder of your installation directory which contain the files that hold the information about the state of the IDE when you were last wotking in that project When you switch to a different project the information from that project s files are loaded and the IDE s state meaning open files and windows active workspace and configuration of Project Settings is accordingly changed Dividing your work into projects provides the following advantages Chapter 8 Organizing work into projects e You can compile the whole project without having to specify which files to include e If you have set a main class for the project you do not have to seek out this class when you want to run or debug the project You can view all files added to the current project under t
121. cumentation Bottom The HTML text to be placed at the bottom of each output file Charset Character set for cross platform viewing Destination Destination directory for the output files Doctitle The title to be placed near the top of the overview sum marty file Footer The footer text to be placed at the bottom of each output file Group Enables you to specify groupings of packages on the over view page Enter in the format groupheading packagepattern You can use an asterisk as a wildcard and you can include multiple items in pack agepattern using a colon to delimit them Header The header text to be placed at the top of each output file Helpfile The path of an alternate help file path filename that the HELP link in the top and bottom navigation bars link to Without this option Javadoc automatically creates a help file help doc html that is hard coded in Javadoc Link A URL link to already existing javadoc generated documen tation of external referenced classes No Deprecated If True prevents the generation of any deprecated API at all in the documentation No Deprecated List If True prevents the generation of the file containing the list of deprecated APIs deprecated list html and the link in the navigation bar to that page 264 Appendix D Reference Guide to Project Settings and Global Options Option Description No Help If True omits the HELP link in the navigation bar
122. cuting 159 importing 160 mounting file systems 158 Project Options 181 Project Options reference 262 Project Settings 159 saving 160 setting the main class 158 switching 160 What is a project 153 property editors 118 Border 289 Bounds 290 Color 288 Cursor 290 custom 26 Dimension 290 Exceptions 292 Font 289 Form Connection 139 Icon 290 Insets 291 Modifiers 291 Parameters 291 String 290 property editorsError Expression 292 297 Index property sheet 24 26 in Component Inspector 117 options 187 options reference 277 toolbar 26 R Rectangle Editor see Bounds Editor 290 Resume All command 67 RGB color values 289 Runtime node 85 S ScrollPane 143 Search Types settings 180 settings reference 260 Searching Filesystems 83 modifying search criteria 85 saving criteria 84 searching See find and replace in the Editor and finding files service types 204 adding 204 configuring 206 editing from the Explorer 207 Process Descriptor dialog box 206 removing 208 shortcuts See keyboard shortcuts source synchronization 96 property sheet 96 startup classes 56 Startup node 184 String Editor 290 Suspend All command 67 Swing palette colors 289 System Settings 187 reference 277 T templates 200 creating 201 creating objects from 200 macros in 202 modifying 202 options 183 tool tips 32 toolbars 215 219 configurations 217 customizing 215 dragging 217 in Main Window 22 options 183 Trace In
123. cutor TES Q E Java Sources z Internal Compilation n Parse class files 3 Source Synchronization do not compile amp Object Browser Strings table Project Options Note Once you change a class or template s compiler type the IDE will never again recognize the class as using the default compiler type even if you switch the compiler type for the class back to the one that is the IDE default Therefore if you change a class s compiler type and then change it back to the default compiler type the class s compiler type will not be affected if you change the default compiler type Switching compilers by class A default compiler is set for each class If you would like to use a different compiler or a different configuration of a compiler for that class you can specify one on the class s property sheet To switch compilers for a class 1 2 3 4 Select the object under the Filesystems tab in the Explorer Go to the object s property sheet by choosing View Properties from the main menu Click on the Execution tab in the Properties window Rotate through the compiler types by double clicking on Compiler ot click on the 50 Chapter 3 Developing Java Applications Compiler property s value and choose from the pull down menu b ai uso Window M B E3 Debugger f 3 Execution By default there are three choices for Java sources using Javac internally in the same VM as t
124. d highlights the currently selected component whether that component was selected in the Component Inspector or the Form Editor window Tabs on the property sheet in the bottom panel display the general the tab marked Properties expert code generation and layout properties as well as the events of the selected component See Property Sheet pane in the Component Inspector 27 Chapter 2 IDE Essentials on page 117 83 Component Inspector textBox L OL x Ted JFrame EJ Non visual Components E BorderLayout Q T jScrollPane1 JScrollPane textBox JTextArea xis m mase P aomen s techn Dm tee eure caretColor caretPosition debugGraphicsOptions NONE OPTION disabledTextColor El 153 153 153 mawssee ree r Editor window Besides acting as a text editor the Editor window also displays code generated by the IDE as a result of additions and changes that you make in the Form Editor window and the Component Inspector Such IDE generated code appears in guarded blocks denoted by background shading meaning that you can not edit them directly in the Editor window However it is possible to affect the way the code is generated see Using the Form 28 Chapter 2 IDE Essentials Connection property editor on page 139 for more information E Editor Ted ll public class Ted extends javax swing JFrame 12 13 14 15 16 17 18 19 20 2l 22 23 24 25 26 27 28 29
125. d textual editing mode open the text editor Exit Exit the IDE Filesystem Action Submenu of operations specific to a file system Garbage Collect Garbage Collect By default this item 1s not installed in any menus ot toolbars Global Options Open the Global Options window Instantiate Instantiate a template Move Down Moves current item down among the parent s children MoveUp Moves current item up among the parent s chil dren New Create a new object New From Template Create a new object using an existing template Open Open an object Open Explorer Open a new instance of the Explorer Open File Open a file in the IDE Open In New Window Open a bookmark in a new web browser window Print Print the file active in the Editor or selected in the Explorer Refresh Refresh state of a component Remove Filesystem Unmount a mounted file system Rename Rename selected object Reorder Change order of subnodes subcomponents of selected item container Save Save current object Save All Save all open objects 284 Appendix E Actions Action Description Save As Template Save a copy of the object as a template in the Templates hierarchy Set Default Value Set the default value for the property Save Settings Save the current Project Settings This action is only available if the Projects module has been dis abled re
126. dHierarchyBoundsListener HierarchyBoundsListener addHierarchyListener HierarchyListener addinputMethodListener InputMethodListener addkeyListener KeyListener 137 Chapter 6 Designing Visual Classes with the Form Editor Choosing property value or method parameters If you have chosen Set Property Method Call or Bean in the previous step the third step will enable you to specify the values for the target property or parameters for calling the target method If you have chosen Method Call the dialog box will display a list of all parameters types as tabs where each tab represents a single method parameter On each tab you can set the source from which the value of the specified type is acquired Value This option is available only if the value is a primitive type int float and so on ot a String You can enter the value into the text field Bean This option enables you to acquire the value from a bean on the form If you click on the button a dialog box will appear which will let you choose the bean Property This option enables you to acquire the value from a property of a component on the form If you click on the button a dialog box will appear which will let you choose the component and its property Note that only properties of the correct type are listed Method This option enables you to acquire the value from a method call of a component on the form If you click on the button a
127. dded to the current project See Organizing work into projects on page 153 for a complete description of project functionality To create an object from the Explorer 1 If the Explorer is not open choose Open Explorer from the File menu or toolbar 2 Find the package marked with a folder icon under the Filesystems tab in the Explorer where you want to place the class and right click on it to bring up its contextual menu 33 Chapter 3 Developing Java Applications 3 Choose New From Template the template type from the first submenu and then the template itself from the second submenu gll Explorer Filesystems 3 Filesystems Q c D Fortes Gi exa Explore from Here Alto Gi tutori Refresh Folder E read amp D Fortey Compile Compile All Build Build All Paste New Package Remove Filesystem Tools Customize Properties 3 Filesystems 9 AWT Forms C Beans ri C Sample Forms C JSP and Servlet C Other d Swing Forms Pile ES Applet Class Empty Exception Interface JApplet The Target Location page of the New From Template wizard will appear 4 Type the name of the object in the Name field verify that the correct package is selected in the Package panel and click Finish To create an object from the Object Browser 1 Open the Object Browser by selecting the Browsing tab in the Main Window to open up the Browsing workspace or choose File Object Browser from the
128. de in the Form Editor window or the Component Inspector is immediately reflected in the source code Guarded text Some parts of the source code generated by the Form Editor are not editable directly in the Editor The background of these guarded blocks is shaded Guarded text includes The block of variable declarations for the components on the form e The initComponents method in which all the form initialization is performed this method is called from the form s constructor e The header and trailing closing brace of all event handlers Though the initComponents method is not editable manually you can affect the way it is generated by editing properties found on the Code Generation tab of the component s property sheet and by using the Form Connection custom property editors for the components in your form See Modifying generated code for components below and Using the Form Connection property editor on page 139 Modifying generated code for components You can use a component s property sheet to affect the way the code is generated in the initComponents method In addition you can write code and specify where it should 128 Chapter 6 Designing Visual Classes with the Form Editor be placed within initComponents To modify code generation for a component 1 Select the component in the Component Inspector 2 Click the Code Generation tab to access the Code Generation properties amp Com
129. ded submenu choose the element you want to create If you select New Initializer a new initializer is immediately added to your code If you select New and then Variable Constructor Method Inner Class or Inner Interface a customizer dialog box will appear In the customizer depending on the type of element you ate creating you can set member accessibility and other modifiers method name and return type class name and super class method parameters and exceptions and 94 Chapter 4 The Explorer and Object Browser intetfaces Customizer Dialog ClockFrame ITTTIT ENG Modifying classes and elements You can modify classes and their members with the same type of customizer To customize an element 1 In the Explorer or Object Browser select the class or member that you would like to change Choose Customize from the contextual menu or press the Customize icon which is the last button on the toolbar in the Properties window The Customizer Dialog will appear enabling you depending on the type of element you are creating to set member accessibility and other modifiers method name and return type class name and super class method parameters and exceptions and interfaces 95 Chapter 4 The Explorer and Object Browser Source synchronization Source synchronization is a feature that helps to keep your Java source files current by e Automatically generating an interface s methods for you wh
130. dialog box will appear which willlet you choose the component and its method Note that only methods which return the correct type and which do not take any parameters are listed User Code This option enables you to write user code which is used as the parameter 138 Chapter 6 Designing Visual Classes with the Form Editor for the setter of the chosen property or a parameter of the chosen method call EY Connection Wizard Step 3 of 3 LX String Component m Get Parameter From CO Value O Bean Select Bean X Property No Property Selected Method Cal No Method Selected User Code snot set Generated Parameters Preview Previous Finish Cancel If you click Finish a new event handler will be generated with code reflecting the settings entered in the second and third step Using the Form Connection property editor The Form Connection Property editor gives you greater control over the generated initialization code for your forms You can have properties of components on your form initialized in a more flexible way than just setting static values This editor enables you to initialize property values from e Astatic value you define 139 Chapter 6 Designing Visual Classes with the Form Editor A JavaBeans component A property of another component on the form A call to a method of the form or one of its c
131. e Tip You can use the tool tip feature to find out the names of the filters and more information about the items listed in the panes To get an item s tool tip place the mouse cursor over the item and wait about a second for the tool tip to appear Using the Object Browser Much like with the Explorer you can use the Object Browser as a base for many tasks in the development cycle Contextual menus are available for every item listed in the Object Browser enabling you to do the following operations e Open objects or their members in the Editor window e Open HTML files in the web browser Cut copy and paste objects and their members Delete rename and add packages objects and members e Compile or build an object or package 88 Chapter 4 The Explorer and Object Browser e Open up a separate Explorer window on a package When you open a source file from the Object Browser the Editor window by default opens up just below the Object Browser enabling you to easily switch between these windows If multiple source files are open at the same time each file has its own tab on the bottom of the Editor window enabling you to go back and forth between files Note The Object Browser is not specifically designed for designing visual applications When wotking on visual projects you may find it easier to work in the GUI Editing workspace with the Explorer where you can easily edit properties for visual forms and double cli
132. e compiler produces code with debug informa tion Must be turned on to debug with source tracking Deprecation If True the compiler treats the use of deprecated methods as ettots Encoding Character encoding is used in Java sources Error Expression A regular expression in POSIX format describing the for mat of the error output of the specified compiler You can also define a custom expression if using a different com piler and save that setting Select one of the pre defined sets for error descriptors Sun javac Microsoft jvc Of IBM jikes E External Compiler Path to executable compiler You can use the custom prop erty editor to define the process and arguments using a set of substitution codes 256 Appendix D Reference Guide to Project Settings and Global Options Property Description Identifying Name The name for the compiler type by which classes reference it Optimize If True the compiler optimizes generated bytecode Debug tag replace The command line option to include debugging informa tion for example g Deprecation tag replace The command line option to show deptecations for exam ple deprecation Optimize tag replace The command line option to optimize for example O Table 31 Internal Java Compiler service properties Property Description Debug If True the compiler produces code with debug
133. e of the insertion point and so on Many of these settings are separately customizable for Java HTML and plain text under their respective subnodes under Editor Settings in the Global Options window See Configuring the Editor on page 209 for more information and Editor Settings reference on page 265 for a list of all configurable properties Compiling Java sources Forte For Java Community Edition offers a wide array of compilation options from different ways to bring up the Compile command to the ability to use different compilers and set a specific compiler for each class Note When you choose the Compile or Compile All Compile Project Build Build All or Build Project command for an object the IDE consistent with Java conventions automatically compiles the first file it finds with the same name and package Therefore if 47 Chapter 3 Developing Java Applications you have two files with the same file name and package hierarchy mounted in the Explorer the file in the first package listed will be compiled automatically even if you choose the Compile command with the second package selected After you initiate compilation of a class the Output Window appears if there are any compilation errors If you double click on the error in the Output Window the insertion point will jump to the line in the Editor with the error See Using the Output Window on page 68 for more details Compilation progress is reported i
134. e selecting the different files and then right click and choose Tools Auto Comment from the contextual menu However be sure to not select any item that does not have Tools Auto Comment on its contextual menu such as an image or a text file Auto Comment Tool Iof XI dv D fi Lej a amp public Memory view iuo public Memory View Te public void addNotify B public void removeNotify Ate public static void main java lang String Edit Comment View Source Refresh gd Declaring Class examples advanced Memory View Javadoc comment OK The first pane lists constructors variables and other elements for comment Below that the Details pane contains the Declaring Class field which shows the class that selected element belongs to and information about missing or invalid comments on the item selected in the first pane 172 Chapter 10 Searching and Creating Javadoc Documentation The first three filter icons respectively enable you to view class elements 1 with completely valid comments 2 with partially valid comments something could be missing or invalid in the Javadoc tags 3 without comment The next four icons are filters which enable you to view public package private protected and private elements of class source The dialog box also includes the following buttons Edit Comment brings up the Javadoc Comment dialog box where you can edi
135. ecify the VM executable such as java exe and complete command line parameters together with class path settings for the application External execution also protects the IDE from application crashes and delays 53 Chapter 3 Developing Java Applications Internal Thread Execution An application run using internal execution runs inside the Forte for Java IDE This brings the advantages that the application can modify the IDE itself and be loaded faster But it imposes at least two restrictions on the executed application The application cannot install its own URLStreamHandlerFactory or SecurityManager so you cannot run RMI applications for example In addition if the executed application crashes the IDE crashes with it Go to the Examples directory under the Filesystems tab in the Explorer to look at some samples of internal execution applications Note Some applications such as startup classes in the Startup folder which can be accessed by choosing Tools Global Options from the main menu require the use of internal execution because they are intended to modify the IDE itself Other execution categories Other execution categories tailored for specific types of applications are installed by various modules such as RMI and JSP Setting execution The execution category for example external internal or applet is set for each separate object When you set execution you choose from a list of executors each of
136. ect the Servlet Compiler property press the drop down arrow that appeats and choose the compiler from the combo box Included beans others JSPs and error pages in compilation If you compile a JSP page that calls any JavaBeans components with the lt jsp useBean gt tag these beans will be compiled along with the JSP page Similarly if your page references any other JSP pages by using the jsp include or jsp forward directives the referenced pages will also be included in the compilation If your JSP uses an error page by specifying lt s page errorPage gt the error page will be compiled with yout page Note Currently Forte for Java supports version 1 0 of the JSP specification The built in server used for testing and running JSP pages is Sun JavaServer Web Development Kit version 1 0 1 Running JSPs After successfully compiling your JSP page you can run it using the built in web server To run a JSP page o Right click on the JSP s node in the Explorer or Object Browser and choose Execute from the contextual menu The servlet and JSP engine will be started and the JSP page will be displayed in the web btowset Specifying query parameters You can specify query parameters to pass in the request from the browser to the server In the page s property sheet edit the Request Parameters property in the Execution tab Use 150 Chapter 7 Developing Java Server Pages standard query string notation
137. ed with syntax coloring features in the Editor window Text This template is for creating plain text files which can be edited in the Editor window Creating your own templates In Forte for Java Community Edition any object can be used as a template There are two ways to set an object as a template To set an object as a template 1 Right click the desired object under the Filesystems tab in the Explorer and choose Save as Template from the contextual menu 2 Inthe Save as Template dialog box that appears choose the template category where you want the new template placed 1 Select the desired object in the Explorer and open its property sheet 2 Change its Template property to True 3 If you want the new template visible in the menus and dialog boxes used for creating objects from templates copy it and paste it to a template category under the Templates node in the Global Options window The difference between a template and a normal object is only in what is done when you 201 Chapter 11 Configuring and customizing the IDE double click on it in the Explorer For a plain object a default Editor window 1s opened if available on templates a dialog box appears enabling you to create a new object from the template If you want to open the Editor on a template choose Open from the template s contextual menu in the Explorer Modifying existing templates You can also modity existing templates This might be desir
138. ed to the IDE Managing modules All modules installed in the IDE have their own node under Modules in the Global Options window Their property sheets contain the Enabled property which you can use to activate ot deactivate the module The other five properties including two on the Expert tab are read only and give basic information about the module Adding modules with the Update Center When you use the Update Center the IDE leads you through a wizard which compares the IDE s modules with the cutrently available modules and enables you to choose which ones to update or add The Update Center is designed to update the IDE by installing modules 194 Chapter 11 Configuring and customizing the IDE directly from the Forte for Java web site but it can also work with ZIP files previously downloaded to your computer To update the IDE directly from the Forte for Java web site 1 2 Choose Help Update Center from the main menu to bring up the Update Center wizard On the first page of the wizard choose the Check the web for available updates radio button If you are checking for updates for the Community Edition you do not need to enter a registration number If you are looking for updates for non Community Edition modules such as those available to members of the Forte for Java Early Access Program enter the approptiate registration number If you need to set a proxy or the proxy host or proxy port press Configure Proxy
139. elect the path and directory click on the jar file and click Mount The archive then appears in the Explorer under the Filesystems tab and in the Object Browset 3 If you are using the Explorer expand the node of the archive or directory that you have just added and locate the JavaBeans component you want to add 4 Right click on the JavaBeans component in the Explorer or Object Browser and choose Tools Add to Component Palette from the contextual menu 5 In the Palette Category dialog box select the tab under which you would like the bean to appear in the Component Palette and click OK The new JavaBeans component on the Component Palette in the Main Window under the category you assigned To add a bean not packaged in a JAR or ZIP file 9 Follow the previous procedure but use Add Directory instead of Add JAR in step 1 To add a bean to the IDE from the Explorer o Follow steps 4 and 5 of the procedure for adding JavaBeans to the IDE Instead of using Tools Add to Component Palette you can copy and paste using the Edit menu in the Main Window contextual menus in the Explorer or Object Browser or keyboard shortcuts beans into the appropriate category under Component Palette in the Global Options window If you copy and paste using the main menu or a contextual menu you can choose from up to four options from the Paste submenu For more on these options see Package contextual menu commands on page 79 109 Chapter 5
140. elf will 106 Chapter 5 Developing and Customizing JavaBeans Components also appear on the screen Customize Bean examples advanced MemoryView LX accessibleContext javax accessibility AccessibleContext alinmentX background CO 204 204 204 A component Array of java awt Component componentCount components Array of java awt Component cursorType focusOwrner java awt Component 2 Make the desired changes in the property sheet or if it is a visual component on the component itself Properties 3 Click Serialize or Serialize as to create a serialized prototype ser file of the bean with its customized properties Serialize As enables you to select a name and location for the ser file Serialize available for ser files only saves the bean into the same ser file it originated from overwriting the previous content If you do not want to keep the customized settings press the Cancel button to close the customization window Adding JavaBeans components to the IDE You can expand the functionality of the IDE by adding your own visual and non visual JavaBeans components to the Component Palette for use in visual design Once the component is installed you can easily select it in the Component Palette and add it to your forms You can add class files with the c1ass extension or serialized prototypes ser To add a JavaBeans component to the Component Palette 1 Choose Tools Install
141. en you implement that interface in a source file and e Automatically updating all source files mounted in the Explorer that implement the interface when you change a method in or add a method to that interface Source synchronization works with all interfaces shown under the Filesystems tab in the Explorer and all standard interfaces in the Java 2 SDK You can choose to synchronize source automatically just after parsing which by default occurs after a two second break in typing and insertion point movement with or without confirmation or explicitly by choosing Tools Synchronize from the contextual menu of the implementing class in the Explorer All source files have a Synchronization Mode property on their property sheet accessed by choosing View Properties from the main menu The property can be set to e Do not synchronize e Confirm changes the default and recommended setting The Confirm Changes dialog box appears enabling you to specify which methods are to be synchronized e Without confirmation all interface methods are automatically generated for the implementing classes without a dialog box appearing to prompt you to confirm the changes Source Synchronization property sheet You can adjust general source synchronization settings on the property sheet for the Java Sources Source Synchronization node in the Project Settings window Project Settings from the main menu The properties are Return Gen
142. ence on page 271 for specific details HTTP Server The HTTP Server property sheet controls the built in HTTP Hypertext Transfer Protocol or web server Among other things you can establish the host determine access to the server and change the port See HTML Browser reference on page 271 JSP amp Servlets On this node are properties which enable you to choose the web browser on which to display your running JSP See Setting the web browser on page 152 Java Elements These settings control the display names of element nodes in the Explorer You can enter a combination of plain text and substitution codes For example if you enter class n in the Classes property a class called MyClass will be represented as class MyClass in the Explorer hierarchy See Java Elements reference on page 272 for a complete list of the substitution codes and a description of advanced substitution features Open File Server The property sheet for this node enables you to configure the server that listens to open requests if you use the IDE as an external viewer or editor or double click Java sources from the desktop of your machine See Opening files from outside of the IDE on page 224 Output Window These settings control the colors fonts and tab size used in the Output Window For the color settings you can select the property and then either click the drop down arrow to select a color from the combo box ot click the butt
143. ener java awt event Mous 9 mouseListener java awt event MouseListe A keyListener java awt event KeyListener A hierarchyBoundsListener java awt event Q hierarchyListener java avt event Hierarch Q focusListener java awt event FocusListen AQ componentListener java awt event Compo Q newEventsOnly boolean true componentOrientation java awwt Compone Q prefSize java awt Dimension null Watches 63 Chapter 3 Developing Java Applications The debugging session To initiate a debugging session 1 Set a breakpoint and then choose Debug Start Debugging from the Main Window or press F5 If you are debugging a GUI application or another looped application it is not necessaty to set a breakpoint before starting By default the IDE switches to the Debugging Workspace to configure it to do otherwise see Customizing workspaces on page 222 where the Debugger Window the Editor with the source being debugged and the Output Window all open up The Output Window is split vertically with Debugger output on the right and any output from the application being debugged on the left When the Debugger reaches a breakpoint in your source that breakpoint is highlighted pink The pink line will move through your source as you code as you step through its execution Debugging can also be initiated by choosing the Trace Into command which causes the Debugger to stop on the first line after the main
144. entjavadocjavajdk13tapi D Forte4JCE_489 Development E Workspaces bp Execution Types 5 Debugger Types Q ws Compiler Types Q wa External Compilation wa External Compilation wa FastJavac Compilation we External Compilation 2 iu Internal Compilation x e ej m Fase D Forte4JCE 489 Deve Extensions of Backup Fil Read Only Root Directory Valid Project Settings include Filesystems settings internal and external compiler configurations debugger types window settings external browser ot applet viewer configuration and more The left pane provides a tree view of the Project Settings items and the right pane displays the property sheet where you can view and edit the various options for the selected item As in the Explorer contextual menu items such as Customize Bean Copy and Paste are available for many of the Project Settings nodes To open the Project Settings window choose Project Settings from the main menu For information on IDE settings that can not be set separately for each project see Global Options on page 182 Changes made to Project Settings are automatically saved to the current project when you exit the IDE To save changes without closing the IDE choose Project Save Project from the main menu Below ate desctiptions of each item in Project Settings Filesystems Settings Filesystems Settings l
145. enu or Toolbars node and navigate to the command you want to move Select the action you want to move and choose Cut from the Edit menu or contextual menu or by keyboard shortcut Under the Menu or Toolbars node select the subnode for the menu or toolbar under which you would like to place the command Choose Paste from either the Edit menu or contextual menu or by keyboard shortcut Note If you delete a command supplied with Forte for Java from the default menus or toolbars it is not completely deleted from the IDE You can restore a command to a menu or toolbar by copying it from the Act ions hierarchy in the Global Options window where all available commands ate stored and pasting it to a menu listed under Menu or toolbar Toolbars in the same window To group related menu commands with a separator 1 2 Choose Tools Global Options from the main menu In the Global Options window navigate to the node of the desired parent container under Menu Right click on the node and choose New Menu Separator from the contextual menu Enter a name for the separator in the dialog box that appears and click OK The menu separator will appear as the last item in the menu To change the order of commands within their parent container 0 In the Menu or Toolbars hierarchy of the Global Options window select the command you want to move and move it using the Move Up or Move Down command in the contextual menu or In t
146. eptions Do not modify the content of the initComponents method The body of this method is always regenerated when the form is opened Do not remove or modify any of the special comments placed in the source by the IDE s Form Editor GEN They are required for the form to open correctly These comments are not visible inside Forte for Java s source editor Do not modify the headers or footers of event handlers Form Editor modes The Form Editor can be in one of three modes 131 Chapter 6 Designing Visual Classes with the Form Editor Table 8 Form Editor modes Toolbar Description Design mode This is the default Form Editor mode By clicking on the form you can select add or drag components Note that in this mode depending on the layout the layout won t neces satily look the same as it does during run time This is because design would be difficult if every layout manager worked exactly the same way at design time as it does during run time For example with some layout managers when you drop two com ponents next to each other they could resize automatically and make it impossible to add a new component between the two So if you need to see the effect of a certain layout manager at run time change the Form Editor from design mode to either real mode or test mode Real mode The Form Editor window displays the actual Java lay out managers so the forms look the way they will dur
147. er Creating a new form Use the New From Template command to create a new form from template and open it in the Form Editor Forte for Java suppotts nine basic form types from both the AWT and the newer JFC components The table below lists them Table 7 Basic form types supported by Forte for Java Name Description Frame AW T Frame top level application window Dialog AW T Dialog modal or non modal window for user feedback Applet AWT Applet embeddable program run by a web browser or other applet viewet Panel AWT Panel container for holding parts of an interface can in turn be used in any other container such as a Frame Panel Applet or Dialog JFrame Swing JFrame top level application window JDialog Swing JDialog modal or non modal window for user feedback JApplet Swing JApplet embeddable program run by a web browser or other applet viewer JPanel Swing JPanel lightweight container for holding parts of an inter face within any container such as a JFrame JPanel JApplet or JDialog JInternal Swing JInternalFrame lightweight object with many of the fea Frame tures of a native Frame used as a window within a window within a JDesktopPane Note that the table lists only the basic types which differ both in design time look and in the code generated for the form s class Customized forms for example a dialog box with OK 113 Chapter 6 Designi
148. er Table 3 Common Object Commands Command Description Open Opens the default viewer for the object type usually the Editor window Also opens up the Form Editor window and Component Inspector for visual classes Customize Bean Displays a window with the property sheet for the selected class as well as the option to setialize it View Opens an HTML object in the default applet viewer Compile Compiles selected object s Execute Runs the selected object Cut Copy Paste Delete Rename Standard clipboard style operations New Method or Constructor Initializer Variable Inner Class Inner Interface Creates a new element of the type cho sen in the submenu in the selected class ot source file These commands are available on the contextual menu for the relevant category node for example Fields New Property Brings up the New Property Pattern dialog for creating a new JavaBeans property for the selected bean Tools Create Group Creates a group object composed of links to one ot more files enabling you to access them from the same place in the IDE See Group of Files on page 201 Tools Auto Comment Enables you to comment your source code automatically and view all parts of yout soutce code methods construc tors inner classes variables and such and document them individually Tools Generate JavaDoc Genera
149. er cond waiting amp Debugger agent running Breakpoint handler cond waiting amp Step handler cond waiting iA ERR AAA RRA RA MELAS SL ASSES RRRA ES When a thread is suspended e The CallStack node can be expanded to show the current hierarchy of method calls made during execution e The Locals node displays local variables and their current values in the context of the cutrent thread You can expand these nodes to see the object sub structure If the process you are debugging has more than one thread all threads and thread groups 23 cc appear in the Threads tab showing a thread name and current status such as running at 23 cc breakpoint cond waiting and suspended Suspended threads and threads at breakpoint display all current system information The Debugger Window displays the following properties for each running thread Name Thread name according to the thread class State Status of the thread such as Running Cond waiting and so on e Class Name of the class in which the thread is suspended e Method Name of the method in which the thread is suspended 61 Chapter 3 Developing Java Applications Line Number Current line in the thread Stack Depth Number of methods in the call stack Suspended If True the thread is suspended Watches The Watches tab lists all currently set watches A watch is a node you can
150. er installations 2 Open the startup script in a text editor and add one of the following switches to the startup script a ui com sun java swing plaf windows WindowsLookAndFeel if you want to change to Windows look and feel b ui com sun java swing plaf motif MotifLookAndFeel if you want to change to Motif look and feel Configuring the Editor Editor features such as keyboard shortcuts abbreviations code completion and automatic code formatting are configurable The following procedures show you how you can customize them to suit your needs Changing assignments for Editor keyboard shortcuts If the key combinations for the shortcuts do not suit you you can change them By default the Editor has a set of global keyboard shortcuts set These shortcuts are available no matter what kind of file you ate working on in the Editor In addition it is possible to set keyboard shortcuts by individual type of editor Java Plain HTML and JSP If you use assign a keyboard shortcut for one of these individual editors that has the same key combination as a global shortcut the shortcut for the specific editor will override the global shortcut for that editor For example the Alt f key combination is set as a global keyboard shortcut for reformatting text If you wanted to use this keyboard shortcut for something else when editing Java files but keep it the same when editing any other types of files you could reassign Altf to a di
151. er Types Execution Types or Debugger Types and open its property sheet 3 Modify any of the editable properties under the standard Properties or the Expert tabs When a setvice type is set for a class the IDE associates the name of the service type as it appears in the Identifying Name property to the class not the actual configuration of the service type It is possible to create different service types in different projects but give them the same name Therefore if you want to associate a different service type for a class depending on which project you are in you do not have to change the service type for the class each time you switch projects Note Classes do not register the name changes of the service types they are using Therefore if you change the Identifying Name property of a service type already being used by any classes those classes will then revert to the current default service type for that category Process Descriptor property editor Some of the service types have a property for example External Process for external executors and External Compiler for external compiler types that can be edited with the Process Descriptor property editor In this custom property editor you can set the process and arguments for the service type You can fill in the Process field manually or press the button to bring up the file chooser to select the process The Arguments Key panel displays the substitut
152. er the Filesystems tab The packages and files in any directories that you mount will then be available for inclusion in your project See Adding packages and files to a project below Once the new project is created the name of the root node under the Projects tab will be updated with the name of the new project Working with projects When you use the IDE you always wotk within a single project You can wotk within the IDE s default project or you can create projects of your own For the default project and each 155 Chapter 8 Organizing work into projects project you have created you can add specific files and file systems designate a main class and configure its Project Settings You can easily switch between the projects you are working in Adding packages and files to a project You can add packages and files including source HTML and plain text files to a project so that they are viewable on the Projects tab in the Explorer This enables you to view and access all of the files crucial for your project from one place In addition it enables you to compile all project files at the same time This does not affect which files or file systems are mounted under Filesystems in the Explorer or which files are available for editing The files mounted in Filesystems are always available for editing whether you have added them to the project or not To add an existing file or package to a project 1 Select the Project ta
153. er type for the class back to the one that is the IDE default Therefore if you change a class s debugger type and then change it back to the default debugger type the class s debugger type will not be affected if you change the default debugger type Configuring debuggers It is also possible to customize the command line template for the debugger thus affecting 67 Chapter 3 Developing Java Applications the way the debugger is called For more information see Adding and modifying service types on page 204 Setting debugger types in templates If you use more than one debugger type in your work you can create a set of templates with the different debugger types that you use See Creating your own templates on page 201 and Modifying existing templates on page 202 for more information Using the Output Window The Output Window is a multi tab window displaying output from any component that produces output such as the compiler or executed application or applet Output from each component is presented on a separate tab the Compiler tab Debugger tab and a tab for each executed process labeled with the name of the application being run By default the Output Window is visible on the Running Workspace and is automatically displayed when you compile Editing Workspace execute Running Workspace or debug Debugging Workspace an application The Compiler tab is visible after compiling a Java source and dis
154. eration Mode Generates either nothing an exception or the string return null when creating a new method declared to return a value e Synchronization Enabled If False all synchronization is turned off Synchronizing source To synchronize with confirmation when implementing a new interface in a class 1 Inthe Editor window type implements InterfaceName in the class declaration line 96 Chapter 4 The Explorer and Object Browser of the source file 2 Wait a few seconds for the source to be parsed or save or compile the file The Confirm Changes dialog box will then appear listing all of the methods to be added to the class The dialog box gives you the following options a Choose Process All to add all of the interface s methods to the class b Select any combination of the methods in the Changes List and choose Process to add only those methods to the class C Choose Close to prevent any of the methods from being added to the class You can change the synchronization mode for the destination class by selecting one of the radio buttons at the bottom of the dialog box To synchronize with confirmation when changing or adding methods to an interface 1 Add the method s to the interface code and then wait for parsing to occur and the Confirm Changes dialog box to appear The dialog box will display the updated methods for the first class found that implements the interface 2 Follow step 2 from the prev
155. erion select its node and use in place renaming right click and select Rename from the contextual menu or edit the Identifying Name property on its property sheet Runtime The second major grouping in the Explorer hierarchy is Runt ime Nodes under Runt ime display runtime information for execution executed processes and debugging breakpoints thread groups and watches as well as any external services as provided by extension modules and their connection to the IDE 85 Chapter 4 The Explorer and Object Browser Processes node The Processes node lists all processes currently being executed within the IDE The contextual menu for each of these items contains just one element Terminate Process This enables you to force termination of a process This view is mirrored by the Execution View Debugger node During a debugging session the Debugger shows individual watches threads and breakpoints By right clicking on Breakpoints or Watches you can also add a new breakpoint or watch This information is also available in the Debugger Window part of the default Debugging wotkspace There is a detailed description of the Debugger in Debugging Java classes on page 58 Javadoc The Javadoc tab in the Explorer contains directories of API documentation in Javadoc format You can mount Javadoc directories and navigate the hierarchies just like you would other directories under the Filesystems tab Each node has its own pr
156. ervice types from the property sheet of an individual class s node in the Explorer To access a service type s property sheet from the Explorer 1 Select a class under the Filesystems tab in the Explorer and open its property sheet 2 Under the Execution tab of the property sheet select the Compiler or Executor or Debugger property and then press the button to bring up the custom property 207 Chapter 11 Configuring and customizing the IDE editor 3 Inthelist on the left side of the custom property editor select the compiler executor debugger you want to modify The property sheet for that service type will appear You can select the External Compiler orExternal Process or Debugger property and press the button in order to edit the service type s process and arguments Note When you reconfigure a service type even if you are invoking the custom property editor s from the property sheet of a class the changes you make to the service type will affect all other classes that use that service type Removing service types To remove a service type o Right click on the service type s node in the Explorer and choose Delete from the contextual menu Customizing the environment A big advantage of Forte for Java is that you can customize the graphical user interface GUI to best fit the way you work That means that you can determine what commands are shown in the existing menus and toolbars add your own com
157. esktopPane to it To add JInternalFrames select them from the Swing Other tab of the Component Palette and click on the JDesktopPane This adds internal frames with fixed structure Alternatively you can create separate forms for the types of frames you want and then construct and add these in code to the desktop pane thus giving you mote flexibility You can add other components to the JDesktopPane such as a JTable or JSlider However these have their standard properties and users can t manipulate them in the same way that they can manipulate a JInternalFrame containing those components 146 Chapter 6 Designing Visual Classes with the Form Editor JSplitPane A JSplitPane has two sides each of which might have a component placed in it A user can move the divider between the sides to make one side bigger and the other smaller As with other special components of this type Forte for Java enables you to manipulate it during design for instance to drag the divider You can change the orientation of the divider from vertical to horizontal with the Orientation property under the Properties tab of the property sheet You may find that it is easiest to select the JSplitPane itself by clicking on its entry in the Component Inspector Configuring the Form Editor It is possible to configure the behavior of the Form Editor and the appearance of the Form Editor window under the Form Objects node in the Global Options window See For
158. etain their preferred size for that dimension Adjust the insets for the component The insets determine the amount of free space on each of the four sides of the component You can enter numbers for these manually or use the inset buttons on the bottom part of the left pane These buttons are divided into four sets The top group enables you to increase and lower the inset for each side separately The second group enables you to change the left and right insets simultaneously The third group lets you change the top and bottom insets simultaneously The fourth group enables you to change all insets simultaneously As you change the insets you will see the inset area marked by yellow change in the right pane The internal padding settings enable you to increase the horizontal and vertical dimensions of the component You can adjust these by directly entering numbers for the properties or by using the internal padding buttons As you adjust these constraints you can see the selected component in the right pane expand or contract vertically and or horizontally according the changes you make The Fill constraint enables you to choose whether the component will use all of the vertical and or horizontal space allocated to it Any space allocated to a component that the component does not fill is marked with blue in the right pane The Anchor constraint enables you to place the component in one of nine positions within the space allocated to i
159. eter type and enter the parameter name Click OK to add the parameter to the list of parameters To edit a parameter select a parameter in the parameters list and click Edit Change the parameter type or name in the dialog box that opens Click OK to establish the change To remove a parametet select it in the list of parameters and click Remove Click OK to confirm the deletion 291 Appendix F Custom Property Editors Exceptions Editor Add edit or remove an exception with the Exceptions Editor Click the Exceptions property of a method then click the button to open the Exceptions Identifiers Editor To add an exception click Add A dialog box opens in which you can enter the name of an exception Click OK to add it to the list of exceptions To modify an exception name select the exception in the exceptions list and click Edit Edit the name in the dialog box that opens Click OK to establish the change To remove an exception select it in the list of exceptions and click Remove Click OK to confirm the deletion Error Expression Editor In the Error Expression Editor you can create a regular expression in POSIX format desctibing the format of the error output of the specified compiler You can also define a custom expression if using a different compiler and save that setting Select one of the pre defined sets for error descriptors Sun javac Microsoft jvc or Customizer dialog box The
160. ets for the different editor types found under Editor Settings in the Global Options window provide many preferences that you can set including type of caret insertion point insets and status bar caret delay See Editor Settings reference on page 265 for more information Customizing menus and toolbars You can organize all menu and toolbar commands in the IDE to your preferences so that you have quick and easy access to them From a customization point of view there are only minor differences between the menu and toolbars because they are both used as generic containers to visually display a list of commands Changing commands in menus and toolbars You can add and delete existing commands on the menus and toolbars using clipboard style operations To add a new command to a menu or toolbar 215 Chapter 11 Configuring and customizing the IDE 5 Choose Tools Global Options from the main menu In the Global Options window expand the Act ions node and then the approptiate category node Select the action you want to add and choose Copy from the Edit menu or contextual menu or by keyboard shortcut Under the Menu ot Toolbars node in the same window select the subnode for the menu of toolbar under which you would like to place the command Choose Paste Copy from either the Edit menu or contextual menu To move a command to a different menu or toolbar 1 4 In the Global Options window expand the M
161. execution types 151 creating 148 editing 149 query parameters 150 restarting the server 151 running 150 setting the web browser 152 wizard 149 Java Sources reference 261 settings 181 JavaBeans components 98 adding to the IDE 107 Bean Info 103 Bean Patterns 98 creating event sets 101 creating properties indexed 100 customizing 106 deleting properties and event sets 103 properties 99 Javadoc 86 Auto Comment Tool 172 changing directory for documentation 176 Comment dialog box 173 Documentation property sheet 185 Documentation settings reference 263 generating documentation 175 properties 175 Search dialog box 171 searching 168 JDesktopPane 146 JInternalFrame 146 JList 146 JScrollPane 143 JSP amp Servlets options 186 reference 272 JSplitPane 147 JSPs See Java Server Pages JTabbedPane 144 JTable 146 296 K keyboard shortcuts code formatting 49 complete list of 228 configuring Editor shortcuts 209 customizing non Editor shortcuts 219 Editor bookmarks 43 Java shortcuts 46 jump list 42 matching braces 48 miscellaneous 48 navigation 41 text scrolling 42 word match 47 L layout constraints 121 layout managers 119 128 absolute layout 124 border layout 122 box layout 124 card layout 123 custom 127 flow layout 122 grid layout 123 gridbag layout 123 gridbag layout customizer 125 null layout 125 setting and changing 120 layout properties 121 look and feel changing 208 M Main Window 22 menu editor 141
162. ext and Object Name and then press the Search button The Search Results window will then appear and give a tree view of the results of the search You can use this window much as you use the Explorer Contextual menus are available for each of the items listed and you can use the Properties window to display the properties of the selected item For every search that you initiate a new tab will appear in the Search Results window with the results for that search If you press the Customize Criteria button the Customize Criteria dialog box will reappear with the criteria used in the last search You can modify these criteria to refine your search 83 Chapter 4 The Explorer and Object Browser Organization of the Customize Criteria dialog box The Customize Criteria dialog box box is divided into two panels e In the first panel labeled Predefined you can choose from and save sets of search criteria e In the second panel labeled Modified for the Date tab Text Contains for the Full Text tab and Name Contains for the Object Name tab you can adjust predefined criteria and create new search criteria The Predefined panel has a combo box that lists the options Apply and Do not apply the empty search criteria for that type and any sets of search criteria you have saved When Do not apply is selected the criteria entered in the second panel are not applied in the search When Apply is selected the criteria in the sec
163. f changes to a file and then finish with it If this is the case specify wait to the launcher For example many version control systems on Unix provide the option to edit a change log message with an external editor or to clean up the results of a merge before continuing with a check in If you use such a system and set the Open File launcher with wait as your external editor then the file will open in the IDE as usual but the launcher will wait to exit The launcher will not exit until you have made some changes to the file and saved them Currently it is not sufficient to just close the Editor window you must actually save changes If you decide you do not want to make any changes simply type any character delete it and then ask to save to let the launcher know you are finished with the file e help display a brief usage message line open the file at the specified line number Line numbers start at one Open File Server properties When using the IDE as an external viewet or editor you can control the behavior of the server that listens to open requests Choose Tools Global Options from the main menu and select theOpen File Server nodein the Global Options window You can configure how the server should behave by adjusting the following properties e Access Restriction By default only open requests from the same machine are honored so that other people cannot open files in your IDE If you set this proper
164. fferent action on the property sheet for the Java Editor node Note The Editor s shortcuts are distinct from other IDE shortcuts which can be configured by selecting Tools Configure Shortcuts from the main menu See Customizing IDE 209 Chapter 11 Configuring and customizing the IDE shortcuts on page 219 for information on configuring non Editor shortcuts To change the Editor s global keyboard shortcut assignments 1 Choose Tools Global Options from the main menu 2 Select the Editor Settings node in the Global Options window 3 Select the Global Key Bindings property and click on the button This will bring up the Key Bindings custom property editor a Property Editor Key Bindings List goto declaration A G Add jcompletion show help C SP ACE escape ESCAPE comment CS T uncomment CS D Remove make getter key Code ARU P G make setter key Code AItLI P S make is key Code ARU P 4 Inthe custom property editor select the shortcut assignment you want to change and press Edit 5 In the Edit dialog box that appears type the new Key for the shortcut Use the following abbreviations for special keys and separate the special keys from the final character in the key combination with a hyphen Press OKto confirm the change The special keys should be entered in the following form e Shiftkey S e Ctrl key C e Altkey A ENTER key ENTER e SPACE key SPACE e BACKSPAC
165. first parameter which you can then fill in If the method takes multiple parameters you can bring the list box back by typing a comma after you fill in the parameter If the IDE recognizes what type of parameter is required it s type is shown in the header of the completion window If not a question mark is displayed If you enter a parameter that does not match any of the recognized parameter combinations for the method name all the recognized methods of the given name and their parameter lists are displayed and an asterisk appears instead of the parameter list in the header of the completion window When the code completion box is open three other keyboard shortcuts are available e ALT o0 open the source file that the insertion point is on or immediately before or after e ALT g go to the variable declaration for the identifier that the insertion point is on or immediately before or after e ALT F1 open the web browser on the Javadoc file pertaining to the item that the insertion point is on For these shortcuts to work the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source See Adding your own classes to the parser database In addition for ALT F1 to work the Javadoc documentation for that source must be mounted under the Javadoc tab in the Explorer See Customizing Java code completion on page 212 for information on further option
166. fix represents a string to appear after it If there is nothing to replace the substitution code with the prefix and suffix parameters are ignored If you want to use a comma in the prefix or suffix enclose the string in double quote marks 273 Appendix D Reference Guide to Project Settings and Global Options For example to display information about exceptions on method nodes you could use the expression n e throws If the method does not contain exception code only the method name is displayed If there is exception code the following is displayed methodName throws exceptionName You can display the p a i and e codes in the following array format SubstitutionCode prefix suffix delimiter where delimiter represents the text that separates the parameters For example for Methods you could enter n p to display the method name and then the parameters of the method in parentheses If there is more than one parameter the parameters will be delimited with commas If there are no parameters only the method name will be displayed Open File Server reference Table 55 Open File Server properties Property Description Access Restriction If set to Any Host people on other machines can open files in your IDE Set to Local Host Only by default Port The pott the servet runs on by default 7318 Running If True the servet is on 274 Appendix D Reference G
167. ghlight Search to highlight all occurrences of the search text in the file Incremental Search for the search engine to try to find the text as you type without having to press the Find button Match Case to limit the search to text that has the same capitalization Smart Case to limit the search to text that has the same capitalization when at least one character of the search text is upper case e Match Whole Words Only to match the search text only to whole words in the file e Backward Search to search in reverse order in the file Wrap Search to continue the search at the beginning or end of the file You can also search using the following keyboard shortcuts 41 Chapter 3 Developing Java Applications F3 to find the next occurrence of the search text SHIFT F3 to find the previous occurrence of the search text CTRL F3 to find the next occurrence of the selected string or if nothing is selected the word that the insertion point is in ALT SHIFT h to switch the highlight search feature on or off Java code completion Forte for Java Community Edition also has a dynamic code completion feature where you can type a few characters and then bring up a list of possible classes methods variables and so on that can be used to complete the expression To use Java code completion 1 Type the first few characters of the expression for example import javax or someFile ge
168. ght mouse button This command parses output from the cvs 1og command e Diff display the differences between your working file and the repository head revision meaning the most recent version in the repository This command parses output from thecvs diff command 167 Chapter 10 Searching and Creating Javadoc Documentation Forte for Java Community Edition enables you to easily browse standard API documentation and other Javadoc files from within the IDE and create Javadoc documentation for your own classes Searching and browsing Javadoc When you are editing files in the IDE you can quickly obtain information about the Java classes and methods you need by bringing up the Javadoc Search Tool and then viewing the selected documentation in the web browser You can also select a class in a file in an Editor and press Alt F1 to view API documentation on that class without having to enter the class name in the Search Tool Chapter 10 Searching and Creating Javadoc Documentation Preparing the Explorer s Javadoc tab Before you can do Javadoc searches within the IDE directories or JAR or ZIP files with standard API documentation need to be in the search path There should be two directories already mounted under the Javadoc tab in the Explorer The Java API docs directory if it is installed under the Java 2 installation directory It will appear there with a name such as usr jdk1 2 2 docs api e The Javadoc directory w
169. gl Explorer Javadoc olx E Javadoc D Forte4JCE_489javadoc Q G SiDevelpmentjavadocjavatidk13tapi index files E java 5 javax G org 9j allclasses frame E deprecated list E help doc E index 9j overview frame E overview summary E overview tree package list E packages E serialized form stylesheet css Browsing documentation for the selected class or element When you are working in the Editor you can bring up the Javadoc documentation by placing the insertion point in the word you want to search and pressing Alt F1 If the documentation for that class or element is mounted in the Explorer under the Javadoc tab the web browser will open and display its Javadoc documentation Searching in Javadoc directories Assuming the Javadoc directory is installed you can use the Javadoc Search Tool to find and view documentation from within the IDE To search on Javadoc documentation either 1 Bring up the Javadoc Search Tool dialog box by pressing CTRL F1 or choosing Help Javadoc Index Search from the Main Window 2 Use the combo box in the dialog box to type or select the search string and then press Find or press ENTER on your keyboard or O0 Select the string or click on the word you want to search in the Editor window and then 170 Chapter 10 Searching and Creating Javadoc Documentation press CTRL F1 or choose Javadoc Index Search from the Help menu Container v Find B Wos
170. he IDE running Javac externally and running Fastjavac Other types of files have different choices Tip To switch compilers for multiple classes simultaneously select the classes while holding down the CTRL key or the SHIFT key to select a range of classes and then switch the compiler on the property sheet Disabling compilation for a class If you have a source under the Filesystems tab in the Explorer that you specifically do not want to be subject to compilation you can disable compilation for that class Important Disabling compilation for a single class prevents the IDE from passing the name of the file to the compiler as a class to be compiled However if another class is dependent on that class the compiler itself may include the disabled class in the compilation To disable compilation for a class 1 Select the object under the Filesystems tab in the Explorer 2 Goto the object s property sheet by choosing View Properties from the main menu 51 Chapter 3 Developing Java Applications 3 Click on the Execution tab in the Properties window 4 Click on the Compiler property s value and choose do not compile from the pull down menu Configuring compilers It is also possible to customize the command line template for the executable compiler thus affecting the way the compiler is called For more information see Adding and modifying service types on page 204 Setting compiler types in templates If y
171. he Menu or Toolbars hierarchy of the same window select the parent container and choose Change Order from its contextual menu A dialog box will appear which will enable you to rearrange the commands by dragging and dropping with the mouse or by using the Move Up and Move Down buttons on them 216 Chapter 11 Configuring and customizing the IDE Creating new menus and toolbars You can also create new menus and toolbars in the IDE To create a new menu 1 Choose Tools Global Options from the main menu 2 Right click on the Menu node and choose New Menu from the contextual menu 3 In the New Menu dialog box that appears type the name of the new menu and click OK To create a new toolbar 1 Choose Tools Global Options from the main menu 2 Right click on the Toolbars node and choose New Toolbar from the contextual menu 3 Inthe New Toolbar dialog box that appears type the name of the new toolbar and click OK Dragging toolbars The Main Window toolbars can be managed with mouse operations and contextual menus directly in the Main Window To move a single toolbar Click on the handle on the left side of the toolbar marked by two light colored vertical bars and drag it with the mouse To move consecutive toolbars simultaneously o Right click on the handle of the left most of the toolbars and drag it with the mouse That toolbar and all toolbars to its right will be moved Toolbar contextual
172. he Project tab in the Explorer and work with them as you would under the Filesystems tab without having other files interfere with the view Explorer Project Default olx Project Default Q Xl clock G parti G part2 E part3 lt gt Project Default e You can configure the IDE uniquely for each project affecting such things as the mounted file systems compiler types executors and Editor configuration When you switch projects the IDE is automatically reconfigured to match the Project Settings you have set for that project The IDE s visual state is stored for each project when you exit the project or the IDE When you open a project the same files and windows will be open and in the same positions as they were when you last worked in the project If you have any projects that you have created with other Java IDEs you can import them into Forte for Java Creating projects When you work in the IDE you always work in a project whether it is the default project or one that you have created The current project you are working in is indicated by the the name of the root node under the Projects tab in the Explorer 154 Chapter 8 Organizing work into projects The default project When you start the IDE for the first time a default project representing the default state of the IDE is already in place If you do not create any new projects this default project will hold any changes made to
173. he code was interrupted You can add or remove breakpoints with CTRL F8 35 Chapter 3 Developing Java Applications e Compiler If there is a compilation error the cause of the error will be highlighted in red in the Output Window press ENTER or double click on that line to jump to the line with the error in the Editor The Editor window and its layout The Editor contains source code that is syntactically colored Different colors signify different text properties For example by default all keywords are shown in blue and all comments in light gray Guarded text generated by the Form Editor has a blue background by default and cannot be edited A faint vertical line in the Editor marks a suggested right margin for your text By default it is set at 80 characters from the left margin You can adjust this setting as well as its color in the Global Options window on the Expert tab ofthe Editor Settings Java Editor property sheet See Editor settings by type of editor on page 266 Fi ClockFrame of x variables decliaracion do not moairy private com netbeans timerbean Timer tmrSeconds private javax swing JLabel jlblCurrentTime private javax swing JPanel jPanell private javax swing JLabel jlblNewTime private javax swing JTextField jtfNewTime private javax swing JButton jbtnNewTime private javax swing JPanel jPanel2 private javax swing JLabel jlblNewFormat private javax swing JTextField jtfNewTimeFormat priva
174. he previous procedure Note Any file that you add to a directory that is already in the current project will also be added to that project even if do not have the Project tab in the Explorer selected when you are adding the file 157 Chapter 8 Organizing work into projects Setting the main class in the project When you have created a project and added some objects to it you can then set the main class for it This is the class that will be executed when you execute the project as whole CTRL SHIFT F9 This saves you from having to find and select the main class of your application in order to run your program To set the main class for a project Right click on the class s node in the Explorer under either the Filesystems or Projects node or the Object Browser and choose Tools Set As Project Main Class or 0 On the Project menu in the main window choose Set Main Class A dialog box will open in which you can select the main class If there is a class file currently selected under the Filesystems tab in the Explorer the text field will be filled with the name of that class Accessing and working with files in projects No matter which project you are working in you can work on any file listed in the Filesystems tab of the Explorer whether you consider it to be part of your project or not If you have added files to the project Adding packages and files to a project on page 156 you can access these files under
175. her the Editor is in insert or over wtite mode and so on is displayed at the bottom of the window Text Limit Charac ter Count The number of characters right of the left margin that the text limit line is displayed Text Limit Line Color The color of the text limit line Table 47 Java only Editor Settings Property Description Add Space before If True a space is added before the opening parenthesis in Parenthesis the generated code Auto Popup of Java If True the Java code completion box automatically Completion appears when appropriate Curly Brace on Next Line If True the curly braces generated automatically are put on the line following the previous code Delay of Java Auto Completion Popup Delay in milliseconds before the Java Completion popup appears 268 Appendix D Reference Guide to Project Settings and Global Options Execution Settings reference Table 48 Execution properties Property Description Clear Output Tab If True output is cleared from the Output Window before reuse Reuse Output Tab If False the IDE creates new tabs in the Output Window for each execution Run Compilation If True the IDE first compiles before executing a file Workspace The window to activate when executing a file Running Browsing Editing Debugging or None Form Objects reference The last six properties on this table are
176. heses r w r wotNo property editor and depend on the property and its property editor see Custom property editors below The value field either shows a property value as text or paints a representation of it like the color preview for a color property The tool tip for the value of the property displays the type of property such as java awt Color Clicking on this area switches the value field into input mode enabling the value of the property to be changed Double clicking a name switches the value if there are just two possibilities for instance changing True to False or if multiple values are possible the value advances to the next possible for instance black might change to blue then to red and so on for each double click There are several ways to change the value depending on the type of property You may edit the value as text choose from a pull down list open a custom property editor by selecting the 25 Chapter 2 IDE Essentials property and then pressing the button that appears or customize a painted preview directly in the painted area Property sheet toolbar The first three icons on the property sheet toolbar are toggles for sorting to leave unsorted sort by name and sott by type respectively The next toolbar button enables filtering of properties by accessibility read write so that only writable properties are displayed The right most toolbar icon brings up the Customizer The Cust
177. hich can be found in the root of the IDE s installation directory Note By default Javadoc search directories are set to hidden meaning they will not be displayed under the Filesystems tab in the Explorer If you would like to have a Javadoc directory displayed under Filesystems choose Project Settings from the main menu expand the Filesystems Settings node in the Project Settings window select the Javadoc directory s node and set its Hidden property to False If neither directory is present or you would like to add a new directory with Javadoc documentation you can add them by following this procedure To add a Javadoc documentation directory to the Javadoc tab in the Explorer 1 Inthe Explorer select the Javadoc tab right click on the Javadoc node and choose Add Directory from the contextual menu If you are adding a JAR or ZIP file with Javadoc documentation choose Add JAR for JAR or ZIP files Explorer Javadoc olx 2 Inthe Mount Directory dialog box or Mount JAR Archive dialog box when mounting a JAR or ZIP archive that appears choose the directory with the Javadoc documentation When selecting the Javadoc documentation directory you should look at all original documentation distributed with the SDK and be sure that it has an index files directory 169 Chapter 10 Searching and Creating Javadoc Documentation or index all html file in the top level or the second level of its hierarchy
178. hine on which Forte for Java is running and machines specified in Grant access to are allowed access default Selected Hosts Pott The port number on which the HTTP server operates default 8081 Running If True the HTTP server is running Base Class Path URL Gives access to internal IDE resoutces Base Filesystems URL Gives access to the contents of the Filesystems tab of the Explorer 271 Appendix D Reference Guide to Project Settings and Global Options JSP and Servlets reference Table 52 Servlets and JSP Property Description External browser Path to the external web browser Web browser Choice between using the default web browser and the external web browser specified in the External browser propetty Java Elements reference Table 53 Java element properties Property Description Classes Display name of classes using a combination of plain text and substitution codes Constructors Display name of constructors using a combination of plain text and substitution codes Fields Display name of fields using a combination of plain text and substitution codes Initializers Display name of initializers using a combination of plain text and substitution codes Interfaces Display name of interfaces using a combination of plain text and substitution codes Methods Display name of methods using a combination of
179. ialog BOxcxsesdspegeiestese qe qubdidieqhdadehebesu dis E Mohr 172 Javadoc Comment dialog OX ineat nian RU ba C VOR CRM bala ANE POUR Gel oc US 173 Generating Javadoc documentation cccssscccssseceesrseeesseeeseeeeseeeeseeeeseecesseeeesseeeeenees 175 JavAOOCDEODORUGS dossier eles docs Mehl ues n care dva Sahel dee di ARR ite Sia eset BG 175 Changing the directory for generated Javadoc documentation sss 176 Chapter 11 Configuring and customizing the IDE eese 177 Project Setting EN 177 Filesystems Setting Suunnan nni a n Fd be Dn aa tee et dede 178 bisce o M E ADM TR S 179 Execution T0682 ead mere RIDE qa iR HT A 179 MED a Rp irae aaaea ta Seca ca AE A A A ens eua T 180 Compiler Lype Sestais tipa reta tuat etit bita atri attt tetuer dean ate ailes 180 Search M ror ianurie n GI 180 JAVA SOUTE S Tec MM M CMM M MED M uda 181 Contents lejsedesop prp 181 Project GIDHODS cutaneous ttu wine ieee eae 181 Global OC DU Ons aides icns Fears heus erus eR ROM RCR ERES E E e E nad ENSE RR ERI E e E 182 Mules iae iter paio d d Hera ee Ee eh venie des eA GRE AE va Dx M oh NIA DO RE e qe cS 183 Toolbars sinin Te wala ata as Pao Feri tete aeri rs tee obrero e opi foi 183 PA CTMOUIS des he ibat Bad ente Fatis och Ranch Et c fes Ch E o aa a a 183 Men e edat quet dau quud adn md a added M A osten 183 Template Sue ot ote te dba Ree EE ERE E 183 Object TYDes idee S acre th D efe tel n Ce cena e
180. ialog appears to confirm any deletions you make Home Page Home page for the internal web browser Proxy Host Host of the proxy server Proxy Port Port number of the proxy server Show Tips on Star If True a dialog box showing a user tip will appear each tup time you start the IDE Use Proxy If True the proxy server is used 277 Appendix D Reference Guide to Project Settings and Global Options Update Center reference Table 61 Update Center Property Description Ask Before Check If True you ate prompted before the IDE checks for updates Check Period Frequency that the IDE checks for updates Last Check Date of the last check Registration Num Update Center registration number ber Show Negative If True the results of the update inquiry are shown even if Results there are no modules to be updated 278 Appendix E Actions This table lists and briefly describes each of the actions available in the actions pool under Global Options Actions Table 62 Build Actions Action Description Build Force compilation of all objects in selected folder whether current ot not Build All Build selected folder and all sub folders recur sively Clean Delete all class files in the selected package Clean All Recursively delete all class files in the selected package and its sub packages Compile Compile the selected object Compile All Compile the se
181. ible to switch the default executor When you switch the default executor this switch affects all classes and templates for which the user has not specifically assigned an executor 55 Chapter 3 Developing Java Applications To switch the default executor 1 Choose Project Settings from the main menu to open the Project Settings window 2 Select the Java Sources node in the left pane of the Project Settings window 3 Select the Default executor property and choose a new default executor from the dropdown list Note Once you change a class or template s executor the IDE will never again recognize the class as using the default executor even if you switch the executor for the class back to the one that is the IDE default Therefore if you change a class s executor and then change it back to the default executor the class s executor will not be affected if you change the default executor Configuring external executors It is also possible to customize the command line template for the executor thus affecting the way the executor is called For more information see Adding and modifying service types on page 204 Setting executors in templates If you use more than one compiler type in your work you can create a set of templates with the different execution types that you use See Creating your own templates on page 201 and Modifying existing templates on page 202 for more information Passing command line argumen
182. ide to Project Settings and Global Options Table 44 Global Editor Settings property Property Description Global Key Bind Enables you to use the custom propetty editor for key ings bindings to set the key combinations for the available short cuts These do not include the keyboard shortcuts that can be configured separately for each type of editor or which apply to the IDE as a whole Editor settings by type of editor Most Editor Settings are divided by type of editor Plain HTML Java and JSP editors in Forte for Java Community Edition with other types added by extension modules Even though the different editors have many of the same properties in common most of the properties for the different types of editor are configured separately The only exception is Global Key Bindings which is configured globally for all types of editors Table 45 Standard properties available separately for each editor type Property Description Abbreviations Enables you to use the Abbreviations Map custom prop erty editor to set abbreviations that the Editor will automat ically expand to longer strings when you type them Expand tabs to If True tabs in the document are converted to spaces pad spaces ded to the same column Font Size If you change this property the font for all tokens will be set to that size regardless of sizes set in the Fonts and Colors property Fonts and Colors Provides a
183. ie i o E d e pea ode 200 Cher Terplabe Soest a Po lee ba tante ert etian oro wb ei v Doe Todi onion 200 Bookmatk etcetera eee teinte e dte dte 200 Group OF Elles iesus neaete eeu PN Ee T ie Da e pase eT tse dd 201 IMBRE 201 gc H N 201 Creating vont Wil templates ae ur pe pd Deer aqu ueber du DR OHNE 201 Modifyins exis ute Templates os cacumen d pae Cu eH aS UR S RU UA I eoa CO A UR Fs 202 Usine macros templates n ce ertt voe te tue um PR rte SNS 202 Creating and editing macros entente tenente entente tenen tetentetertenetnnens 203 Advanced macto feature neniani d e ar RII ainai apei sapaian nsaisan 203 Adding and modifying service types esee eene nennen eene nnne 204 PRICING SERVICE TVA ICS NINE NOE 204 Configuring SERVICE tYDOS eiui t dies read dais esee tabe beide Monete eu eua Gre n Pee Pedir 206 Process Descriptor property editor ssssssssseeeeeee eene nene 206 Editing service types from the Filesystems tab in the Explorer 207 Removing service types oue sine acne aes id matices bale gata fadum dr ume ave nts 208 Customizing the environment 2o ese dr atro ORA FAEERE UE CREER Me AEMS CE TERR HR AIEO Urge dd 208 Changing the look ang feels odd tse rare o vac id ved on o d UA EIU a EA ERR 208 Confip rino th Editt samet ae adeo sd ene dad adeunt d da ret bee mean lm a 209 Changing assignments for Editor keyboard shortcuts 209 Customizing Editor abbreviations
184. iew and edit the various options for the selected item As in the Explorer contextual menu items such as Customize Bean Copy and Paste are available for many of the Global Options nodes a Global Options L OE x rd moria zm e m E Toolbars 5 Actions Ex Menu amp Templates E Object Types i Startup 3 Component Palette A Bookmarks Debugger Settings H Documentation F Editor Settings Java Editor Plain Editor F i To open the Global Options window choose Tools Global Options from the main menu For information on IDE settings that can be configured by project see Project Settings on page 177 Abbreviations Add Space before Curly B A Auto Popup of Java Compl Compound Bracket on Ne Delay of Java Completion 4 Expand Tabs to Spaces A Fonts and Colors Fonts amp Colors Key Bindings java util List Below are descriptions of each item in Global Options 182 Chapter 11 Configuring and customizing the IDE Modules This node lists all of the modules currently installed in the IDE The property sheet for each module shows the module s name version number and whether it is enabled Toolbars Under Toolbars you will find various customization settings for the buttons of the toolbars on the Main Window and all of their elements You can add and remove commands for each toolbar You can also change the otder of the toolbar items and i
185. in Param If the value of MacroName does not end in Param1 Param3 is returned as the value for the macto For example if you enter the following into a template Name Impl Spec Unknown and you create an object from the template called MyC1assImpl the text MyClassSpec would be returned by the macro in the new object If the object you created was merely called MyClass the value Unknown would be returned Tip Macros are particular useful when you create groups using the Group of Files template 203 Chapter 11 Configuring and customizing the IDE You can create your own group integrate macros into the name and text of the files and then turn that group into a template Adding and modifying service types Forte for Java Community Edition provides editable service types to give you more control over how your applications are compiled executed and debugged These service types specify not only which compiler executor or debugger to use but also how the service is to be called what the path to Java is what arguments are used and so on The IDE comes with a set of default service types which suit most development tasks A compiler type executor and debugger type is assigned to each class by default You can set service types for each class individually on its property sheet You can also modity the existing service types and create new ones For example the default service type for external execution of applications
186. in that workspace When you choose a window from the submenu of a different workspace than the one you are currently using that window opens up in your current workspace as well 189 Chapter 11 Configuring and customizing the IDE The Editor will then be visible on both the Editing and Running workspaces Workspaces are completely customizable you may add delete and rename the available wotkspaces You can also customize which toolbars appear in each workspace See Customizing workspaces on page 222 for further details Multi tab windows A multi tab window presents multiple files as separate tabs in a single frame enabling you to quickly and easily flip between these files either by clicking on the tabs or by using the ALT LEFT and ALT RIGHT keyboard shortcuts Each tab has a contextual menu of commands Save Clone View Close and Dock Into accessible by right clicking on the tab itself See below for more information on cloning docking and undocking windows Note Multi tab windows with only one file or component look like single windows that is they do not have a tab Thus commands that appear on contextual menus for tabs must be accessed elsewhere such as from the Main Window when in a single window Once a second file is opened in or docked to the window tabs for both items appear Undocking and docking windows While the multi tab window enables quick and efficient access to more than one file or view
187. in the Location The forward and back arrows cycle through previously seen pages the Stop icon stops the loading process and the Home setting is set by default to the NetBeans web site http www netbeans com Clicking the History icon gives you a list of all URLs you have loaded in the session and enables you to double click on any of them to bring that web page back You can search for text strings in the web browser by choosing Edit Find from the main menu or by using the CTRL f keyboard shortcut To open an additional web browser window Choose Window Clone View from the main menu to open a new browser window Another web browser window will open with the same web page Type a new URL in the Location to load a different web page Note You cannot open multiple web browser windows by other means Choosing Web Browser or pressing ALT 7 causes the current window to revert to the default home page 69 Chapter 3 Developing Java Applications You can also set a different home page the page that displays when you open the web browser or press the Home icon To set a different home page 1 Choose Tools Global Options from the main menu 2 Inthe Global Options window select the System Settings node and enter the new home page under the Home Page propetty 70 Chapter 4 The Explorer and Object Browser Forte for Java provides two different tools for managing files in the IDE The Explorer which provides
188. ing run time You can select or add components but dragging com ponents is disabled Test mode Similar to real mode the form behaves exactly the same as during run time When clicking on the form the mouse events are delivered to the actual components Thus for exam ple a button looks pressed when you click on it This mode is suitable for checking the look and feel of the form without the need to compile and run it To switch between design and real mode use the Design Mode icon the square with a pound sign inside from the toolbar If the icon is selected as shown in the design mode example above you are in design mode Otherwise you are in real mode Switching to test mode is done using the Test Mode icon on the toolbar this is a toggle button which means you click to enable it and click again to disable Note that switching test mode on disables the Design Mode icon to enable it again test mode must be switched off These modes are kept separately for each form Note When test mode is switched on the form is resized to its preferred size this is how it looks if it is not explicitly resized by calling setSize or setBounds 132 Chapter 6 Designing Visual Classes with the Form Editor Events Events are managed through the component s Events tab in the Component Inspector which gives a list that matches each event fired by an object with its corresponding handler method There is
189. ion codes enclosed in curly braces which you can use and are used by default in defining the service type The values for substitution codes such as repository and classpath ate shown under the Expert tab of the service type s property sheet 206 Chapter 11 Configuring and customizing the IDE Property Editor External Compiler NbProcessDescriptor Process ljvahomeX Ueinjevec java avahomeX 4bingjaevac ss Anbint javac rguments Lesystems classpath library bootclasspath filesystems content of filesystems development classpath classpath classpath bootclasspath system classpath system library path absolute filenames to be compiled java home JDK installation directory file name separator character class path separator character Note The arguments substitution code uses any arguments entered in the Arguments property of the class being run Tip If you use a lot of different service types you can save time by incorporating them into object templates which you then can use each time you create a new object Just create a generic class set the desired service types on the class s property sheet and then save the class as a template For more information see Creating new objects from templates on page 200 Editing service types from the Filesystems tab in the Explorer You can also access the property sheet for the different s
190. ions from the main menu If the Reuse Output 68 Chapter 3 Developing Java Applications Window Tab property is set to True each individual application uses only a single output tab that is successive executions do not create new tabs If the Clear Output Window Tab propetty is set to True the tab 1s cleared before reuse Clear Output Window Tab is useful only if Reuse Output Window Tab is set to True Contextual menus which provide window management options are available on the tabs see Window management on page 187 You can also right click in the body of the pane for the options Copy to Clipboard and Clear Output An application s output tab also provides a right click contextual menu with the options Terminate Process and Close Output Window Tab Internal web browser Forte for Java Community Edition includes the ICE Browser from ICEsoft a built in full featured web browser that is useful in both testing and providing easy access to online help sources It enables standard browsing capabilities from within the IDE and is useful in reaching online help soutces To open the web browser do one of the following Choose Web Browser under the View menu on the Main Window 0 Press ALT 7 the default shortcut 0 Select a bookmark from Help Bookmarks in the main menu Open an HTML file or bookmark in the Explorer Once the browser is open it operates like any simple browser To load a different page type the URL
191. ious procedure If you have multiple source files in directories mounted in Filesystems that implement the changed interface a Confirm Changes dialog box will appear for each one of them If you have automatic synchronization disabled on a specific source file or for all source files you can still synchronize a class with its interface s methods by choosing Synchronize from the class s contextual menu Note The Synchronize command only works when chosen on class objects not interfaces 97 Chapter 5 Developing and Customizing JavaBeans Components Forte for Java Community Edition provides tools to make generation and customization of JavaBeans components faster and easier You can create the standard parts of your bean such as properties listener support default constructor and BeanInfo without having to wtite any code manually You can als use in your development work o customize existing beans and add beans to the IDE for Developing JavaBeans components In Forte for Java creation of JavaBe code In the Explorer you will find i ans components begins with any class that has soutce Bean Patterns as asubnode of any such class All of the operations for maintenance of property and event sets thus all of the things that determine the characteristics of the bean can be accessed and modified from this subnode Chapter 5 Developing and Customizing JavaBeans Components Note Bean Patterns als
192. ists all mounted file systems You can customize the appearance and behavior of file systems that are currently mounted local directories as well as JAR and ZIP archives If a new file system 1s added to the Explorer it automatically appears as one of the items in theFilesystems Settings tree You can use the contextual menu on the Filesystems Settings to add new file systems and re order current file systems See Filesystems on page 75 for more information 178 Chapter 11 Configuring and customizing the IDE On the property sheet you can hide file systems or make them read only Under the Capabilities tab on the property sheet you can disable the IDE from performing certain tasks on the file system searching for sources to compile searching for classes to execute seatching for classes and sources to debug and searching for HTML pages with documentation These properties are of particular interest if you want to mount the Java 2 SDK itself and debug it You can set the compi 1e property on the SDK file system to False to prevent the IDE from trying to compile it Tip Capabilities settings apply to entire file systems However if you would like to keep individual sources in a file system from being accidentally compiled executed or debugged you can change the source s Compiler Executor or Debugger property under the Execution tab of its property sheet to do not to accomplish this Workspaces Under Workspaces are
193. itializer 1 In the property s Form Connection property editor click Advanced to bring up the Advanced Initialization Code dialog box 2 Click either or both of the checkboxes for Generate pre initialization code or Generate post initialization code and enter the code you want to have generated in the appropriate text fields For information on adding pre and post initialization and pre and post creation code for components see Modifying generated code for components on page 128 Menu editor The Form Editor can be used to create and modify menus The AWT and Swing variants of both MenuBar and PopupMenu are suppotted Creating a menu bar To create a new menu bar click on an AWT or Swing menu bar component in the Component Palette as shown below Then click anywhere on the form on which you want to add the menu The menu will appear under the Non visual Components list in the ds iiis Inspector since it cannot be manipulated by the layout manager AT Swing Swing Other Beans Layouts Borders eG Pale EET cee If this is the first menu bar you have added to this form it will also appear visually on the form Note that only the AWT MenuBar can be used as the main menu for AWT forms The same is true for Swing forms and the JMenuBar It is possible to add the AWT MenuBar to Swing forms and vice versa but you will not be able to use it as the displayed main menu for 141 Chapter 6 Designing Vi
194. ition Before you read this book It is assumed that the reader has a general knowledge of Java Java beginners can use this guide in conjunction with documentation for the Java 2 Platform Standard Edition v 1 2 This manual is not a comprehensive guide to the Java 2 Platform For more detailed information about Java download the documentation that comes with your implementation of the Java 2 Platform For the Java 2 SDK Standard Edition v 1 2 2 you can download the documentation directly from the Sun web site at http java sun com products jdk 1 2 download docs html How this book is organized After the introduction the User s Guide is divided into the following chapters IDE Essentials on page 21 provides a quick tour of major components and features of the IDE s user interface This is a good place to start if you are using the IDE for the first time and need general information about how to navigate and find commands Developing Java Applications on page 33 is a how to chapter which provides an overview of developing running and debugging applications using the Forte for Java IDE The Explorer and Object Browser on page 73 provides an in depth look at the Explorer and Object Browser and gives information about their many features including helpful code generation options Developing and Customizing JavaBeans Components on page 98 provides information about creating and customizing JavaBean
195. ition has a wide range of features Editor The Editor provides all standard editing functions and has many other useful features such as e Java code completion customizable syntax coloring for Java HTML and JSPfiles e advanced search capabilities e theability to jump to the source for the class or method the insertion point is in the variable declaration or the Javadoc documentation for the source directly from the Editor window e ump list capability enabling you to easily jump back and forth through the various points where you have been working in your files e awide selection of other customizable keyboard shortcuts including ones for features such as indenting text commenting out text and Editor bookmarks customizable Editor abbreviations Form Editor You can design graphical user interfaces for your applications visually with the Form Editor The Form Editor augments the Editor with two more windows the Form Editor window and the Component Inspector The Form Editor window provides a design time representation of your form as you are building it You can easily add components to a form by clicking on a button in a special toolbar the Component Palette and then clicking on the part of the form where you want to place the component Clean and readable code for the components is then generated automatically in the Editor The Component Inspector window provides makes it easy to modify component properties The
196. itor window to add the component to the form You can add multiple components of the same type by holding down the SHIFT key and clicking multiple times 114 Chapter 6 Designing Visual Classes with the Form Editor The Palette automatically changes to selection mode the add selection icon becomes selected after the component has been added to the form Depending on the layout used you can add a component or move it by dragging it to a specific position Border and Absolute layouts and or set the default size of the component by dragging the mouse on the selection handles Absolute Layout To add a component using the Explorer 1 Under the Filesystems tab in the Explorer find the class of the bean you want to add 2 Right click on the class and choose Copy from the contextual menu 3 Choose Paste from the contextual menu of either the Component Inspector or the Form Editor Selecting components You can select components in the Form Editor either directly in the Form Editor window when in selection mode the default mode shown in the figure below or by selecting component nodes in the Component Inspector s tree To select multiple components when clicking on the Form Editor window hold down the CTRL key as you select them Selection mode IS a0 IA The Component Inspector displays the current selection on the active Form Editor window Its property sheet displays the properties of the selected component or if
197. ivalent to ALT Appendix A Default Keyboard Shortcuts Global Shortcuts Context Sensitive Help You can get context help for a component in the GUI by placing the mouse cursor over that item and pressing F1 Components that have their own context help include windows dialog boxes nodes and window tabs Clipboard Table 10 Clipboard shortcuts Press To CTRL c Copy current selection into the clipboard CTRL x Cut current selection into the clipboard CTRL v Paste current content of the clipboard DELETE Delete selection Note In some cases it is better to call the Paste command from the contextual menu for a node in the Explorer because more specific options are provided For example when copying a file from one directory to another you have the option of creating a duplicate file or a link to the original file Form Editor Shortcuts These shortcuts are useful when you are designing visual forms using the Form Editor Table 11 Form Editor shortcuts Press To CTRL F10 Switch to Form Editor window CTRL F11 Switch to Editor window CTRL F12 Switch to Component Inspector 229 Appendix A Default Keyboard Shortcuts Explorer Shortcuts The following items are associated with the Explorer though the Explorer does not have to be open to use all of them Table 12 Explorer shortcuts Press To CTRL Open the Customize Criteria dialog box to search Filesy
198. l system Setting up the repository and working directory You should have the CVS system installed on your system before you start using it from within Forte for Java If you are not sure if it is installed start a command shell and type cvs If it is installed a help message will appear Ensure that you have the PATH environment variable to CVS properly set If you have not already done so you will then need to set up a repository and a working directory for files that you work on in CVS To set up the CVS repository Outside of the IDE create a folder or directory such as home Repository Preferably the repository should be put in a place where each developer working on the project can access it but where it is unlikely that accidental deletions could occur To set up the CVS working directory Outside of the IDE create a folder or directory on your local drive such as home bob MyDocuments work Creating a CVS project Once you have CVS set up on your machine and you have set a repository and working directory you can begin creating CVS projects To create a CVS project 1 In the Explorer window of the IDE select the Filesystems tab right click on the Filesystems node and choose New CVS from the contextual menu 2 Inthe Customizer dialog box that appears configure the module to communicate with CVS by following these steps a Choose the destination of the CVS repository in the CVS Connection Type panel If it is l
199. lected folder and all sub folders recursively Appendix E Actions Action Description Execute Execute the selected object Execute restart server Execute the selected JSP with a restart of the servet the server is not automatically restarted when you re execute a JSP Generate Javadoc Generate Javadoc documentation for the selected class or package NextError Jump to the next error in the Output Window PreviousError Jump to the previous error in the Output Win dow Set Arguments Set command line arguments to pass to an appli cation Set Request Parameters Specify query parameters for a JSP to be passed in the request from the browser to the server StopCompile Halt the current compilation process Table 63 Debugger Actions Action Description Add Watch Add a watch Add Remove Breakpoint Add a new breakpoint at the current line in the Editor or remove the breakpoint at the current line Connect Connect Debugger to a process in an already run ning virtual machine Debugger Window Make the Debugger Window the active window Finish Debugger Terminate debugging session Go To Cursor Go to the current line in the Editor New Breakpoint Add a new breakpoint Resume All Resume debugging of the selected threads Start Debugger Start debugging session Suspend All Suspend the selected threads in the
200. listed under the Expert tab on the property sheet Table 49 Form Objects properties Property Description Event Variable The name of the variable generated in the signature of the Name event handler method for the event object For example evt is the variable name in private void buttonlActionPerformed java awt event ActionEvent evt Generate Null Lay If True forms using the Absolute Layout manager will out generate null layouts instead of Absolute layouts Grid X Size of grid for AbsoluteLayout in the X axis Grid Y Size of grid for AbsoluteLayout in the Y axis Indent AWT Hierar If True the code generated in initComponents is chy indented for child components of a container 269 Appendix D Reference Guide to Project Settings and Global Options Property Description Output Detail Level Determines how detailed information written to the Out put Window is Choice between Normal Minimum and Maximum Property Editor List of packages that are searched for property editors that Search Path are to be used in the Form Editor Property Editors Explicitly registered editors for certain property types Show Grid If True a grid is displayed in the Form Editor when using AbsoluteLayout Variables Modifier The access modifier of variables generated for components on the form private package private protected or public Workspace The workspace the ID
201. ll Javadoc tags used in the comment When you select a Javadoc tag a combo box appears along with the Description text field If the see tag is selected two read only text areas named Class and Type also appear In the Desctiption pane you can change the description of the Javadoc tag selected in the combo box In the combo box you can change the selected Javadoc tag to another Javadoc tag There ate four buttons on the right side of the Tags pane e New brings up the New Tag dialog box which enables you to choose from predefined 174 Chapter 10 Searching and Creating Javadoc Documentation Javadoc tags or type another tag It is element sensitive so only appropriate tags on class members are shown Delete deletes the selected tag in the Tags combo box Move Up and Move Down change the order of the Javadoc tags in the comment by moving the selected tag up or down On the bottom of the Javadoc Comment dialog box are buttons with predefined HTML tags and the Javadoc link tag which you can add to your comment and have displayed in the Javadoc Comment Text pane Press OK to accept all changes or Cancel to reject all changes Note For detailed information about Javadoc tags visit Sun s Javadoc web page at http java sun com products jdk 1 2 docs tooldocs solaris javadoc html javadoctags Generating Javadoc documentation You can have documentation for entire classes and packages generated automaticall
202. lor by clicking on the property and then either selecting a color from the drop down list or invoking the custom property editor for colors by pressing Italic Insert Caret If True insertion point is italic when in insert mode Italic Overwrite Caret If True insertion point is italic when in overwrite mode Line Height Correc Multiplier to adjust height of lines tion Line Number Mar Brings up a custom property editor to set up placement of gin line numbers Margin Brings up a custom property editor to set top bottom left and right margins Overwrite caret The type of insertion point that appears when in overwrite mode From the drop down list you can choose between line thin line and block Overwrite caret color Insertion point color when in overwrite mode Scroll Find Insets Specify how much space should be reserved on each side of text located with the Find command 267 Appendix D Reference Guide to Project Settings and Global Options Property Description Scroll Jump Insets Specify for each four directions how much the view should jump when the scrolling goes off of the screen Status Bar Caret Delay The delay in milliseconds between the time the insertion point stops moving and its position is updated in the status bat Status Bar Visible If True the status bar which shows information such as current line number whet
203. ly deletes all class files in the selected package and its sub packages Built in compiler support The IDE comes with support for the Fastjavac and Javac compilers The IDE uses Fastjavac by default Fastjavac is a native compiler meaning that there are different versions of it for each platform but each version compiles into the same Java bytecode Fastjavac is available for the Solaris Linux and Windows platforms See Switching compilers by class on page 50 for information on setting the compiler for your classes Javac is a cross platform compiler written in Java Switching the default compiler type It is possible to switch the default compiler type When you switch the default compiler type this switch affects all classes and templates for which the user has not specifically assigned a compiler type To switch the default compiler type 1 Choose Project Settings from the main menu to open the Project Settings window 2 Select the Java Sources node in the left pane of the Project Settings window 3 Select the Default compiler type property and choose a new default compiler type 49 Chapter 3 Developing Java Applications from the dropdown list Project Settings Project Settings 3 Filesystems Settings I Workspaces Automatic parsing dela Pp Execution Types Default Compiler y Debugger Types LS sw Compiler Types Default Debugger External Compt d Search Types Default Exe
204. m Objects reference on page 269 for a description of configurable options To open the Global Options window select Tools Global Options from the main menu 147 Chapter 7 Developing Java Server Pages Forte for Java Community Edition provides suppott for creating compiling and editing Java Server Pages JSPs In addition you can use the JSP Wizatd to create standard and error handling JSPs using JavaBeans properties for dynamic content display and server side processing Creating and editing Java Server Pages To create a new JSP file 1 Choose File New from template from the main menu 2 Inthe Create From Template wizard that appears expand the node of the JSP and Servlet folder select JSP and click Next 3 Inthe next step of the wizatd choose the name and folder package of your JSP file and click Finish Chapter 7 Developing Java Server Pages The JSP file will be created in the specified package To edit a JSP file 1 Double click on the file in the Explorer or Object Browser 2 Type your JSP code directly into the Editor window that appears To create a JSP with the JSP Wizard 0 Choose Tools JSP Wizard from the main menu Note There is a default set of abbreviations especially for Java Server Pages that you can use when editing JSP files When you type one of the designated abbreviation and then enter a space the abbreviation is expanded into a longer string For a list of default abbreviations see
205. m the BeanInfo Subnodes of the Properties and Event Sources nodes The subnodes are the JavaBeans properties and event sources themselves Each of these subnodes has two groups of properties The first group under the Properties tab are general properties and apply to both JavaBeans properties and event sets The Expert tab holds settings specific to properties or event sets The most important property here is the Include in BeanInfo property which is set to True by default If you set this property to False the JavaBeans property or event set will not be shown in the BeanInfo either to users or to other classes You can also change this value by right clicking on the property or event source and choosing Toggle Include When True the icon has a green square with a white check mark when False it displays a red square with a white X In the Expert tab you can change the mode of a JavaBeans property to make it more restrictive that is you can change a READ WRITE to READ ONLY or WRITE ONLY Note If you have any JavaBeans properties with non standard names source for these is not automatically generated in the BeanInfo You can enter such code manually in the Editor In addition if an indexed JavaBeans property has a non indexed getter and setter you can specify whether these methods are specified in the BeanInfo Tip If you want to set a property sheet property to the same value for multiple JavaBeans properties or event set
206. main menu 2 In the Packages pane of the Object Browser right click on the package where you want to place the class and right click on it to bring up its contextual menu 3 Choose New From Template the template type from the first submenu and then the template itself from the second submenu The Target Location page of the New From Template wizard will appeat 4 Type the name of the object in the Name field verify that the correct package is selected in the Package panel and click Finish 34 Chapter 3 Developing Java Applications Once you have created the class the Editor window or a tab in the Editor window if the Editor is already open will open up and display the skeleton code for that class already generated If the class you have created from the template is a visual form the Form window and Component Inspector will also open The new class will also be automatically added to the Explorer s tree and the Object Browser see Guide to the Object Browser on page 86 You can now edit your new class either directly in the Editor window see Editing Java sources below or by using customizer dialog boxes to have the dialog generate various class elements such as methods constructors and variables Note Unlike other IDEs the project is not the central paradigm for developing applications in Forte for Java All objects developed in the IDE as well as any other file systems mounted in the IDE are all acces
207. main menu gll Explorer Filesystems olx Directory Add JAR New CYS Properties Memory ViewLocale texteditor Q F tutorial E clock colorpicker imageviewer readme 3 Filesystems A dialog box will appear which enable you to choose the directory to mount To mount a new JAR or ZIP archive Follow the same procedure as for adding directories except choose Add JAR instead of Add Directory Note Mounted JAR archives are read only You can also mount a file system at the same time open one of the files in it To mount a file system and open one of its files 0 Choose Open File from the first toolbar or the File menu in the Main Window A file chooser will appear which will enable you to browse your file system and select a file which you can then add to the Filesystems tab of the Explorer See Adding a file to the IDE on page 77 To remove mounted directories or JAR or ZIP files from the Explorer Right click on the item and choose Remove From Filesystems 76 Chapter 4 The Explorer and Object Browser Order of file systems The order of file systems in the Filesystems is also significant If files with the same name and hierarchy for example com MyPackage MyClass java exist in two different mounted directories the first will be loaded during execution or debugging even if you have selected the second one To change the order of file systems Choose Pr
208. making those classes available in addition to the standard Java 2 Platform SDK classes when using the Java code completion feature in the Editor Tools Generate Jav adoc Generates Javadoc documentation for the selected classes or elements and places it in the directory that you specify Properties Opens a separate Properties window showing properties of the selected object s Working with objects While working in Forte for Java Community Edition you operate with objects rather than plain files Each object represents one or more files on disk Each object is shown with its own icon and properties The following table shows the object types used in the IDE Table 2 Object Types Icon Object Type Lj Package A package folder on disk or in a JAR or ZIP archive Java object Represents one Java source file java Its chil dren represent methods variables constructors and inner classes acquired by parsing the Java source Form object Represents one Java source file that can be edited visually in the Form Editor in Forte for Java The two types of subnodes are 1 classes with methods variables constructors and inner classes acquired from parsing Java source and 2 items rep resenting components on the form visual hierarchy Class object Represents one Java class without source code Children are methods variables constructots and inner classes a
209. mands and create new menus and toolbars You can reatrange the toolbars with your mouse You can also develop special workspace configurations set your own keyboard shortcuts for the available commands and customize the contextual menus for various nodes Changing the look and feel The Forte for Java user interface offers different looks based on the platform being used By default the IDE is set to the Java look and feel If you prefer to use the Microsoft Windows or CDE Motif look and feel you can edit the IDE s startup script to change the look and feel To change the IDE s look and feel on Windows machines 1 In the installation directory open the bin folder and select the forte4j cfqg file 2 Open forte4j cfg ina text editor and add one of the following switches to the startup script a ui com sun java swing plaf windows WindowsLookAndFeel if you 208 Chapter 11 Configuring and customizing the IDE want to change to the Windows look and feel b ui com sun java swing plaf motif MotifLookAndFeel if you want to change to the Motif look and feel If you want to change back to the Java look and feel open orte4j cfg and delete the switch you previously added for the Windows or Motif look and feel To change the IDE s look and feel on Solaris and Linux machines 1 In the installation directory open the bin folder and select the startup script forte4j sh for single users or forte4j_multiuser sh for multi us
210. matic workspace switchinp eec tette tier top eto big Festi estos tite ste deti estos ebbe da 189 Using workspaces enis a tte ove Nae ata bte ata asta du arte tee 189 Wish ta by wit cou S goce iod caen ed imu Des o ERU ERR RU a Ratan mann 190 Undocking and dockmo AOS i oefescienettivii dece dpi ygeqiesa i a eiii 190 lire O 191 Docking nanedaseduunceu a a dedans doit nui tee ire testet carter etd 191 Coni OD O Sq dedu er def o qu dicet Gad awe SG bu quid e RD p 193 Redisplaying windows obscured by windows from other applications sss 193 Modules in Forte for 44 uias i ea RURSUM ENDURO NUR EE RENI VENE VIENI RN 194 Man ging no rS opt ba iei dut redu pere dbi dr poc ar eni s oed euro Render died e 194 Adding modules with the Update Centet aeree cetur ae DO d e RC chau 194 Automatic Update Check dialog box sssssssssseeeeeeeenenenetene tentent 196 Adjusting proxy and firewall settings tenete tenete tenente 196 Authenticating Update Center downloads seen 198 Ipdating modules manually rere ete ted e n lates tern reb e dr 198 Contents Uninstalling and reinstalline modules coco istas asta ceo n On ead ba eO PIER Ee 199 Module Belo see uc ddiee te tice taxe etie dta ve eta eu toi E ARR 199 Using templates s epuecs mex a OR ARE MORE ah ven oc ag nk KT UN ELUUVRU EVER ta aR ENNIO E RIE 200 Creating new objects from templates eiae ae atiende e
211. may not suit every one of your classes so you may want to have multiple execution service types or executors You can create a new execution type for external execution and use this executor for some of your classes while you use the default executor for other classes Setvice types are represented as subnodes under the various categories of Compiler Types Debugger Types and Execution Types in the Project Settings window Adding service types To add a new service type 1 Choose Project Settings from the main menu 2 Expand the Compiler Types Execution Types orDebugger Types node 204 Chapter 11 Configuring and customizing the IDE depending on the kind of service type you want to add Project Settings Project Settings F Filesystems Settings amp Workspaces enia Properties gt bp Execution Types y Debugger Types Q wu Compiler Types m Move Up wm FastJavac Move Down i Internal Compila Search Types B Java Sources Paste amp Object Browser Project Options Change Order Properties 3 Right click on the node for the category of service type you would like to add and choose New service type Service from the contextual menu 4 Expand the category s node You will see at least two subnodes The last subnode is the newly created service type Project Settings Project Settings F Filesystems Settings am
212. menu and toolbar configurations There is also a contextual menu on the Main Window which you can use to manage toolbars You can access this contextual menu by right clicking on any empty space in the toolbar area 217 Chapter 11 Configuring and customizing the IDE of the Main Window JOBK lala M Build H Data H Debug i Debug Full H Edit iV Form V Palette H System J View ackage tutorial mort java util mort java util mort java util mort java text mort javax swin O Debugging Standard Save Configuration The contextual menu is divided into three parts e alist of available toolbars e alit of toolbar configurations e the Save Configuration command The available toolbars are listed with checkboxes By checking and unchecking these items you can control which toolbars are displayed in the Main Window The toolbar configurations are shown with radio buttons enabling you to check the configuration group of toolbars and their positions you want By default there are two configurations The Standard configuration includes the Debug toolbar which contains only a selection of debugging commands and is for all workspaces except Debugging by default The Debug configuration has the Debug Full toolbar with all Debugger commands and is used in the Debugging workspace by default The Save Configuration command enables you to save the current configur
213. mponents If you want to have multiple copies of a component within a form you can copy and paste the components in the Component Inspector To copy components 1 Select the item in the Component Inspector or the Form Editor window hold down the SHIFT or CTRL key to enable selecting of more than one item 2 Right click the item s and choose Copy from the contextual menu 3 Choose the destination container in the Component Inspector or the Form Editor window and choose Paste on its contextual menu The components will be copied with all properties and events intact although events are maintained only if copying within the same form 116 Chapter 6 Designing Visual Classes with the Form Editor Reordering components within the same container A container is a Java visual component for example a Panel that can contain other components Examples of containers are the AWT Dialog Frame and Panel as well as the Swing JPanel JDialog and JFrame The order of components within their parent container may determine the order in which they appear visually For some layouts such as Flow Layout modifying the order is the only way to modify the way components are laid out To change the order of components in the Component Inspector either O0 Right click on the component you want to move and use the Move Up or Move Down items in its contextual menu Right click on the patent container and choose Change Order from its contex
214. munity Edition is a Java integrated development environment IDE wtitten in Java Forte for Java is a cross platform tool that is fully functional for client and server side development Forte for Java takes advantage of the strengths of Java to provide you with a dynamic and responsive environment Forte for Java is intuitive The user interface provides several ways to perform most tasks and helps users with well placed contextual menus and tool tips Forte for Java is customizable The GUI can be modified to become a reflection of your own development style You can easily customize the menus toolbars Component Palette workspaces and other settings Forte for Java is modular This means that the IDE functionality for editing debugging GUI generation EJB support and so on is represented in modules that you can download and update dynamically Instead of waiting months for a new major release you can upgrade the latest modules from Sun Microsystems and our partners as soon as they are available Forte for Java is extensible Forte for Java has a complete set of Open APIs that are Chapter 1 Welcome to Forte for Java Community Edition available to out users and partners the same set of APIs that out own developers use to build Forte for Java Complete new Java tools such as visual builders for industrial application domains can take advantage of a mature tool construction platform Product features Forte for Java Community Ed
215. n Compiler If True files in the directory should be included in the compiler s source path Use in Debugger If True files in the directory should be made available when debugging Use as Documenta If True files in the directory are made available for Javadoc tion index searches via Help Javadoc Index Search or the CTRL F1 shortcut and for access from the Editor using the ALT F1 shortcut Use for Execution If True files in the directory should be made available meaning put in the class path when executing Workspaces reference Of the following properties the first two apply to workspace nodes and the remaining apply to the mode meaning the programmatic construct that allows several different types of windows to appear in a multi tab window 255 Appendix D Reference Guide to Project Settings and Global Options Table 29 Workspace properties Property Description Name Name of the workspace Toolbar Configura Choice of available toolbar configurations to display for the tion wotkspace Bounds Set the X and Y coordinates of the top left corner and the height and width of the window Display Name Display the name of the mode Name Programmatic name of the mode Visible If True the window is currently visible if the workspace is open Compiler Types reference Table 30 External Java Compiler service properties Property Description Debug If True th
216. n click on the form or click in the Component Inspector which enables you to also use non visual components as parts of the connection The Connection Wizard opens to connect the chosen components The Connection Wizard enables you to set the connection parameters in two or three steps 135 Chapter 6 Designing Visual Classes with the Form Editor Connection Source The first step enables you to choose the event of the source component on which the operation is to be performed and the name of the event handler method generated EY Connection Wizard Step 1 of 3 Connection Source Source Component iButton1 Event 7 action 7 ancestor 7 change 7 component J container 7 focus hierarchy C hierarchyBounds Ff inputMethod 7 item 7 key C mouse 3 mousePressed 3 mouseRel ssed 3 mouseClicked 3 mouseExited 3 mouseEntered Cf mouseMotion 3 mouseMoved Imc r Event Handler Method Method Name iButtoni MousePressed v ipee css Note If you choose an event that already has an event handler attached the name of the event handler is visible in the tree of events after the event name like actionPerformed buttonlActionPerformed when clicking Next you will be asked if you want to delete the old event handler If you answer yes the old event handler is replaced with the connection code when the Connection
217. n the IDE when the IDE is running Using the remote launcher manually To make this work first try opening a file in the IDE using the remote launcher manually Open a command prompt appropriate for your system for example MS DOS console or Unix shell Find the JAR file for the Open File module probably included in your Forte for Java installation Now decide on a file to open and type something like this C jgdk1 2 2 jre bin javaw jar C Program Files forte4j modules utilities jar C My Development com mycom MyClass java If the IDE is running you should see MyClass java displayed in the Editor or the usual mount dialog box may appear See Adding a file to the IDE on page 77 Please specify complete paths to all files to make sure the same command will work later The quotes are desirable especially in the Windows environment in case you have any directories with spaces in their names Associating the launcher with a type of file Now you ate ready to associate the Open File launcher with some file type in your application The details of how to do this will of course vary depending on the system Generally you must specify everything before the filename in the above example command as the external editor As an example to associate the IDE with java files on Windows machines 224 Chapter 11 Configuring and customizing the IDE 1 Open any Windows Explorer window and choose Tools Global Options
218. n the internal web browser Double clicking on a folder object such as a top level node simply expands or collapses the sub tree Property sheets Property sheets display and in the case of writable properties enables you to edit the properties of items such as class files elements of classes JavaBeans properties visual components HTML files running processes and debugging processes and IDE settings The property sheets for the Project Settings and Global Options windows can be used to configure the IDE When multiple items are selected the property sheet displays the properties that are common to all of the selected items If the items have multiple sets of properties each set of properties is displayed on a separate tab Accessing the property sheet The properties for objects listed in the Explorer Object Browser and Search Results can be viewed in the standard Properties Window This window appears by default in the Editing workspace and can be displayed by selecting View Properties from the main menu or using the ALT 1 shortcut This window displays the properties of the item selected in the Explorer Object Browser and Search Results depending on which of these is or was most recently the active window You can also display a separate Properties window for an object by right clicking on it in the Explorer Object Browser or Search Results window and selecting Properties from the contextual menu Note If you open a
219. n the status line next to the workspace tabs in the Main Window Compiling single classes You can compile an object in the active Editor window tab or if selected in the Explorer by e choosing Build Compile from the main menu ot clicking on the Compile icon on the main toolbar or pressing F9 or right clicking on the object in the Explorer and choosing Compile from the contextual menu Compiling packages There are several options for compiling packages all available from the Build menu and toolbar on the Main Window and the contextual menu for packages in the Explorer e Choosing Compile when a folder is selected compiles all sources in that folder which have been modified since they were last compiled or that have not been previously compiled e Choosing Compile All does this recursively on a folder and all its sub folders e Choosing the Build command also available with keyboard shortcut ALT F9 is slightly different from compiling in that it forces re compilation of all sources in a folder whether they are current or not Use this option when you wish to be sure that all of your code can compile together e Choosing Build All recursively builds a folder and all sub folders 48 Chapter 3 Developing Java Applications Deleting class files The Build menu also has the commands Clean and Clean All which delete compiled classes Clean deletes all class files in the selected package and Clean All recursive
220. name and method name or class name and line number private javax swing JPanel jPanel3 private javax swing JLabel txtTime private javax swing JTextField time private javax swing JButton doTime End of variables declaration 7 window in Dimension d Toolkit getDefaultToolkit qgetScreenSize Dimension m mv getSize d width m width d height m height d width 2 d height 2 nmv setLocation d vidth d heidght nv setVisible true INS 59 Chapter 3 Developing Java Applications Optional breakpoint settings If you set the breakpoint using the New Breakpoint command you have further options e Ifyou want to be notified in the Output Window when the breakpoint is reached check Print text in the Add Breakpoint dialog box You can also set the text to be printed using a combination of plain text and these self explanatory substitution codes lineNumber className and threadName In addition you can use curly braces and a dollar sign to create a substitution code for a watch for example mywatch e If you want to be notified in the Output Window when the breakpoint is reached check Print text in the Add Breakpoint dialog box You can also set the text to be printed using a combination of plain text and these self explanatory substitution codes lineNumber className and threadName In addition you can use curly braces and a dollar sign to create a substitution code for a
221. nded To suspend selected threads or thread groups 1 Under the Threads tab in the Debugger Window select the nodes of those threads or thread groups using SHIFT to select multiple consecutive nodes and CTRL to select various non consecutive nodes 2 Right click on one of the selected nodes and choose Suspend from the contextual menu To suspend all threads either 0 Choose Suspend All from the Debug menu or toolbar Right click on the root Threads node in the Debugger Window and choose Suspend from the contextual menu When a thread is suspended the Debugger Window displays all current information for the thread Likewise you can resume any or all of the suspended threads Choose Resume All from the Debug menu to tesume execution of all threads To resume execution for threads individually right click on the thread or thread group and choose Resume from the contextual menu Changing the current thread The current thread is set automatically when a breakpoint is reached When you use the Trace In Trace Out and Trace Over commands they affect only this thread You can change the current thread manually To change the current thread O Under the Threads tab in the Debugger Window right click on the node of the thread you would like to switch to and choose Switch to thread from the contextual menu Connecting the Debugger to a running process To connect the Debugger to an already running virtual machine 1 When la
222. ndles Other code generation options In addition to the custom code creation properties the following options are available under the Code Generation tab of each component s property sheet in the Component Inspector e Code Generation enables you to choose between generating standard or serialization code for the component e Setialize To enables you to set the name of the file for the component to be serialized to if it is serialized e Use Default Modifiers If True the component s variable modifiers will be generated according to the default modifiers set in the Variables Modifier property set in the property sheet for Form Objects in the Global Options window If False the Variable Modifiers property will appeat on the property sheet enabling you to set the modifiers Code Generation properties for containers A set of Code Generation properties is also available for containers These properties affect the size positioning encoding and active menu bar of the form Form Encoding The encoding to be used in the XML form file e Form Size Policy Overall policy for resize code generation You can choose to have resize code generated to not have resize code generated or to have the pack method generated in which case the form would be sized to fit the preferred size and layout of its subcomponents e Form Position Position on the screen where the form will open coordinates from top left c
223. ne JTabbedPane JTable JList JDesktopPane and JSplitPane In general these components are used the same way as other components Forte for Java provides special support in the form of features such as custom property editors which simplify some of the mote complex aspects of designing forms JScrollPane ScrollPane In many cases AWT components pop up their own scroll bars if their content needs to scroll An AWT ScrollPane is available though to add scrolling where it is needed Swing components however must be added to a JScrollPane if the content is to scroll This 143 Chapter 6 Designing Visual Classes with the Form Editor document will not cover other differences between ScrollPane and JScrollPane See the Java reference materials and tutorials for these particular classes We will discuss JScrollPane as it is more frequently needed and it is generally preferable to use Swing components To use a JScrollPane choose it from the Component Palette and click on the Form Editor window Then select the component to be added from the Palette to the JScrollPane and then click on the JScrollPane Remember that you can still select the underlying JScrollPane for instance to set its scrolling properties by clicking on its entry in the Component Inspectot JTabbedPane A JTabbedPane manages multiple components usually JPanels with their own layouts and sub components within its pane The IDE automatically gives each compone
224. nerally not all needed simultaneously Forte for Java workspaces enable you to efficiently manage a large number of windows and to group these windows into useful logical sets You can flip between workspaces by simply clicking the different workspace tabs on the Main Window Editing GUI Editing Browsing Running Debugging Standard workspaces The default workspace configuration is a standard and logical grouping of the most commonly used windows Editing Explorer and Properties window if any files are open the Editor window as well After compilation of files the Output Window opens if there are any compilation ertots GUI Editing Explorer if any visual forms are open the Editor window Form Editor window and Component Inspector as well After compilation of files the Output Window opens if there are any compilation errors 188 Chapter 11 Configuring and customizing the IDE e Browsing Object Browser and Properties window and then the Editor window if any files are opened Running Execution View Output Window Debugging Debugger Window Output Window and Editor if any files are open Automatic workspace switching By default the IDE automatically switches to the GUI Editing Workspace when you open a visual form to the Running Workspace when you execute a program and to the Debugging Workspace when you start a debugging session You can change this automatic switching by
225. nerated code 128 moving components 116 pre and post initialization code 141 real mode 132 reordering components 117 selecting components in the Form Editor 115 templates 113 test mode 132 Form Editor window 112 form files 131 Form Objects settings 185 reference 269 G Global Options 29 182 187 263 278 Actions 183 Bookmarks 184 Component Palette 184 Debugger Settings 185 Documentation 185 Editor Settings 185 Execution Settings 185 Form Objects 185 HTML Browser 186 HTTP Server 186 Java Elements 186 JSP amp Servlets 186 Menus 183 Modules 183 Object Types 184 Open File server 186 Output Window 186 Print Settings 187 Property Sheet 187 Startup 184 System Settings 187 Templates 183 Toolbars 183 Update Center 187 Go To Cursor command 66 grid layout See layout managers gridbag layout See layout managers group objects 201 guarded text 38 H help browsing documentation in external web browser 32 context help 31 for modules 199 Installation Guide 32 JavaHelp 30 printing 32 QuickStart Guide 32 tool tips 32 Tutorials 32 HTML Browser options 186 reference 271 HTTP Server options 186 reference 271 I Icon Editor 290 Insets Editor 291 installation 32 Invalid package declarations 92 J JAR files mounting 76 Java code completion 44 customizing 212 Java elements 92 creating with the customizer 94 Index options 186 options reference 272 Java Server Pages compiling 149 configuring
226. ng Visual Classes with the Form Editor and Cancel buttons and customized user classes derived from one of the container classes above can also be created and then saved as new templates See Creating your own templates on page 201 Working with components Once you have created a new form the first thing you probably want to do is to add components to it in order to create functionality This section describes how to add and modify components in the Form Editor For more information on individual Swing components see Sun s Swing tutorial at http java sun com docs books tutotial uiswing components components html Adding new components The easiest way to add components is by using the Component Palette The Component Palette is a toolbar on the Main Window which holds commonly used visual components that you can add to forms You can add a component merely by clicking on the component in the Palette and then clicking on the form in the Form Editor window You can also add your own components to the Component Palette See Customizing the Component Palette on page 221 for more information To add a component using the Component Palette 1 Choose a component in the Component Palette by clicking on its icon The add selection mode icon shown in the figure above will become unselected showing that the Form Editor is in add mode Add mode with an AWT Label selected s 7 sm 2 Click on the Form Ed
227. nodes for every workspace and under these are nodes for each window inside of the workspace Since the configuration of each workspace is updated whenever you open or close a window within that workspace the window nodes also change to reflect the windows that are currently part of that workspace In addition the properties of the given windows reflect the size and positions you have given the windows in the various workspaces The workspace and window nodes each have their own property sheets On the property sheets for the workspaces you can set the name for the workspace and the toolbar configuration used for that workspace For the window nodes you can set the size and position of the window with the Bounds property and you can also set the Display Name You can also configure workspaces and set up new ones in the Explorer See Customizing workspaces on page 222 for more information Execution Types Here you can set specific configurations for each executor the actual system command that is called when you execute an object which includes the path to Java the working directory and any arguments You can use the default executors of each category external internal applet or JSP execution modify the default executors or write new ones You can then associate any of your classes to one of these executors if the default executor assigned for that class does not suit your needs There is a node for each categor
228. nsert separators Actions The action pool under Act ions in the Global Options window stores all actions commands that are available in the IDE most of which but not all are already represented in the menus and toolbars Since you cannot delete actions from the action pool this gives you the freedom to remove whatever items you want from the menus and toolbars without permanently removing them from the IDE You can add actions to the main menu and toolbars by copying them from the action pool and pasting them to folders beneath Menu or Toolbars in the same window Menu Under Menu you will find various customization settings for the menus and menu items in the Main Window Under the Menu node you will find settings for each menu on the Main Window menu bar including File Edit View Projects Build Debug Tools Window and Help Undet these are subnodes for the menu items You can add remove and customize commands for each menu and menu item You can also change the order of the menu items and insert separators Templates Here you will find the standard set of templates in several categories AWT Forms Beans Classes Sample Forms JSP and Servlet Swing Forms and Other Each category contains several templates for creating new objects See Using templates on page 200 You can also create your own categories and templates see Creating your own templates on page 201 and modify existing templates including their
229. nt its own labeled tab When the uset clicks on the tab its component is selected and comes to the front of other components 144 Chapter 6 Designing Visual Classes with the Form Editor JTabbed Pane in the Form Editor amp Component Inspector jTabb M E3 BorderLayout jPanelt JPanel FlowLayout Q f iTabbedPane2 JTabbedPane E jToolBar1 JToolBar UD BoxLayout EH jTable2 JTable jPanel2 JPanel alignmentx los 25 alignment los debugGraphicsOptions NONE_OPTION No Border l Properties The above figure shows a Form Editor window over the Component Inspector window A JPanel has been added to the JFrame a JTabbedPane has been added to the JPanel and three components have been added to the JTabbedPane By default each tab is named for its own component Each component in the JTabbedPane has its own layout settings where the tab parameters Tab Icon Tab Name Tab ToolTip are set Note Be careful where you click when adding new components to a JTabbedPane If you click on an existing tabbed component your new component might be added to the existing component rather than to its own new tab 145 Chapter 6 Designing Visual Classes with the Form Editor JTable JList A JTable is a grid of cells each cell having its own content A JList is similar but with just one dimension The special support for JTable and JList consists of a custom property editor th
230. ntextual menu 4 Change the contents of the menus in the following ways To add a command to the contextual menu select the command in the left panel and press Add To add a separator to the contextual menu press New Separator e To change the order of menu items select the item you want to move in the right panel and then press Move Up or Move Down until it is in the position you want To delete a command or separator select the item and press Remove 5 Press OK to confirm changes and close the property editor Customizing IDE shortcuts Keyboatd shortcuts offer an alternative method of performing operations for users who prefer the keyboard to the mouse They are particularly useful for frequently used commands where it is easier to use a combination of keystrokes than to lift fingers from the keyboard to choose the operation from a menu using the mouse Keyboatd shortcuts can be configured in the Configure Shortcuts dialog box where you can view a list of current keyboatd shortcuts either by the shortcuts assigned or by the list of all IDE actions to which keyboard shortcuts can be applied 219 Chapter 11 Configuring and customizing the IDE The Editor has its own set of shortcuts that can be configured separately See Changing assignments for Editor keyboard shortcuts on page 209 To add a keyboard shortcut 1 Select Tools Configure Shortcuts from the main menu 2 Inthe Configure Shortcuts dialog box that
231. o Property names and values on the property sheet e Meta names for example words like YourName which describe the type of text to be entered rather than the literal string are alicized Press ENTER means that you should press the Enter or Return key on your keyboard Keys like F5 and F9 refer to those function keys also sometimes labeled PF5 and PF9 CTRL refers to the Control key A set of keystrokes joined with like CTRL F9 means you should press the first key here CTRL hold it down and press the second key here F9 In listed source or command line code lines indented from the previous ones should be entered on the same line when typed into the Editor window or console For example the following should all be typed as one line C jdk1 2 2 jre bin java jar C Program Files Forte4J modules openfile jar port 2121 C My Development com mycom Foo java Look and feel of graphics The pictures of Forte for Java s graphical user interface GUT that appear in this document were taken using a Microsoft Windows NT machine and the Java look and feel The appearance of your GUI may differ from the pictures presented here depending on which operating system and look and feel you are using Contact Information For the latest news and information check the NetBeans web site at http www netbeans com 16 Chapter 1 Welcome to Forte for Java Community Edition Forte for Java Com
232. o includes non public property and event mechanisms which are not recognized as JavaBeans patterns in introspection This is because Bean Patterns can be used to set property and event mechanisms in standard classes which are not true JavaBeans components For a more thorough review of JavaBeans components and concepts such as introspection see http java sun com beans Creating properties To create a property in a class source 1 Find the class in the Explorer expand its node and right click on Bean Patterns Explorer Filesystems Pu x Q GF colorpicker E ColorPicker Q class ColorPicker f Fields Constructors M Methods B Bea FF ColorPick B ColorPrevie i ColorPreview e ColorPrevie Properties Indexed Prope imageviewer Unicast Event Source Q Ep ClassName Q class ClassName Q class InnerClass1 ff Fields Constructors 3 Filesystems Generate Beanlnfo Multicast Event Source In the contextual menu choose New Property The New Property Pattern dialog box will appear which will enable you to customize the code to be generated for the property Type in a name for the property The name must be a valid Java identifier In the Type combo box choose the type of property from the list or type in a class identifier In the Mode combo box choose whether to have the getter method READ ONLY setter method WR
233. ocated on your local drive select local Otherwise select server ot pserver to access the repository on a server b Move to the CVS Settings panel If your CVS Connection Type is server or pserver enter your server name in the Server field c Next to the Repository field click Browse to open up a file chooser In the file chooser navigate to the CVS repository you have created for your project This is where the versions of your files used by the version control system will be stored d If you have any sub directories in your CVS repository you can treat them as CVS 164 Chapter 9 Integrating a CVS version control system modules Enter the name of the module you want to work with If you want to work with the whole directory then leave the field blank e Click Browse navigate to directory you have set up as your working directory and then press OK Note If you are working on Windows 95 98 you have to use a Unix shell as an interpreter of CVS commands since the command shell used on Windows NT 2000 does not work properly on Windows 95 98 To use a Unix shell you have to install one first and then choose Use Unix Command Shell and enter the path to the interpreter The recommended Unix shell is sh exe or bash exe from Cygwin http sourcewate cygnus com cygwin 3 If the CVS repository has not yet been initialized right click on the CVS file system under the Filesystems tab in the Explorer and select CVS Init fr
234. oes not conflict with any other service running on your machine e Welcome files files to look for when there is a request to a directory The other properties including those displayed under the Expert tab are related to the Java process in which the server runs and are the same as those for External Execution An important property of the server is the root directory from which the JSPs HTML pages and other files are served This directory is always the root directory of the filesystem on which your JSP page resides 151 Chapter 7 Developing Java Server Pages Setting the web browser By default when you run a JSP the page is displayed in the IDE s built in web browser Howevet you can also set the IDE to display JSP pages in an external web browset To change the web browser used for JSP pages 1 2 5 Choose Tools Global Options from the main menu Select the JSP amp Servlets node and change the value of the Web browser property to External Select the External browser property and press the button that appears to open its custom property editor In the Process field of the custom property editor enter the path to the executable for the browser of your choice either manually or by pressing the adjoining button to use the file chooser Once the path is entered close the property editor by pressing OK You can also access the Executor property editor in the Project Settings window by sele
235. oject Settings from the main menu and in the Project Settings window proceed in one of the following ways a Right click on the node of the file system under the Filesystems Settings node and choose Move Up or Move Down from the contextual menu b Right click on the Filesystems Settings node and choose Change Order from the contextual menu Adding a file to the IDE The Forte for Java Open File feature provides the ability to open existing meaning not created in the IDE source files in the IDE straight from a file chooser without the need to first mount directories under the Filesystems tab in the Explorer or navigate to them in the Explorer To open a file in the IDE 1 Choose Open File from the first toolbar or the File menu in the Main Window A file chooser will appear asking you which file you wish to open 2 Browse to the directory on disk where your file is for example MyFirstClass java select it and choose Open If the file is already accessible in the Explorer then the file will open usually in the Editor window immediately 3 If the file is not already accessible in the Explorer you must decide which package to put the file in If you are trying to open a Java source file a dialog box will appear suggesting the package to use and enable you to press Accept or Select a If you press Accept the file will be opened and the proper directory will be mounted b If you press Select a dialog box will appear
236. om the contextual menu After the new object is created whatever happens when that type of object is double clicked in the Explorer will occur For example the Editor will open if the object supports editing Other templates These templates are all found under the Other category Bookmark Choosing this template automatically creates a bookmark with the URL http www netbeans com and opens up that web page in the default web browser To edit the URL in a bookmark 0 In the Explorer right click on the bookmark and choose Edit URL in the contextual menu A dialog box will appear prompting you to enter the new URL 200 Chapter 11 Configuring and customizing the IDE Group of Files A group of files object is a cluster of aliases for files somehow related to each other It is particularly useful if you want to simultaneously work on files located in separate parts of the IDE The template itself is empty Once you create an object from the template you can fill the object by pasting links from it to other files You can also save such a group as a new template To add a file to a group 1 In the Explorer select an object you would like to add to the group and choose Copy from the contextual menu 2 Right click on the group s node and choose Paste from the contextual menu HTML This template is for creating HTML files which can be viewed in the internal or an external web browser and which can be edit
237. om the contextual menu Right click again on the CVS file system s node and choose CVS Check Out from the contextual menu You can now create packages and files in the IDE and add them to your CVS project To add a package and its files to your CVS project 1 Right click on the root node of your CVS working directory and choose New Package from the contextual menu to create a new package Name the package cvspro ject Right click on the newly created cvspro ject node and choose New from Template Classes Class from the hierarchy of contextual menus Name the class and click Finish The class will appear with its file status Loca1 in brackets after its name on the node Repeat the previous step to create other classes Add the package and classes to the CVS repository by right clicking on the cvsproject package node and choosing CVS Import from the contextual menu CVS works best when imported files have been checked out from the repository so you should then do the following a Right click on the cvspro ject node and choose Delete from the contextual menu All of the files in cvsproject will be deleted from the working directory b Right click on cvspro ject and choose CVS Check Out from the contextual menu to put the files back in the working directory on the regular working branch c Right click on cvsproject and choose CVS Refresh Recursively from the contextual menu to display the checked out files and their st
238. omizer is a dialog box which can be used for advanced customization of the whole object at once This icon is context sensitive and is only available for certain objects Custom property editors A custom property editor is a dialog box brought up by pressing the button on a property value in a property sheet specially designed for editing the value of that property Custom property editors range from the simple for example editors for strings to complex for example for setting colors in the Editor All changes made in custom property editors are applied throughout the environment immediately for example changing the background color of the Editor window changes not only any new Editor windows you open but also any that are currently open All Property Editor dialog boxes contain these three buttons e The OOKbutton closes the dialog box and is shown only if the property is writable e The Cancel button reverts to the setting before the property editor was called e For properties that have default values the Default button sets the property to its default value For more information on the various property editors see Custom Property Editors on page 288 Form Editor The Form Editor enables you to design user interfaces visually You can select items such as panels scroll bars menus and buttons in the Component Palette and then place them directly on the Form Editor window As you do Forte for Java automatically
239. omponents you can choose from a list of methods that return the appropriate data type Code you define which will be included in the generated code To use the Form Connection property editor 1 With the Component Inspector open on a form select the property under the Properties tab that you would like to modify the initialization code for Press the button to bring up the custom property editor multi tab dialog box and select the Form Connection tab In the dialog box choose the type of code you would like to add Value Bean Property Method Call or User Code and then add the code in the field provided If you select Property or Method Call press the button to bring up a dialog box with a list of properties or methods available If you select Bean use the combo box to choose from the available beans Property Editor text String StringEditor Form Connection r Get Parameter From O Value Bean x amp Property No Property Selected ER C Method Cal lt No Method Selected C3 User Code Advanced 4 Once you have made your choice click OK 140 Chapter 6 Designing Visual Classes with the Form Editor Pre and post initialization code In the Form Connection property editor you can also write code to be placed before or after the initialization code for the modified property To place code before or after a property s in
240. omponents to a different COTULERTBeT sea ped ado pon ape asp a Be RR NR D s 116 Copying COMMON Stites ossia eum b ndr tuu Co tra tensa etie ed tae d tms ta pu EE 116 Reordering components within the same COBEQIIGT us uh c qe bir bh ope heap acts 117 Property Sheet pane in the Component Inspector esee 117 Custom property editors for component propetties e eid dioit aea 118 Reverting to the default value for a property auctae am M eue ditata Rete de duh qaas 119 Working with layout iii aas e ERI ERR IY EX IR ERACE SEE EDERE EEEE EESE KTE an iiaee 119 Setting and changing layout matagetisc ie ed eec da OH RIA ea Lon ERR EA RIA Re ere Er MN 120 Setting layout properties and constraints uso aeq eost qd dd eec Qa e NUR ees 120 Layoutptoperties oe eeeee ee ete ett tei idet ios deiode udi esie 121 Constraints pEODeftess nr eet p rd a cia n p cup eni rbi t emeret ries Hee 121 Standard layout MAT ADETS ice ntonicol dens tet em RIA chus telis abet bend aaa a 122 Border Layout a2 id5tannade noto no da apaga naue e aud d eG ed egeices 122 igni 122 Grid ayOUt dau re RAT A APR EE AREE ERR A RERUM E deg 123 Eei a Beno 123 GridBag Layoutim ini aa a te bra itt e one P o d do de ted iG rd 123 dvd M A 124 Absolutedayout Ace ere petente te e m tdt e duse ead di viii t 124 NulbE2ay0ut itecto nir n Si ii
241. on to use the Color Editor See Color Editor on page 288 186 Chapter 11 Configuring and customizing the IDE Print Settings These settings control the appearance of files printed from the Editor From the Print Settings node you can modify header footer line wrapping and line ascent correction properties for printouts of all Editor files On the property sheets for each of the three subnodes Java Editor Plain Editor and HTML Editor you can set line numbering and specify detailed background and foreground coloring for different types of text within the files Property Sheet Here you can set the appearance and behavior of property sheets See Property Sheet reference on page 277 System Settings On the System Settings property sheet you can choose whether or not to have the IDE prompt you to confirm deletions and choose whether to show tips on startup There are also settings for proxy port and proxy servet which you can set if you need to use a proxy setver for HTTP or FTP connections with the web browser and Update Center If you want to use a proxy you must also set the Use Proxy property to True See JSP and Servlets reference on page 272 Update Center The Update Center settings enable you to choose whether to be prompted when you start up the IDE and whether to check the Update Center for new and updated modules You can also set the frequency ranging from every startup to once per month that you
242. ond panel will be used in the search When you select one of the predefined search criteria that criterion will be appear in the second panel Doing simples searches To do a simple search of file systems 1 Select one of the tabs in the Customize Criteria dialog box based on whether you want to search by date of the file text in a file or text in the file s name 2 Ifyou select the Date tab type a number in the During last days field or enter a range of dates in the Between and and fields Date formats are determined by your locale For the American English en us locale dates are entered in the format MMM DD YYYY If you use an invalid date format your entry will appear in red If you select Full Text or Object Name enter a substring remember that the search engine is case sensitive or POSIX style regular expression 3 Press Search Searching specific nodes in Filesystems If you want to search only in a specific part of the hierarchy in Filesystems you can do so by selecting a node and selecting Edit Find from the main menu or using the CTRL f keyboard shortcut The Customize Criteria dialog box will appear After you enter the search critetia the search will be conducted recursively on all subnodes of the one selected Saving search criteria Once you have entered a set of search criteria in the Customize Criteria dialog box you can click Save as and then enter a name for the criterion in the dialog box to
243. onfigurations for each type of compiler type the actual system command that is called when you compile an object which includes the path to Java the working directory and any arguments In Forte for Java you can use the default compiler types of each category for example internal compilation and external compilation modify the default compiler types or write new ones You can then associate any of your classes to one of these compiler types if the default compiler type assigned for that class does not suit your needs You can also access the custom property editor for compiler types from the property sheet of individual classes See Switching compilers by class on page 52 and Adding and modifying service types on page 204 for more information Search Types Here it is possible to configure and create sets of reusable search criteria search types which you can later reference when you conduct searches of files in the mounted file systems You can also configure criteria from the Customize Criteria dialog box which appears when you select Tools Search Filesystems from the main menu Under the Search Types node are three category nodes Object Name Full Text 180 Chapter 11 Configuring and customizing the IDE and Date Under each of these nodes are nodes containing the actual search criteria You can modify the existing search criteria by modifying the properties on their property sheets See Searching f
244. oose Delete WorkspaceName from the contextual menu To add windows to the new workspace you can either Choose the workspace by clicking on its tab in the Main Window and then open up the windows that you want to be on that workspace from the Wndows menu or toolbar ot 0 Under the Workspaces tab in the Project Settings window copy windows from other wotkspace nodes and paste them to the new workspace Note Only the first option works if you want to add a window not already in a workspace to the new wotkspace You can also customize which workspace the IDE automatically switches to when you start execution or debugging or open a form To set the workspace the IDE switches to when you open a form object 1 Choose Tools Global Options from the main menu to open the Global Options window and select the Form Objects node 2 Click on the value of the Workspace property to access the drop down list of available workspaces and then choose a workspace You can also set this property to None if you do not want the workspace to change when you open a form object To set the workspace the IDE switches to for execution 1 Choose Tools Global Options from the main menu to open the Global Options window and select the Execution Settings node 2 Click on the value of the Workspace property to access the drop down list of available workspaces and then choose a workspace You can also set this property to None if you do not want the
245. open Output Wndow make the currently open Output Window the active window or open it if it is not already open Debugger Window make the currently open Debugger Window the active window or open it if it is not already open Execution Window make the currently open Execution Window the active window or open it if it is not already open Web Browser make the currently open web browser window the active window or open it if it is not already open e Component Inspector make the currently open Component Inspector window the active window or open it if it is not already open e Workspaces list of all available workspaces as a submenu with the current workspace indicated by selected the radio button Selecting one in the submenu switches the current workspace Project Menu e New Project close the current project and create a new one Open Project close the current project and open another existing project Save Project save the current IDE state including the project settings The files themselves are not saved Compile Project compile all of the sources currently listed under the Project tab in the Explorer Build Project force compilation of all classes currently listed under the Project tab in the Explorer whether current or not Set Main Class set the main class to be executed when executing the project as a whole 248 Appendi
246. opening the Global Options window and adjusting the Workspace property for Form Objects GUI Editing Workspace by default Execution Settings Running Workspace and Debugger Settings Debugging Workspace Using workspaces Being in a given workspace does not constrain what windows you can have open You can open fot example from the View menu or close any window without having to change the wotkspace Upon exiting the IDE the current state of each workspace is saved This information includes open windows and their sizes and positions When you next launch Forte for Java Community Edition your workspaces will appear exactly as you left them Any given window can be open on any workspace and can be open on more than one workspace simultaneously For example to view the Editor window on both the Editing and Running workspaces 1 While in the Editing workspace double click on a Java object displayed in the Explorer The Editor window will open with that source 2 Flip to the Running Workspace by clicking on the Running tab in the Main Window The first Editor window will no longer be visible and you will see either the default set of Running Workspace windows or those you left open when last using this workspace 3 Choose Window Windows Editing Editor from the main menu The Windows submenu reveals submenus for each workspace such as the Editing wotkspace Each workspace submenu shows a list of currently open windows
247. operty sheet and contextual menu which you can access just as you would for nodes under Filesystems For more information on mounting and browsing Javadoc directories in Forte for Java see Searching and browsing Javadoc on page 168 Project The fourth tab from the left in the Explorer has the name of the current project In its hierarchy are listed any files or directories that you have added to the project The files are added as shadows of files mounted under the Filesystems node meaning that any changes you make to the files from the Projects node will be reflected in in Filesystems For more information on how to work with projects see What is a project in Forte for Java on page 153 and Organizing work into projects on page 153 Guide to the Object Browser The Object Browser gives you a Java otiented perspective on your classes enabling you to 86 Chapter 4 The Explorer and Object Browser view a hierarchy of source files filtered in the way that you specify To open the Object Browser do one of the following operations Click on the Browsing workspace tab 0 Choose Open Browser from the File menu or toolbar The Object Browser window is divided into three panes Packages Objects and Members ai Object Browser Packages Objects BEES CCE Bao te maA D Forte4J_489 Development G examples G examples advanced G examples texteditor E tutorial Gi tu
248. or files in Filesystems on page 83 for more information on conducting searches The properties for the Search Types node are detailed in Search Types reference on page 260 Java Sources The Java Sources settings enable you to set the default compiler execution and debugger types set the source parser delay and set a strings table When you change the default for a service type compiler type executor or debugger type all classes or templates using the default of that service type ate affected Note Once you explicitly change a class or template s service type the IDE will never again recognize the class as using the default of that service type even if you switch that service type for the class back to the one that is the IDE default Therefore if you change a service type for a class and then change it back to the service type that is set as the default the class s service type will not be affected if you change the default service type The strings table is a list of substitution keys for templates When the key appears in a template marked by two underscores on each side of the substitution key in the template the string assigned to the key appears in place of the key in any objects created from that template For example the USER substitution key is assigned your user name If a template has the key USER placed anywhere in the text your user name will appear in place of __USER__ in any object created from this
249. orm Editor windows Individual frames from multi tab windows such as the Explorer Editor Debugger Window and Output Window can also be docked Frames from multi tab windows can also be docked into new unnamed single frame windows To dock an undocked window into a different window 1 Click on the window to be docked to activate it 2 Choose Dock Into from the Wndow menu on the Main Window and then one of the windows given in the submenu The undocked window will close and the object will open as a new tab in a multi tab window To dock a tab in a multi tab window into a different window 1 Choose Dock Into from either e the Window menu on the Main Window making sure that the undocked window is the active window or e the tab s contextual menu available by right clicking on the tab 2 Choose one of the window choices in the Dock Into submenu 192 Chapter 11 Configuring and customizing the IDE Cloning windows It is often useful to view separate sections of the same file simultaneously Forte for Java has a clone function to accomplish this You can clone the view of any Editor file the internal web browser and the JavaHelp browser for the User s Guide and context help To clone a window 1 Make sure the file to be viewed in the cloned window is on the active tab 2 Choose Clone Mew from either the Window menu of the Main Window ot the tab s contextual menu A new tab will open in the same mul
250. orner This is applied only when the Generate Position property is true and Form Size Policyissetto Generate Resize Code e Form Size Initial size of the form This is applied only when the Generate Siz property is true and Form Size Policy is setto Generate Resize Code Generate Center If True generates code that sets the position of the form to the center of screen regardless of the value of the Generate Position property Generate Position If True generates code that sets the position of the form to the coordinates given by the Form Position property or to the center of screen if 130 Chapter 6 Designing Visual Classes with the Form Editor Generate Center is set to True Generate Size Generates code that sets the size of form to the one given by the Form Size propetty Menu Bar Drop down list enabling you to choose which menu bar is to be set in the form External modifications Forms are stored in two files A java file which contains the partly generated Java source A form file which stores layout manager properties the properties and layout constraints of JavaBeans components on the form and other information This file does not need to be distributed with your application It is merely used to display the form in the Form Editor You can edit the java files using external editors not simultaneously while the form is being edited in the IDE with the following exc
251. ou use more than one compiler type in your work you can create a set of templates with the different compiler types that you use See Creating your own templates on page 201 and Modifying existing templates on page 202 for more information Running Java classes Java applications may be run in several ways To run a Java application 1 Make sure that the Java object is executable that it either has a main method or is a subclass of Applet or JApplet 2 Right click on it in the Explorer and choose Execute from the contextual menu Alternately you can select the Java object in the Editor window and then run it one of the following ways Choose the Execute icon on the Main Window Choose Build Execute from the Main Window e Use the keyboard shortcut CTRL F9 When executing the Java class is by default first compiled After compilation completes successfully the IDE switches to the Running Workspace though you may configure it to do otherwise by opening the Project Settings window selecting the Execution Settings node and changing the Workspace property You can return the IDE to the Editing or the GUI Editing workspace by clicking the tab for the workspace in the lower left part of the 52 Chapter 3 Developing Java Applications Main Window See Workspaces on page 188 and Customizing workspaces on page 222 fot mote information Execution View The Execution View ptovides a view of
252. ource file 37 Chapter 3 Developing Java Applications Execute executes the current source file Add Remove Breakpoint sets the current line as the breakpoint or removes the breakpoint if the line is already a breakpoint Add Watch opens the Add Watch dialog enabling you to set a watch for debugging Cut removes the selected text from the file and pastes it to the clipboard Copy copies the selected text to the clipboard e Paste pastes text from the clipboard to the insertion point in the file Delete deletes the selected text New Initializer inserts a new initializer at the insertion point New Field Constructor Method Inner Class Inner Interface opens up a Customizer dialog enabling you to create a new class or element Tools Auto Comment opens the Javadoc Auto Comment Tool which enables you to generate and modity Javadoc documentation for the classes in the source file e Tools Set As Project Main Class sets the current file as the project s main class e Tools Add to Project adds the current source file to the current project e Tools Create Group creates a group object and adds the current source file to the group e Tools Add To Component Palette adds the source file preferably a JavaBeans component to the Component Palette from where you can use it in other applications e Customize open
253. p Workspaces bp Execution Types y Debugger Types Q s Compiler Types Q wa External Compilation iow External Compilation External Compiler EPR ux FastJavac Compilation External Compiler java home K bin He we External Compilation 2 Identifying Name External Compilation 2 Search Types Java Sources amp Object Browser Project Options 5 Select the newly added node and on its property sheet modify the Identifying Name property to give the new service type a distinct name something that you will recognize when using the drop down list to choose a service type for an individual class Note When you create a new service type using the New service type Service command the service type is created with basic settings If you would like to create a new service type based on the settings of an existing service type you can select the service type s node in the Project 205 Chapter 11 Configuring and customizing the IDE Settings window choose Copy from its contextual menu select the category node and then choose Paste from its contextual menu Configuring service types After you have added a new service type you can then configure it You can also configure already existing service types To configure a service type 1 Choose Project Settings from the main menu 2 In the Project Settings window select the service type s node under the service type categoty under Compil
254. perty sheet gives you broad control over the behavior of the Editor and appearance of files displayed in the Editor window You can set key bindings make abbreviation lists use the Color Editor to customize foreground and background colors for different types of text choose caret insertion point type and so on Under the Editor Options node ate four subnodes representing types of files that can be edited in the Editor HTML Editor JSP Editor Plain Editor and Java Editor These subnodes each have separate property sheets enabling you to make distinct customizations for each type of editor For a description of all of these settings see Editor Settings reference on page 265 Execution Settings The Execution Settings property sheet gives you the option of clearing the Output Window when executing having separate Output Window tabs for each execution run and automatically compiling sources before execution You can also choose the workspace used when running applications Form Objects The Form Objects settings affect the appearance of the Form Editor window duting design time code generation settings and so on See Form Objects reference on page 269 185 Chapter 11 Configuring and customizing the IDE HTML Browser The HTML Browser settings enable you to set the default background color and the default fixed and proportional fonts used by the internal web browser when displaying pages See HTML Browser refer
255. placing Save Project Settings Display the Project Settings window This com mand is available only when the Projects module is disabled or uninstalled Tools Show the Tools submenu menu only action View View an object for example by launching the HTML browser View Servlet View the servlet code generated from the JSP Table 69 Tools Actions Action Description Auto Comment Open the Auto Comment dialog box to add and edit Javadoc comments for a class Create Group Create a group object Global Options Open the Global Options window JSP Wizard Run the JSP wizatd to create a new Java Server Page Search Filesystems Conduct a search of mounted file systems by date text in file name or text in file Synchronize Force synchronization of the selected source file with the interfaces it implements Update Parser Database Update the Java parser database with the classes of the selected package thus making those classes available in addition to the standard Java 2 Plat form SDK classes when using the Java code com pletion feature in the Editor 285 Appendix E Actions Table 70 View Actions Action Description CloseView Close the active window Customize Bring up a JavaBeans component s customizer Editor Window Open a new instance of the Editor Window Execution Window Open a new instance of the E
256. plain text and substitution codes 272 Appendix D Reference Guide to Project Settings and Global Options Table 54 Substitution Codes for the Java Elements properties Substitution Type of substituted text Code m Element s modifiers for all elements except initializers n Element s name for all elements except initializers C Name of class with all outerclasses for classes and inter faces only i Full name of element with package for all elements except initializers t Type for fields only r Return type for methods and constructors s Superclass for classes only c Static for initializers only p Parameters with types but not variable names for construc tors and methods a Parameters with types and names for constructors and methods i Interfaces implemented or extended for classes and inter faces only e Exceptions for constructors and methods only lt initializer gt Initializer Advanced substitution formats You can also use advanced substitution formats with these substitution codes to create a more informative display name for the elements in the Explorer and Object Browser For simple arguments arguments that do not contain lists of items you can create a code in the format SubstitutionCode prefix suffix where prefix represents a string to appear before the element name and suf
257. plays compilation output and standard error The output is color coded errors are marked red other text is blue Double clicking an error line on this tab brings forward the Editor window displaying the soutce highlights the incorrect line in red and positions the insertion point at the exact location of the compilation error You can also jump to different compiler errors in the editor with keyboard shortcuts Pressing Alt F7 moves the insertion point to the previous error and pressing Alt F8 moves the insertion point to the next error in the file The Debugger tab is split vertically into two panes The left pane displays the output of the application being debugged The right pane displays useful debugging information such as details of the application s threads thread groups and breakpoints as well as status messages from the debugger itself Any application currently being executed also has a separate tab in the Output Window Its tab displays the standard output of the application The standard input of the application assuming the application tries to read anything is also redirected here more specifically to the text field at the bottom of the window There are two properties which govern the use and re use of application tabs Reuse Output Window Tab andClear Output Window Tab These properties can be found on the property sheet of Execution Settings in the Global Options window which can be opened by choosing Tools Global Opt
258. ponent Inspector jText Mel E3 MyNewClass UDialog EJ Non visual Components E GridBagLayout jTextField1 JTextField jButton1 JButton jButton2 JButton jPanel JPanel Code Generation Generate Code Custom Creation Code IEEE A Post Creation Code Post Init Code Pre Creation Code Sa Pre Init Code p Use Default Modifiers True E Code Generation In the Custom Creation Code property you can enter your own creation code for the component not including the variable name and equal sign If this property is left blank the IDE generates default creation code for the component You can change the variable name by modifying the Variable Name property You can also add code before and after a component s creation code and before and after its initialization code using the Pre Creation Code Post Creation Code Pre Init Code and Post Init Code properties Note The IDE always places creation code before initialization code in initComponents For information on adding pre and post initialization code for a component s property see Using the Form Connection property editor on page 139 Tip You can also perform additional initializations of a form s components in the constructor 129 Chapter 6 Designing Visual Classes with the Form Editor after the call to initComponents For example here you might initialize a button group or set component labels from resource bu
259. properties for each of these elements 92 Chapter 4 The Explorer and Object Browser Table 5 Java Object Elements Icon Elements Properties Class Inner class Name modifiers extended class imple mented interfaces Interface Inner inter Name modifiers extended interfaces face Cue Constructor Name modifiers arguments exceptions e Method non static Like constructor plus return type Q Method static Like constructor plus return type a Variable non static Name modifiers type initial value e Variable static Name modifiers type initial value g Initializer non static e Initializer static a Member accessibility The elements listed above can have several kinds of accessibility The icons of the elements consist of icons in the previous table and their accessibility flag s Chapter 4 The Explorer and Object Browser Table 6 Icons for accessibility Icon Access private E package private default E protected V public Creating and modifying elements using the customizer You can create elements for classes from the class s contextual menu in the Object Browser or Explorer Creating elements To create a new element 1 In the Explorer or Object Browser select the class or interface in which you want to create the element 2 Choose New from the contextual menu 3 In the expan
260. property sheets 183 Chapter 11 Configuring and customizing the IDE Object Types Under this node you can change the order of the object types and customize their properties Each object type recognizes specific types of files usually by their extension and groups them with similar files This affects where new objects that can fall under multiple object types are placed in the IDE and ultimately how they are handled since they are automatically dropped into the first category that they match with when they are used by the IDE Important In some cases the order is crucial for example form objects must come before Java source objects which must come before sourceless class objects Only experts should modify these settings The items that appear on contextual menus for nodes in various IDE windows are determined by the object type You can determine which contextual menu items appear in the contextual menu for each type of object See Changing commands in contextual menus on page 219 For some object types such as text image HTML and class objects you can set the extensions that the loader recognizes under File Extensions on the object type s property sheet Startup Under this node you can insert classes that the IDE will run at startup Internal execution is usually required for startup classes Component Palette In the Component Palette section of the Global Options window you can add remove move change
261. r ir Pr E ee eH DELATI NH VUL Ue eR 125 Usine the Crd Bae casto eb autc duto d diede oe a beu ui e Co ai 125 Support for custom layout MANAgETS ec Tenue ou etse vun oti nbus Qa evitare tpi ete epe uid 127 Working with SOMECE COdE uenti E Ua a AD eE MEHR ANN NEN S ER M SR NSRN esis DINEM EN 128 a UaEded Xextoiuouu cmm decuit Oe euet cust en apa Pu tiu tt met Un acters ce 128 Modifying generated code for ompOoketits d cipe cei be terae bet Pet Pepe d ttg 128 Contents Other codegenerator Opuons coaster eau ta EU a Vr OR Festo olo Ou ERI UR TRO 130 Code Generation properties TOt Containers oie receta de dI e CO EAE RO ELA EFE 130 External modifications sensensa patei ode qs ae e cara Urb kd eee terum uera idis 131 Fotm Editor roues evasit AUR OVWESES REA Ee IEEE SE E Q I EU NETS UELA ME OCULI Ter T Ui sae 131 lcu rl 133 TS ree ete ated Ler essere edt vtae is endete at QUA rta Itl Rr Dc eL ep 1359 Removing event handlers zonae tace rdc i eve ete ebrei velata ed aee vo Een deleti obe Peres 134 R namine event handlers coe ui e nei Ote electi fora aso LAS petivit ys 134 Adding multiple handlers for one SVebonaiefiostbubaletieobut utet atn deo Ele e Palio 135 Using the Connection Wizatd i icciacissiccsrsisenivensicvssercvansaanatcacaseaicasieeaisussoensendsoundcacaneadendsal 135 Using the Form Connection property editor essen 139 Pies anid postemitializadort code ance eda ater igo
262. r selected lines 240 Appendix B Default Editor Abbreviations Editor abbreviations can be defined by opening the Global Options window expanding the Editor Settings node selecting the subnode for the type of Editor selecting the Abbreviations property and opening its custom property editor You can add delete and change abbreviations The following tables list the default Java Editor abbreviations and JSP Editor abbreviations Table 26 Java Editor abbreviations a Expands To En Enumeration Ex Exception Gr Graphics Ob Object Appendix B Default Editor Abbreviations e Expands To Psf public static final Psfb public static final boolean Psfi public static final int Psfs public static final String Re Rectangle St String Ve Vector ab abstract bo boolean br break ca catch cl class cn continue de default ex extends fa false fi final fl float fy finally le interface im implements impS import com sun java swing impa import java awt impb import java beans impd import com netbeans developer impj import java impq import javax sql 242 Appendix B Default Editor Abbreviations e Expands To imps import javax swing impx import com netbeans developerx
263. rd navigation and text selection shortcuts senes 4 TText scrollng shortcuts eee eee eee prep p pred e d ad ad eig 42 Navigating tiles withthe Jump list eie eerte ieteidetectiutasdetee icti 42 Iersnrasdirdueisuciicm P 43 Pind and vreplaeesosgusiti pede eU dte dota iq ton eit ei od OS S detiene Ceu 43 Tiva code CORN OOTY s uoc esed eti ops A qp rk to robs ot dut setitep unt Uer te elu ec 44 Adding your own classes to the parser database 4 2 rtt piti ed ederet 45 Other Java SoTEe Esso ee oi wet fadi teretes doctas loretes ie nated iis A aA 46 WO reat MN E 47 iler Editino SBOTIGULS qua quietas ssanta alere Gt e aU TD A I PENA EDU PESCE 48 Wotking Sa EUS UIC SS obi or RI red f ic ite nd ubt qo REAUT Re MH d Ru pte 48 Formatting COCO MNT RT UN 49 Editor e DM asus cenae egets dian Genus Des unes atate tom dp A un cre UU DUE 49 Compiling Jay4 SOUFI CES ois p savas n seesi eenen nnen Ea PEN ERN SEL EATRN EU NAR RU UI ERR IA IRI ias 49 Copmipilinosinole clas Ses o OI RC ORAN o aO IU EV 50 compiling pae d Seed OL Que ab Qo Qu PU SUL eO NA QD AN SAC dr Oden f 50 TESTA tC LS Bleed qe vo eek Nee PRU PERPE IS ERU EVER a a RERO RA TRUE 51 Puilcain compllet Sup POLE ain recuso ta Or o n UR epa Ca EU cu es pcm d c p cp SERERE 51 Switching the default compiler tyBE ea sertetet quesito ford teda Pte ege Pub dba oper td sede 51 DwILCHInP compilers Dy Clas eau aci adn a bap tut db anaa a TU a CUR eru bui 52 Disabling compil
264. read i a mene di i HR re RU iani ai iini 67 Connecting the Debugger to a running process ooa do eaa epe id FU ge ced 67 Gebiine The debug et oo bash tot Ab iea i A ttem undi aves Slashers Gates ha 68 Switching the default debugger type T acabe uro Shades toa qua b qe i du eph HE 69 Configuring deb ggefs uae piii plu erii oa ie EA ORDRE fe eb E bra ida de Ea Een dea 69 Setting debugger types mi templates Sensus e mennu nen iirchonid enbeta ufi bed S 70 Hane the Output Window oiraisesienmiiuri ws ERU IRURE EH UR UMS WWURNTONIS NUR ERR TI MUS wae 70 Internal web DEOWSGE aoi uno or FAROS E EPA SEN NAUIUR PRENNE TUM NN ERATIS PULSA E LETHPAS LC NES 71 Chapter 4 The Explorer and Object Browser cccssssssssceesssseeeesessessseseeees 73 Guide tole Explorer vicerat Was e vede be eec denen vl es 74 Igitur I MMC 75 File systems and the class path ssssssssseeeeeeeneetettte tenente tenete tenentes 75 Mounting file Systems i osececeneneneote emere eere b in ud cd e dre 75 Order of file Systems RR EORR EROR E tte a TI Adding fileto the d DB ao cte rae rne ee eH e HRS HER D n Rn e negem ives 77 Morkinosvithipackages ue eed ed dugadedanguditad de Ae Reeds ene aR 78 Working with objects uode ceo te eie eee depart EEROR 80 Searchinp for files in P ilesystetms as sos sacageuedaaseqendasetn tenores tur ne een Nee sl 83 hus ME 85 Processes node s caanenaeosodonop in and gan quod qaa qnae a o DI He miS 86 Debugger ode
265. rectory to start the process in If the value is null the IDE s own working directory is used Table 33 Applet Execution service properties Property Description External viewer Path to Java launcher You can use the custom property edi tot to define the process and arguments using a set of sub stitution codes Identifying Name The name for the applet execution type by which classes reference it 258 Appendix D Reference Guide to Project Settings and Global Options Table 34 JSP Execution service properties Property Description Allow unregistered servlets When False links to servlets in the form URL serv let package ClassName ate disallowed External Process Path to Java launcher You can use the custom property edi tot to define the process and arguments using a set of sub stitution codes Identifying Name The name for the applet execution type by which classes reference it MIME types Specifies mapping of file extensions to MIME types Port Port on which the server runs Welcome files Files to look for when there is a request to a directory Boot Class Path Boot class path of Java including installed extensions Class Path The class path used by the IDE that is transferred to the external process Environment Varti ables A list of environment variables in the form Name Value If the value is nu11 the IDE
266. rent file but also in all other opened files in the order that they 45 Chapter 3 Developing Java Applications were last used Other Editing shortcuts A wide range of keyboard shortcuts are available in Forte for Java to speed the editing process including e CTRL c or CTRL INSERT copy e CTRL x or SHIFT DELETE cut e CTRL v or SHIFT INSERT paste e CTRL w delete previous word e CTRL e delete current line e ALT j select the current word the word that the insertion point is on immediately before or immediately after or deselect anything currently selected e ALT u then u make the selection or the character after the insertion point uppercase ALT u then 1 make the selection or the character after the insertion point lowercase ALT u then r reverse the case of the selected text or the character after the insertion point e ALT u then f reverse the case of the first character of the identifier the insertion point is on For a complete list of shortcuts installed with Forte for Java see Editor Shortcuts on page 233 See Changing assignments for Editor keyboard shortcuts on page 209 for information on setting your own key combinations for shortcuts Working with braces In the Editor window whenever the insertion point is immediately after a brace bracket or parenthesis either opening or closing the matching brace bracket parenthesis is highlighted When
267. rms It consists of several tabs each housing standard components and layouts Workspaces Forte for Java uses the concept of workspaces to manage windows and tools On the lower left corner of the Main Window ate five workspace tabs Editing GUI Editing Browsing unless the Object Browser is not installed Running and Debugging unless there is no Debugger installed Each workspace contains a set of opened windows appropriate to specific stages of the development cycle Clicking on each of these tabs flips between each workspace By default the IDE automatically switches to the GUI Editing Workspace when you open up a visual form to the Running Workspace when you execute an application and to the Debugging Workspace when you initiate a debugging session For more information on managing workspaces see Workspaces on page 188 22 Chapter 2 IDE Essentials Contextual menus Many of the commands available in Forte for Java are available through contextual menus The Explorer The Explorer in Forte for Java Community Edition gives a unified view of all objects and files and provides a starting point for many programming functions Here you can work with objects organize your work modify object properties and connect various data sources d Explorer Filesystems L OL x 3 Filesystems Q G9 D Forte4JrciDevelopment Q examples Q advanced Eb MemoryView jy class Memory View E Memory ViewLocale
268. rs into a full word or a phrase Defining abbreviations is especially useful for long and frequently used Java keywords For example if you type pu and press SPACE the text will be expanded to public To enter characters without expansion type SHIFT SPACE this enters a space without checking for abbreviations See Default Editor Abbreviations on page 241 for a complete list See Customizing Editor abbreviations on page 211 for information on changing abbreviations and setting your own File navigation features Forte for Java has many features that make it easier to navigate files and select text using only the keyboard Standard navigation and text selection shortcuts When typing in the Editor you have access to a wide variety of commonly used shortcuts to help you navigate and select specific blocks of text in your files These include e SHIFT RIGHT select the character to the right of the insertion point SHIFT LEFT select the character to the left of the insertion point e CTRL RIGHT move the insertion point one word to the right e CTRL LEFT move the insertion point one word to the left e CTRL SHIFT RIGHT select the word to the right of the insertion point e CTRL SHIFT LEFT select the word to the left of the insertion point e SHIFT PgDown select the page long block of text beginning with the insertion point e SHIFT PgUP select the page long block of text ending with the insertion point 3
269. rties of components in yout applications and for adjusting various settings and options in the IDE Color Editor The Color Editor contains several tabs each of which represents a different way to select a colot Table 72 Panes in the Color Editor Tab Description Swatches Contains the Swing spectrum of colors and an additional color chart of the most recently selected colors Click on a color in the chart to select it The Preview panel demonstrates how your color selection looks as either foreground or background color Click OK to apply the color Appendix F Custom Property Editors Tab Description HSB Displays a color square that enables you to change the hue satu ration and brightness to create your own shade of color Click on the H S or B radio button then drag the circle in the square to adjust that color aspect As you drag the circle the current values for hue saturation brightness are displayed as well as the values for red green and blue amounts RGB Provides slider controls that you use to set the individual values for red green and blue You can also enter values for each in the text fields provided You can check your color setting in the Pre view panel Click OK to apply the color AWT palette Contains a scrolling list of standard AWT colors Click on a color to select it then click OK to apply the color Swing palette Contains a scrolling list of preset defaul
270. s Adding your own classes to the parser database The parser database can be found in the System ParserDB folder in your installation directory It consists of files with jcb and jcs extensions which are used whenever files are parsed in the IDE 43 Chapter 3 Developing Java Applications By default the parser database contains files for the Java 2 SDK v 1 3 You can update the parser database so that your own classes are among the choices offered when using code completion and other special Java shortcuts in the Editor To update the parser database 1 In the Explorer or Object Browser right click the package or file system containing the classes you want to add to the database and choose Tools Update Parser Database from the contextual menu If you are updating the parser database for a package or file system that has already been entered into the database the parser database will then be updated with any changes made to the classes If you are expanding the parser database with a package ot file system that has not yet been entered in the parser database the Java Completion Database Configuration dialog box will appear Type a file name with no extension in the Parser Database File Prefix field This will be used to create the jcb and jcs files amp Java Completion Database Configuration of netbeans user Develo Ea Parser Database File Prefix ba prefix Storage Levels Ls Classe
271. s tems or if the Editor window is active open the Find dia log box to search for text in the Editor CTRL n Create New Object CTRL 0 Open Explorer or activate currently open Explorer window CIRL s Save CTRL SHIFT s Save All unsaved documents DELETE Delete selected node Window Shortcuts The following are shortcuts for opening or activating specific windows and other window related functions Table 13 Window shortcuts Press To ALT 0 Explore From Here ALT 1 Open the selected object s property sheet in a sepa rate window ALT 2 Open activate the Explorer window same as CTRL o ALT 3 Open activate the Editor window works only if a text or source file is already open ALT 4 Open activate the Output Window ALT 5 Open Debugger Window ALT 6 Open activate the Execution View 230 Appendix A Default Keyboard Shortcuts Press To ALT 7 Open activate the Web Browser ALT 8 Open activate the Component Inspector CTRL F4 Close the active window or tab in multi tab win dow CTRL ALT LEFT Switch to previous workspace CTRL ALT RIGHT Switch to next workspace ALT LEFT Switch to previous tab in multi tab window ALT RIGHT Switch to next tab in multi tab window CTRL u Undock window undocks currently activated tab in multi tab window into a single window CTRL p Print the file selected
272. s you can select several nodes at once and set the properties for all of them 105 Chapter 5 Developing and Customizing JavaBeans Components Editing Beanlnfo source After you have generated BeanInfo from the Generate Bean Info dialog box you can manually edit the BeanInfo in the Editor window except for the blue guarded blocks Regenerating BeanInfo You can regenerate BeanInfo for classes that already have BeanInfo If there is already a BeanInfo class for a bean any changes you make in the Generate Bean Info dialog box or in the BeanInfo source code will be saved Customizing JavaBeans components When writing in Java it may be useful for you to take existing beans and alter them to better suit your purpose The Customize Bean command enables you to create an instance of a JavaBean customize its properties and save it as a serialized prototype This may be done on a Java class or on an already serialized prototype ser file The class must be public and have a public default constructor and it must also be serializable to make a serialized prototype from the customized settings To customize a JavaBeans component 1 Right click on the bean in the Explorer and choose Customize Bean from the contextual menu The property sheet for the JavaBeans component will open up If the bean is a visual component meaning that it extends java awt Component the component its
273. s Fields Methods O Public O Public C Public amp Protected and public amp Protected and public Protected and public All except private C All except private C3 All except private CO AI C AI C AI In the Storage Levels panel of the same dialog box select what level of code for classes fields and methods that you want included in the database file By default the Protected and public level is selected for all three categories Click OK to add the files to the parser database Other Java shortcuts Besides Java code completion there are few other shortcuts that are available only for Java files Chapter 3 Developing Java Applications e ALT o open the source file that the insertion point is on or immediately before or after For this command to work the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source See Adding your own classes to the parser database above ALT u then g prefix the current identifier with get ALT u then s prefix the current identifier with set e ALT g go to the variable declaration for the identifier that the insertion point is on or immediately before or after As with Alto the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source for this shortcut to wotk CTRL SHIFT t comment out the selected lines CTRL SHIFT d remove
274. s To Project Add a new class to the current project Add Existing Class To Project Add an existing class to the current project Add To Project Add the selected class to the current project Build Project Force compilation of all objects in the current project Compile Project Compile all objects in the project whether cur rent or not Debug Project Start the Debugger on the main class of the project Execute Project Execute the main class of the project Import Project Import a project into the IDE New Project Create a new project Open Project Open an existing project Save Project Save the project settings and current IDE state into the current project file Set As Project Main Class Designate the selected class as the class to be exe cuted when the Execute Project action is called Set Main Class Designate the class to be executed when the Exe cute Project action is called Settings Open the Project Settings window Table 68 System Actions Action Description Add Directory Mount a new file system under Filesystems Add JAR Archive Mount a JAR archive under Filesystems 283 Appendix E Actions Action Description Configure Shortcuts Configure general IDE keyboard shortcuts CustomizeBean Customize properties of a JavaBeans component Edit For a file that has a visual an
275. s at the top and bottom of each page of output No Index If True omits the HELP link in the navigation bars at the top and bottom of each page of output No Navbar If True prevents the generation of the navigation bar header and footer otherwise found at the top and bottom of the generated pages No Tree If True omits the class interface hierarchy from the gen erated docs The hierarchy is produced by default Split Index If True splits the index file into multiple files alphabeti cally one file per letter plus a file for any index entries that start with non alphabetical characters Stylesheetfile Path to an alternate HTML style sheet file Without this option Javadoc automatically creates a style sheet file stylesheet css that is hard coded in Javadoc Use If True includes one Use page for each documented class and package The page describes what packages classes methods constructors and fields use any API of the given class or package Version If True includes the version text in the generated docs Window Title The title to be placed in the HTML title tag Editor Settings reference There are both global Editor settings and settings for each individual type of editor Global Editor settings This setting applies to editing of all types of files for example Java HTML plain text and JSP in the Editor 265 Appendix D Reference Gu
276. s components as well as making them available in the IDE for development Designing Visual Classes with the Form Editor on page 111 focuses on all aspects of visual development in the IDE Developing Java Server Pages on page 148 shows how you with the help of templates and a wizard can quickly create Java Servlet Pages JSPs with the IDE Organizing work into projects on page 153 details Forte for Java s project functionality and how you can save different IDE configurations for each project Integrating a CVS version control system on page 162 provides information on how you Can institute a version control system for applications you and others develop with the IDE Configuring and customizing the IDE on page 177 provides a more thorough explanation of the parts and features of the Forte for Java IDE and shows how you can customize it to best suit the way you work The appendices provide reference information such as lists of keyboard shortcuts and Editor abbreviations as well as brief descriptions of menu and toolbar items properties of Project Settings and Global Options items and all available IDE actions Conventions Used In This Document The following conventions are used in the text This font is used to denote items you can select in the GUI such as buttons and menu choices This monospaced font is used to denote 15 Examples of Java code File names Explorer nodes ooo
277. s default settings are used Filesystems Path Read only value showing the current class path from File systems Library Path List of modules and special libraries the IDE uses Working Directory A working directory to start the process in If the value is null the IDE s own working directory is used 259 Appendix D Reference Guide to Project Settings and Global Options Debugger Types reference Table 35 Applet Debugging and Default Debugging properties Property Description Classic Switch Set to True if HotSpot is installed External Process Path to the debugger You can use the custom property edi tot to define the process and arguments using a set of sub stitution codes Identifying Name The name for the debugger type by which classes reference it Boot Class Path Boot class path of Java including installed extensions Class Path The class path used by the IDE that is transferred to the external process Library Path List of modules and special libraries the IDE uses Filesystems Path Read only value showing the current class path from File systems Search Types reference Table 36 Search Types properties Property Description Identifying Name The name for the search criterion by which you can access it in the Customize Criteria dialog box Regular Expression A POSIX style regular expression which can
278. s for each toolbar item by holding the mouse over the icon to bring up its tool tip 252 Appendix C Main Window Menus and Toolbars label 253 Appendix D Reference Guide to Project Settings and Global Options Filesystems Settings reference The following settings are available for each file system under the Filesystems Settings node the last four appear under the Capabilities tab Appendix D Reference Guide to Project Settings and Global Options Table 28 File System properties Property Description Extensions of Extensions of files that should be backed up during modifi Backup Files cations This option is only available when the file system is mounted using Add Directory from the Tools menu or the context menu for the Filesystems node in the Explorer Backup files will be named with a tilde Archive File for The mounted JAR or ZIP archive You can use the custom archive files only property editor to change which JAR is mounted Hidden If True the file system is not displayed under the Filesys tems tab in the Explorer Read Only If True you may not modify any files in the file system Root Directory for The root directory of the mounted file system should be directory based file the top of the package hierarchy You can use the custom systems only property editor to change which file system is mounted Valid If True the file system is valid and usable Use i
279. s key store so all modules from Sun that arrive uncorrupted are trusted If the module originates from another source it will either have a different certificate or no certificate at all If a module is not trusted you can choose Trust For Module to install that module only Trust For Now to install all modules with that certificate in the current download or Trust Forever to enter the certificate into the IDE s key store so that all current and future modules with that certificate will be automatically trusted If you reject a certificate the module will not be installed Likewise you can choose Reject For Now to reject all modules with that certificate in the current download or Reject Forever to remove the certificate from the IDE s key store After rejecting a certificate you can later accept it Updating modules manually If you are unable to configure your IDE to use the Update Center with your firewall or proxy you can download a ZIP archive containing the available modules from the Forte for Java web site and update the IDE from the extracted files To update the IDE from files downloaded manually 198 Chapter 11 Configuring and customizing the IDE 1 Download the most recent ZIP archive from the Forte For Java web site containing the modules 2 Extract the files from the downloaded archive to a folder on your system 3 Choose Help Update Center from the main menu to bring up the Update Center wizard
280. s long as Forte for Java is running The Main Window can be viewed as the control center of the IDE Most important operations and commands ate accessible from this window The Main Window can be broken into four separate groups of controls the menus the toolbars the workspace tabs and the status line EY Forte for Java Community Edition v 1 0 Build 488 File Edit view Project Build Debug Tools Window Help teen eee ie x me o SIO Mee 1 5 1 e Tr e Editing GUI Editing Browsing Running Debugging fg AWT Swing Swing Other Beans Layouts Borders is Al s 8 re Eg e eim Eu End wn B s Ce Menus and toolbars A listing of all menu items and toolbar operations is given in Main Window Menus and Toolbars on page 246 and specific operations are mentioned in pertinent sections Menu items and toolbar tools are context sensitive they may be dimmed depending on which window is currently active or which object is selected Menu entries and toolbars can be re ordered and customized Keyboard shortcuts are shown in their corresponding menu items See Customizing menus and toolbars on page 215 for more information Component Palette The Component Palette shown in the right half of the figure above is a special toolbar used in conjunction with the Form Editor to visually build fo
281. s made and when a new bug surfaces finding out what change caused it Forte for Java helps you meet these challenges by making it possible to use the popular and free Concurrent Versions System CVS version control software from within the IDE Using CVS also can be useful for you to keep a history of revisions you make to your applications as they ate in development Chapter 9 Integrating a CVS version control system How the CVS support works Forte for Java s CVS suppott is effectively an object wrapper which integrates CVS into the Forte for Java environment Files accessed through it have all the properties of files on the local file system access dates attributes and so on along with two additional properties file state and locker status The file state appears next to the file s name on its Explorer node The locker status can be viewed in the output generated when you choose the Log command For each action performed on your files your version control system is called and the information it returns on the command line is processed by the module Note Every operation is called in an asynchronous manner so that you can do your work and do not have to wait for commands to complete Therefore the file state and locker status of a file will not necessarily be visible until the CVS module needs this information for example when an attempt is made to modify a file and requests it from your version control system Many of
282. s qui en restreignent l utilisation la copie la distribution et la d compilation Aucune partie de ce produit ou document ne peut tre reproduite sous aucune forme par quelque moyen que ce soit sans l autorisation pr alable et crite de Sun et de ses bailleurs de licence s il y en a Le logiciel d tenu par des tiers et qui comprend la technologie relative aux polices de caract res est prot g par un copyright et licenci par des fournisseurs de Sun Sun Sun Microsystems le logo Sun Java JavaBeans Forte et NetBeans sont des marques de fabrique ou des marques d pos es de Sun Microsystems Inc aux Etats Unis et dans d autres pays LA DOCUMENTATION EST FOURNIE EN L ETAT ET TOUTES AUTRES CONDITIONS D CLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES DANS LA MESURE AUTORIS E PAR LA LOI APPLICABLE Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALIT MARCHANDE A L APTITUDE A UNE UTILISATION PARTICULERE OU A L ABSENCE DE CONTREFACON Contents Contents Prefdce cn i d ca fe cious ded ada vitae d I e e c tosta teda EIE 14 Before yourread this book ec rop pn UR PT aor r EENE eae Rae 14 How this book is OtoAatnlzedu occorre en eh nu REX E PEXN sagas VUE AERE YR AES aEENVE UR VES 14 Conventions Used In This Document ii cccicscccscsccaissededecseccsdescsedscascseedsoscsadscesboccdesesecsset 15 Look 4nd Leek aia Sanin tdm qup UD QUU dee QU gelb p D S EP o Dis 16 Contact Informations c
283. s up the Customizer dialog box for the class or element that the insertion point is on If the insertion point is not on an identifier that can be customized the Customizer appears for the main class Properties opens a separate Properties window displaying the the property sheet for the source file or the class or class element that the insertion point is on Mouse and clipboard functions The Editor uses standard mouse functions click and drag the left mouse button to select a block of text double click the left button within a word to select that word and triple click to select an entire line You can also select a block of text by clicking to place the insertion point where the block should begin holding down SHIFT and then clicking to determine the end of the selection 38 Chapter 3 Developing Java Applications You can select text and move it to and from the clipboard using the Cut Copy Paste and Delete commands which are available in the Edit menu on the Edit toolbar and in the contextual menu accessed by right clicking on the selected text You can use Undo to reverse the previous command and Redo to reverse the reversal These commands are available in the Edit menu on the Edit toolbar in various contextual menus and by using keyboard shortcuts Editor abbreviations To simplify editing of files a set of customizable abbreviations is built into the Editor which can be used to expand a few pre defined characte
284. save it for use in later seatches Search criteria are saved by search category 84 Chapter 4 The Explorer and Object Browser Using saved search criteria To search with a criterion that you have already defined select the criterion in the combo box in the panel labeled Predefined and then press Search You can also recall saved criteria and modify them By pressing Restore the newly entered criteria are changed back to their saved values Searching with combinations of search criteria You can search for files using a combination of the three types of search criteria To do so enter a seatch criterion under one of the three tabs and then switch to another tab and enter criteria Note The predefined search criteria are stored by category For example predefined criteria created under the Date tab can not hold any Object Name criteria Predefining and modifying search criteria in the Project Settings window Search criteria can be created and modified under the Search Types node in the Project Settings window To predefine search criteria 1 Open the Project Settings window by choosing Project Settings from the main menu 2 Expand the Search Types node and select the category you want to add a predefined criterion to and then expand that node 3 Right click the category node and select New SearchCategory Service from the contextual menu A new criterion node will appear under the category node 4 To rename the new crit
285. seeseeeeeeeeeeeseeeeeee 30 Tasa ETe Iac ep er te a aaa a ces od E EA TE A AE 30 Context Eel Bussttosd esp ME Une DUK Rupe es bd ta i eth te DM EET 31 BEL Y 32 QuickStartand T totalss o viv tig roter RU bn ris de rtr bh det ro Peli iere abe iubes 32 T stallition Guiden o baratos te oit eai Bt Daria b OE p bake nT aai eer etree ett 32 Browsing the documentation with an external web browset esse 92 Printing theusersdoc mentaton casar qid trib rb a Marsan Nain emai cuentas 32 Chapter 3 Developing Java Applications eeeeeeeeeeeeeeeeeee nh 33 Creatine new classes oeosi i FRE WORENY RA KA VA AEN PIRER VERA AR UD A FAVRE E VAVEAR XM SERA TYRRKE IRE 33 Editing aya SOUECeS esie e u ovest tle vri ie vae beler vu va tiesos oU EXT MEUS DON SEEE 37 Contents Integration with other Components vidus ca duh usd ile UE HUR Cu Fo E PLU ETUR t 37 The Editor window atid sts lasoutsiecosatdeixei tuia tinte Deu ton a e ale rre emu Ens 38 Opening fil s it the Editof s cede ama erts ird ei aiea d petuo trt boe pue torsades 39 Astersksin Editor Window da D Sueno tonto UN SUP tetra Satine ns silty Saha Sal adele CoD ds 39 Editor window contextual menus sta ode oiii i rdiet ebd e Un pe Pe Dod 39 Mouse and clipboard functions uem re certe eap unian an E EAR HEU eO 40 Editorabbrevidtion Ssi aegra ente md etel eR Ter OF ry e CUI GEO ERN Te 41 Edlc Davigato B Teal e Sho acsi hiec aia o Metin ada uae OB Cie NS NR a CLP HA 41 Standa
286. sible from the Object Browser or from the Filesystems tab in the Explorer Howevet it is also possible to organize files into projects to make it more convenient to compile or run them and to store different Project Settings for various applications See Organizing work into projects on page 153 Editing Java sources The Editor is a full featured text editor that is integrated with the Form Editor Explorer Compiler and Debugger It is the default viewer for all Java HTML and plain text files as well as any other types of files specified by installed extension modules Each of these open files is displayed as a page in a multi tab window a single window with multiple tabs enabling you to choose which page to view in the window by clicking one of the tabs Advanced features include customizable abbreviations and dynamic Java code completion Integration with other components The Editor is integrated with the following parts of the IDE Form Editor All changes made in the Form Editor window are reflected in the source code in the Editor window Explorer Object Browser and Properties window Changes in properties and creation of new classes methods and variables and so on done in these windows are reflected in the Editor window You can also open files in the Editor from the Explorer and Object Browset e Debugger When a program stops during execution the Editor automatically jumps to the breakpoint where t
287. startup and hidden All mounted file systems including hidden ones are visible in the Project Settings window under the Filesystems Settings node Using the contextual menus and their property sheets you can hide unhide or reorder them and control their behavior Note Once a new file system has been mounted it is equivalent to having added the archive or directory to the class path accessible by the IDE The mounted packages and classes are immediately available and can be edited compiled and run Mounting file systems To work with files in the IDE that you created outside of the IDE you must mount them to the Filesystems in the Explorer Mounted directories must be mounted at the default package and Java sources in them must be in packages corresponding to their position relative to the mount point If a file system is mounted at the wrong point the IDE will be unable to compile its sources and other problems will arise 75 Chapter 4 The Explorer and Object Browser For example mounting a file system from the point C work would not give the IDE correct access to the package pro ject1 stored as c work myprojects projectl In this case this file system should be mounted at C work myprojects so that project1 is the top level package To mount a new file system Right click on the Filesystems node in the Explorer and choose Add Directory from the contextual menu or 0 Choose Tools Add Directory from the
288. straints for the individual components in the layout 120 Chapter 6 Designing Visual Classes with the Form Editor Layout properties The layout properties enable you to modify the layout manager s overall settings such as the horizontal and vertical gap and alignment The properties vary depending on the layout manager Some layout managers do not have any properties To set layout properties O0 Select the layout manager s node in the Component Inspector The layout properties will then appear in the property sheet pane amp Component Inspector MyNewClass JDialog E Non visual Components BorderLayout e A ie Constraints properties These are the layout properties specific to each component managed by the layout manager For example when Border layout is used the Direction property is set according to which of the five parts of the form the component resides in the possible values being North South West East and Center To view or set constraints properties 121 Chapter 6 Designing Visual Classes with the Form Editor O0 Select the component in the Component Inspector and choose the Layout tab x Component Inspector jText MEI E3 MyNewClass UDialog EJ Non visual Components E GridBagLayout c jTextField JTextField m ees marae fo Ee Standard layout managers Border Layout A Border Layout enables components in a container to be arranged in fi
289. sual Classes with the Form Editor the form Tp A Sees SURG a Ke Ale E ello elo ee dee You can add multiple menu bars to one fotm but only one of these can be used as the current menu bar You can wtite code to switch the current menu bar when the form is running To change the current menu select the form s node in the Component Inspector select the Code Generation properties tab and choose the menu you want active from the drop down list on the Menu Bar property You can also switch the menu bars in user code while the form is running Adding menus to the menu bar Newly created menu bars come with one menu To add more menus 1 Right click on the menu bar under the Non Visual Components node of the form in the Component Inspector 2 Choose New Menu ot New JMenu if you are using Swing components from the contextual menu Creating a popup menu To add a popup menu to a form 1 Click on the popup menu icon under the Swing or AWT tab in the Component Palette 2 Click anywhere on the form to add it The new menu will appear under the Non visual Components list in the Component Inspector since it is not laid out by the layout manager You can use the same editing features as with a menu bar To use the popup menu visually write code like this popupMenul show component 100 100 where you want to show the popup menu The API documentation that comes with the Java 2 SDK has more details a
290. t Center North NorthWest and so on This setting has no effect if there is no free space remaining for the component Support for custom layout managers Itis also possible to use custom layout managers in the Form Editor Any layout manager with a default constructor and that does not use constraints for adding components can be used in the Form Editor when designing Important When adding custom layout managers that do not follow these criteria you must follow the specifications of the Forte for Java Layout Managers API in order to be able to use 127 Chapter 6 Designing Visual Classes with the Form Editor the layout manager in the Form Editor See the NetBeans web site for more information on obtaining and using the Forte for Java Layout Managers API To install a custom layout manager 1 Add the directory or JAR archive containing the layout manager s source or class to the IDE by choosing Tools Add Directory or Tools Add JAR from the main menu 2 Install the custom layout manager in the Component Palette by right clicking on the layout manager s class in the Explorer or Object Browser and choosing Add to Component Palette from the context menu 3 In the Palette Category dialog box that appears select the Layouts category and click OK Working with source code The Editor window displays the code for the active opened form The source code is always synchronized with the visual appearance of the form Every change ma
291. t to change the value it displays 214 Chapter 11 Configuring and customizing the IDE a If you have pressed the button in either the Foreground Color or Background Color panel press the drop down arrow that appears and choose a color or press the button to bring up the Color Editor If you are using the Color Editor choose one of the six color palettes Swatches HSB RGB AWT palette Swing palette and System palette by clicking its tab choose the color you want within the palette and then press OK to return to the Fonts and Colors property editor See Color Editor on page 288 for more information on using the different color palettes b If you have pressed the button in the Font panel you can then press the button to open the Font Property Editor select a font face style and size and then press OKto return to the Fonts and Colors property editor 8 Click OKin the Fonts and Colors property editor to record your changes Using an external editor It is possible to edit files from outside of the IDE while the file is open in the IDE Periodically the IDE will check to see if any changes have been made to the file from outside of the IDE and prompt you whether to load them or not If you want the IDE to immediately reflect changes you have made externally select the root node for the file system in the Explorer and choose Refresh Folder from the contextual menu Additional Editor Settings The property she
292. t colors for each state of a Swing component that uses a color indicator or has a color back ground or foreground You can apply any of these colors to any item with a color property Fonts Editor You can select the font family type and size from the Font Editor for any of the editors available under Editor Settings in the Global Options window and for any text property of a component Select the family style and size from the scrolling lists You can view your font selections in the Preview pane Click OK in the Font Editor to close the dialog box with your selections set Click OK in the Fonts and Colors Editor to set the change for the selected editor or window component Border Editor Visually separate areas of a window or panel by adding a border The Border Editor provides several styles of borders that you can apply to any component that has a border property Select the border type from the scrolling list and click OK to add the border to the component You modify the properties for the border in the properties pane below the scrolling list 289 Appendix F Custom Property Editors Cursor Editor Assign a cursor style to an item with the Cursor Editor The Cursor Editor provides a list of standard cursor styles to denote such things as text insertion resizing ability relocation and a wait period For items that take a cursor property click on the property and choose the cursor style either from the combo box or
293. t dialog box that appears enter the new key for the shortcut and press OK Setting the code completion box delay You can set the time it will take for the code completion box to automatically pop up To set the code completion delay Inthe Global Options window select Editor Settings Java Editor and set the Delay of Java Code Completion Popup property to the delay you would like in milliseconds Disabling code completion To disable code completion Inthe Global Options window select Editor Settings Java Editor and set the Auto Popup of Java Code Completion property to False Java Editor formatting options There are two options for the formatting of Java code generated by the Form Editor or through code completion Add Space before Parenthesis if True whenever parentheses are used to enclose parametets a space precedes the opening parenthesis Curly Brace on Next Line if True the opening cutly brace is placed on a new line 212 Chapter 11 Configuring and customizing the IDE These options can be accessed by choosing Tools Global Options and selecting the Editor Settings Java Editor node Caret row highlighting You can also have the current line in the Editor the line with the insertion point highlighted This setting is configurable separately for each type of editor To switch on caret row highlighting for an editor 1 Choose Tools Global Options from the main men
294. t f Reformat the entire file Reformat the selected lines Special Java Shortcuts Table 25 Java only shortcuts Press To CTRL SPACE Open the Java code completion list box with matching entries Press TAB to enter the longest common substring Press ENTER to complete the word and close the list box ALT u then g Prefix the identifier with get ALT u then s Prefix the identifier with set ALT u then i Prefix the identifier with is ALT g Go to the variable declaration For this shortcut to work properly the source file must be in a directory mounted in Filesystems and the parser database must be updated for that soutce ALT o Open the source based on where the insertion point is For this shortcut to work properly the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source 239 Appendix A Default Keyboard Shortcuts Press To ALITFI Open the web browser on the Javadoc file pertaining to the item that the insertion point is on For this shortcut to work properly the source file must be in a directory mounted in Filesystems and the parser database must be updated for that source In addition the Javadoc documentation for that soutce must be mounted under the Javadoc tab in the Explorer CTRL SHIFT t Comment out the current line or selected lines of code CTRL SHIFT d Remove comment from the current line o
295. t text CTRL F3 Search for the next occur Search for the next occur rence of the word that the rence of the selected text insertion point is on ALT SHIFT h Switch highlight search on or off CTRL g Show Goto Line dialog Edit shortcuts Table 22 Standard Edit shortcuts Press To INSERT Switch between insert mode and overwrite mode CTRL a Select all CTRL y Undo the previous command CTRL z Redo the undone command CTRL x Delete the selected text from the file and copy it the clip board SHIFT DELETE Delete the selected text from the file and copy it the clip board CTRL c Copy the selected text to the clipboard CTRL INSERT Copy the selected text to the clipboard CTRL v Insert the clipboard text into the file SHIFT INSERT Insert the clipboard text into the file CTRL e Remove the current line CTRL h Remove character preceding the insertion point CTRL u Delete text in the following cycle when using the shortcut successive times first the text preceding the insertion point on the same line then the indentation on the line then the line break then the text on the previous line and so on 237 Appendix A Default Keyboard Shortcuts Press To CTRL w Remove the current word or the word preceding the inser tion point CTRL k Word Match find the previous
296. t the comment See the following section for more information Auto Correct opens the Javadoc Comment window and automatically corrects any errors in the tags e View Source opens the source file which you are currently documenting and moves the insertion point to the element selected in the Javadoc Comment dialog box e Refresh refreshes the display in the first pane to reflect any changes made in the source file for example through the Editor Javadoc Comment dialog box The Javadoc Comment dialog box lets you add comments to class elements separately To open the Javadoc Comment dialog box O Press Edit Comment in the AutoComment Tool dialog box ot Open the property sheet for the element you want to document click on the value of the Javadoc Comment property and then click on the button that appears 173 Chapter 10 Searching and Creating Javadoc Documentation Javadoc Comment public MemoryView x Javadoc Comment Text Frame to display amount of free memory in the running application lt P gt Handy for use with NetBeans Developer s internal execution Then the statisti of free memory in the whole environment is displayed 2 Tags version 1 0 Delete Move Up Move Down Name version v Description 1 0 ee ce m The Javadoc Comment dialog box has two main panes The Javadoc Comment Text pane displays comment text The Tags pane displays a
297. tP Press CTRL SPACE or pause after entering a period The code completion box will then appear Ff Editor Ted private void jMen private void jMen amp FileChooserLll f amp FileDescriptor amp amp FileDialog O FileDialogPeer amp amp FileFitter 0 FileFilter amp amp Filelnputstream FileNameMap FileDialog filel d FilenotFoundException fileDialog show p FileOutputStream if fileDialog G gy FilePermission f Add your hank doSavens f Add your kani return amp y FilePermissionCollection fileName file fy FileReader By FileSystem 69 21 java awt event ActionEvent evt java awt event ActionEvent evt this Open FileDialog LOAD File separator fileDialog getF 1 mus eis found at 166 21 42 Chapter 3 Developing Java Applications 3 Then use the most convenient combination of the following steps a keep typing to natrow down the selection of items in the list b use the navigation keys UP arrow DOWN arrow PAGE UP PAGE DOWN HOME and END ot the mouse to scroll through the list and select an expression c press ENTER to enter the selected method into your file and close the code completion box d press TAB to select the longest common substring matching the text you have typed Bash style context sensitive completion and keep the list box open If you press ENTER for a method with parameters replaceable text is given for the
298. te javax swing JButton jbtnNewTimeFormat End of variables declaration private GregorianCalendar gCal new GregorianCalendar private String timeFormat hh mm ss private SimpleDateFormat formatter new SimpleDateFormat timeFormat public static void main java lang String args new ClockFrame show INS The bottom of the Editor window has one or more tabs used to view different documents From each of these tabs the document can be saved closed docked ot undocked and cloned For more details on managing windows see Window management on page 187 36 Chapter 3 Developing Java Applications Opening files in the Editor Double click a Java ot text object in the Explorer or the Object Browser to open the Editor or select the node of the object and press ENTER Any files that you subsequently open will also appear in the Editor with their own separate tabs in the bottom of the window The tab of the currently visible file is highlighted To flip between displayed files simply click the tab of the file you want displayed or use the AIC LEFT and AIt RIGHT keyboard shortcuts Asterisks in Editor window tabs A modified file in the Editor window is marked with an asterisk after its name on its tab The asterisk also appears after the file name in the window title If there are any unsaved modifications when the Editor is closed a prompt will appear to save or discard changes ot cancel the operation
299. template The Java Sources node also contains the Source Synchronization subnode where y you can enable or disable the source synchronization feature as well as set its return mode Object Browser The sole property for this node enables you to set custom package filters for use in the Object Browser You can also do this from the Object Browser window See Guide to the Object Browser on page 86 for information on using the Object Browset Project Options The sole property for this node enables you determine whether files newly created from 181 Chapter 11 Configuring and customizing the IDE template are automatically added to the current project or not If set to Ask each time you create a class from template you will be prompted whether or not to add the class to the current project If set to Never you will not be prompted and the class will not be added to the current project when you create it If set to Always you will not be prompted and the class will automatically be added to the current project when you create it See Organizing work into projects on page 153 for more information on working with ptojects Global Options The Global Options govern the overall look content and performance of the IDE regatdless of the project you are working on The left pane of the Global Options window provides a tree view of the Global Options items and the right pane displays the property sheet where you can v
300. tend it to the end of the the end of the line line 234 Appendix A Default Keyboard Shortcuts to the end of the current wotd Keyboard With no selected y With selected text shortcut text CTRL HOME Move the insertion point Deselect the text and to the beginning of the move the insertion point document to the beginning of the document CTRL END Move the insertion point Deselect the text and to the end of the docu move the insertion point ment to the end of the docu ment CTRL SHIFT Create a text selection and Extend the selection to HOME extend it to the beginning the beginning of the docu of the document ment CTRL SHIFT Create a text selection and Extend the selection to END extend it to the end of the the end of the document document ALT e Move the insertion point Move the insertion point to the end of the last word in the selection Table 18 Insertion point screen position shortcuts Press CTRL UP Scroll the text one line up while holding the insertion point in the same position CTRL DOWN Scroll the text one line down while holding the insertion point in the same position ALT t Scroll the text up so that the insertion point moves to the top of the window while remaining at the same point in the text ALT m Scroll the text so that the insertion point moves to the mid dle of the window while remaining at the same point in the te
301. tes JavaDoc documentation for the selected classes or elements and places it in the directory that you spec ify 82 Chapter 4 The Explorer and Object Browser Command Description Tools Add to Component Palette Adds selected object to the Compo nent Palette Tools Synchronize Forces synchronization of the selected source file with the interfaces it imple ments Tools Set As Project Main Class Sets the selected project as the class to be executed when you choose the Exe cute Project command Tools Add to Project Adds the selected class to the project making it subject to compilation when you choose the Compile Project com mand Save as Template Publishes the selected object as a tem plate for future use Properties Opens a separate Properties window showing properties of the selected object s Searching for files in Filesystems Itis possible to do searches to find files in the mounted directories based on modification date file name text in the file or any combination of these three You can also use regular expressions To initiate a search for files in Filesystems 1 Choose Tools Search in Filesystems from the main menu or right click on a folder node in the Explorer or Object Browser and select Find from the contextual menu The Customize Criteria dialog box will appear 2 Enter search criteria using any combination of the three tabs Date Full T
302. the Java Elements node and enter a format for each type of element See Java Elements reference on page 272 for a guide to the substitution codes and formats available The tool tip for each object and element displays the full signature for each element including access modifiers and field types It is also possible to create elements of classes using the contextual menus of classes in the Explorer and Object Browser 91 Chapter 4 The Explorer and Object Browser Table 4 Source and form file icons Icon Description Java source file Java file without source code Runnable Java object l Invalid Java source file cannot be parsed Form object Runnable form object Incorrect form object cannot be parsed Invalid package declarations Source files that have the wrong package named in their code are marked with Invalid package declaration in the tool tip To rectify this you can change the package name in the file or mount a different directory As a shortcut you can use the Open File feature to mount a new directory and open a file in that directory See Adding a file to the IDE on page 77 Elements of Java objects and member accessibility Subtrees of each Java object represent the hierarchy of elements Java objects typically contain at least one class that contains elements such as constructors methods variables and inner classes You can set behavior
303. the insertion point is positioned after a brace bracket or parenthesis you can also press CTRL b to move to the matching brace If you press CTRL SHIFT b the text within the braces is selected 46 Chapter 3 Developing Java Applications Formatting code The Editor provides several features that make it easier for you to create well formatted and easy to read code When you type a line of code in the Editor and press ENTER the next line is automatically indented according to its hierarchy in the code Howevet you can easily modify the indents with keyboard shortcuts CTRL t to increase line ot block indentation CTRL d to decrease line or block indentation In both cases if nothing is selected the whole line is shifted one tab stop If a block of text is selected those lines are all shifted If you have made changes to the formatting of a file and would like to go back to the default formatting use the Alt f keyboard shortcut or right click in the Editor window and choose Reformat Code If no text is selected when you choose this command the whole file will be formatted Otherwise the selected lines are reformatted There are several configurable options for formatting of automatically generated code See Java Editor formatting options on page 212 Editor Settings The Editor has other configurable settings such as for font and color settings abbreviation tables formatting of generated code appearanc
304. the order of or edit components From a component s contextual menu you can move it up or down cut copy delete or set properties Some items have an Is Container property which when set to True means that other components can be added to that component in the Form Editor See Is Container property on page 108 for more information Bookmarks This node holds all of the bookmarks URLs that appear under Help Bookmarks in the main menu Using the contextual menus you can add remove move change the order of or edit bookmarks as well as create sub folders to organize them 184 Chapter 11 Configuring and customizing the IDE Debugger Settings The Debugger Settings property sheet contains settings enabling you to choose what action should be performed when tracing into a method without source whether to compile classes before debugging which workspace to use when debugging and so on See Debugging Java classes on page 60 for a complete guide to debugging in the IDE and Search Types reference on page 260 for a description of each setting Documentation The Documentation property sheet contains options for the IDE s Javadoc generation functionality with nodes for Internal Javadoc options for the IDE s Javadoc module and Standard Doclet See Generating Javadoc documentation on page 175 and Documentation settings reference on page 263 for more information Editor Settings The Editor Settings pro
305. the window For mote information on Javadoc properties go to the Javadoc page on Sun s web site http java sun com products jdk 1 2 docs tooldocs solaris javadoc html Changing the directory for generated Javadoc documentation To change the directory for generated documentation 1 Choose Tools Global Options from the main menu and select the Documentation Standard Doclet node in the Global Options window 2 Select the Destination property and change the directory manually or click the button that appears to change it using the File Chooser 176 Chapter 11 Configuring and customizing the IDE This chapter provides an overview of the various parts of the Forte for Java Community Edition IDE details advanced functions and tells you how you can customize it to your own specifications Project Settings This window holds all of the IDE system settings that can be set for a project Whenever you change one of these settings the change only affects work in the current project If you switch to a different project the IDE automatically switches to the Project Settings for that project See What is a project in Forte for Java on page 153 and Organizing work into Chapter 11 Configuring and customizing the IDE projects on page 153 for more information on projects Project Settings ea Project Settings Q 9 Filesystems Settings a Default system D Forte4JCE_489javadoc S Developm
306. their access modifiers For example if only the Class Private and Package filters are selected all classes with private and package private modifiers will be displayed 87 Chapter 4 The Explorer and Object Browser No classes with public or protected access and no interfaces at all will be shown By default all seven filters are selected meaning that all objects are shown including classes and interfaces with any access modifier Whereas the Explorer uses a tree structure the Objects pane uses a list structure Whereas the Explorer tree would should show class Innerclass as a subnode of Outerclass the Object Browser would display them in a list as the separate items Outerclass and Outerclass Innerclass Members pane The Members pane displays members of the object selected in the Object pane The first icon in the Members pane is a toggle switch that enables you to view members as bean properties and events When this icon is selected the other filters in the pane are disabled The next three icons represent filters for general member types methods variables and constructors As with class and interface objects in the Objects pane you can further filter method variable and constructor members according to their access modifiers using the second group of icons identical to the last four icons in the Objects pane Clicking on the last icon in this pane enables you to sott the members alphabetically within member typ
307. ti tab window displaying the same content 3 If you so desire undock this new view of the file or dock it into a different window An Editor window with a clone ClockFrame olx era Of x l package tutorial clock partl Z IX ora abf oo a z di dax iV 49 if 3lblCurrentTime null s 50 jlblCurrentTime setText timeTxt 3 import java util Date 51 4 import java util GregorianCalendar 52 5 import java util Calendar MORET 1 iiem d 6 import java text SimpleDateFormat 53 n ALt ino CEEOL E lad k3 3 prete t 54 private void exitForm java avt event JindowEve import javax swing JOptionPane 55 System exit 0 9 56 an rus 57 n an 58 12 59 ff Variables declaration do not fy m 60 private javax swing JLabel jlblCurrentTime 14 61 End of variables declaration 62 private GregorianCalendar gCal new Gregoria 15 public class ClockFrame extends javax swing JFrame x 3 53 private String timeFormat hh mm ss 16 i i 17 44 Initializes the Form 4 54 private SimpleDateFormat formatter new Simp zi Initializes the Form 65 Be 18 public ClockFrame 19 initComponents d zm k 0 i 67 public static void main java lang String arg pack 68 new ClockFrame show For more information on docking see Undocking and docking windows on page 190 Note You can not use the clone command for the Explorer window However you c
308. tings Configuring Forte for Java to use a SOCKS proxy To use Forte for Java with a SOCKS Proxy on a Windows machine 0 Gotothebin forte4j cfg file in the installation directory open it in a text editor and add the switch J DsocksProxyHost SOCKS SERVER DsocksProxyPort 1080 197 Chapter 11 Configuring and customizing the IDE replacing SOCKS SERVER with the hostname of your SOCKS proxy Contact your system administrator if you do not know this To use Forte for Java with a SOCKS Proxy on Unix 0 Goto thebin forte4j sh file in the installation directory or the bin forte4j multiuser sh fot multi user installations open it in a text editor and add the command line switch DsocksProxyHost SOCKS SERVER DsocksProxyPort 1080 replacing SOCKS SERVER with the hostname of your SOCKS proxy Contact your system administrator if you do not know this If you are still having problems with configuring your system to get the Update Center to work you can check http www netbeans com ffj community autoupdate_info html proxy for more information or see below for instructions on updating the IDE manually Authenticating Update Center downloads When you download modules through the Update Center the IDE authenticates the module by checking its digital signature to make sure that it matches with a certificate in the IDE s key store The certificate for all Forte for Java modules originating from Sun Microsystems is in the IDE
309. tion about the module selected in the Available Modules including the version numbers of the module installed and its update the size of the module in kilobytes and a description of its function The Total Size field indicates the total size of all of the selected modules You can get a more detailed description of a module by selecting it in the Available Modules combo box and then pressing the Home Page button to link to the module s desctiption on the web site Click Next when you have made your choices 195 Chapter 11 Configuring and customizing the IDE The IDE will then download the modules that you have selected and check for their digital signatures to determine if the module has arrived intact and whether it has a certificate You will be prompted if the download is unsuccessful the downloaded file is corrupted or the file contains an unrecognized or untrusted certificate See Authenticating Update Center downloads on page 198 for more information on cettificates 7 When the download is finished click Next to move to the fifth panel 8 Click Finish to restart the IDE and begin working with the newly installed modules Automatic Update Check dialog box When the Automatic Update Check dialog box appears to prompt you whether to check the Update Center you can configure the Update Center settings in the same dialog box If you check the Show Autocheck Configuration checkbox you will be presented with several options
310. to command 66 Trace Out command 66 Trace Over command 66 U undocking windows 190 Update Center 194 199 certificates 198 manually updating 198 options 187 proxy settings 196 reference 278 V version control system See CVS W web browser 71 window management 187 cloning 193 docking windows 190 redisplaying obscured windows 194 undocking windows 190 workspaces 188 workspaces 188 automatic switching 189 customizing 222 reference 255 settings 179 Z ZIP files 76 298
311. to the firing events The type of parameter EventObject subclass will be the same as the type of parameter of the corresponding method in the listener interface If you leave the Pass event as parameter option unchecked the firing method will have the same parameters as the constructor of the event object class subclass of EventObject and this constructor will be called in the body of the firing method If there are multiple constructors for the event class the generator behaves as if the Pass event as parameter option is checked When you click OK an addEventNameListener method and a removeEventNameListener method along with firing methods if you specified them will be added to your source For multicast event sources you can specify how to implement the adding of listeners and firing of events To add an event set deliverable to more than one listener 1 Right click on the Bean Patterns subnode of your class and choose New Multicast Event Source from the contextual menu The New Multicast Event Set dialog box will 102 Chapter 5 Developing and Customizing JavaBeans Components appear on the screen 2 In the Type field specify any listener interface event class type that extends java util EventListener 3 Click one of the three radio buttons below the Type field to choose how you want the event set implemented The options are Generating an empty implementation e Generating a simple ArrayList implementation
312. to view Javadoc Index Search open the Javadoc Search Tool window to conduct a search on Javadoc directories mounted in the Explorer Getting Started open the Forte for Java Community Edition QuickStart Guide in the web browset e Tutorial open the Forte for Java tutorials in the web browser Forte For Java Home on the Web open the web browser and connect to the Forte for Java web site at http www netbeans com If you are using a machine which connects to the internet through a dial up modem this may mean your modem attempts to dial and connect to your ISP This depends on your local system configuration Forte For Early Access Program open the web browser and connect to the web site for the Forte for Java s Early Access Program Forte For Java Open APIs On line open the web browser and connect to the web site for the Forte for Java s Open APIs On line Bookmarks display a submenu with bookmarks If you select a bookmark the web page connected with it will open in the web browser Tipofthe Day display the Tip of the Day dialog which opens by default when you run Forte for Java Update Center connect with the Forte for Java web site to automatically install new or updated modules to your IDE e About display the About Forte for Java Community Edition dialog Toolbars There ate toolbar items for many of the menu commands as well You can identify the command
313. torial clock G tutorial clack part Gi tutorial clock part2 G tutorial clock part3 G tutorial colorpicker G tutorial imageviewer Packages pane f ClockFrame e formatter amp e gCal e jbtnNewTime e jlblCurrentTime amp e jlblNewTime amp e jPanelt o jtfNewTime amp e timeFormat amp e tmrSeconds He ClockFrame Be exitForm amp o initComponents amp o jbtnSetNewTimeClicked eg main e tmrSecondsOnTime The Packages pane lists all of the packages from all of the file systems visible under the Filesystems tab of the Explorer The first icon on the top of the pane is the Show as tree icon which gives you the choice whether to view the packages as a tree when selected or a list when deselected The second icon is for expanding the whole tree A pull down menu in the upper left corner enables you to choose different package filters Objects pane The Objects pane displays objects of the package selected in the Package pane Three types of objects classes interfaces and sourceless files can be filtered The seven toggle icons in the top of the pane represent filters for these objects The first three icons Class Interface and Sourceless Data Object without source represent general filters meaning you can choose whether to display any objects of these types The second group of icons Public default Protected and Private are filters for the class or interface according to
314. tract resource name such as com mycom myImage gi f such as when creating a JAR file for distribution then the resource names and JAR manifest entry names will be relative to the mounted directory as well Files that cannot be opened for editing will typically just be displayed in their own Explorer window You can also select ZIP or JAR archives with Open File When you do they are immediately mounted in the Explorer and an Explorer window is opened on their contents to make it easy to browse archives Note Mounted JAR archives are read only Working with packages All objects you create when writing an application in Forte for Java are displayed under the Filesystems tab in the Explorer where they can be added removed and edited You can organize these objects in packages which are visually represented by folder icons When starting a new development project identify the data path or file system see above to use for your work right click on that path and choose New Package from the contextual menu Once you enter a name for the new package it appears in the Explorer under the path you have selected You can also create a package at the same time as you create a new class from template in the New From Template wizard You can create several layers of packages meaning packages within packages in the same way You can delete a package by right clicking on its node and choosing Delete from the contextual menu or by selecting it
315. ts are currently open or the selected object is unmodified Save All save all current unsaved open objects Save Settings save all current unsaved Project Settings This command is available only when the Projects module is disabled or uninstalled and replaces Save Project Print print the file active in the Editor or selected in the Explorer or Object Browser Exit exit the IDE You will be prompted to selectively save any currently open unsaved objects discard their changes or cancel Workspace configurations and other settings changes are saved Edit Menu Undo undo last action Redo redo last action e Cut cut selected object or text to clipboard e Copy copy selected object or text to clipboard e Paste paste contents of clipboard Delete delete selected object Find find file or find text in file e Replace replace in text e Goto go to line number in Editor window View Menu Explore from Here open a new Explorer with the selected node as the root 247 Appendix C Main Window Menus and Toolbars Properties make the Property Sheet window for the selected object the active window or open the property sheet Explorer Window make the currently open Explorer the active window or open it if it is not already open Editor Wndow make the currently open Editor the active window or open it if it is not already
316. ts the items alphabetically selecting the second sorts by package and alphabetically and the third sorts by element exceptions classes constructors and so on To the right of the sort icons is the HTML Viewer togele button which you can click to turn on ot tutn off the right pane Below the combo box and icons are two panes The first pane displays the list of pages found in the search and the second pane shows the page selected in the first pane The left pane can be expanded to cover the whole dialog box area by deselecting the icon to the right of the sort icons The size of the panes can be changed by dragging the divider in the center If you double click on a page in the left panel it opens in a separate web browser window 171 Chapter 10 Searching and Creating Javadoc Documentation Using Javadoc Auto Comment The Auto Comment utility enables you to comment your soutce code automatically and view all parts of your source code methods constructors inner classes variables and so on and document them individually Auto Comment Tool dialog box You can open the Auto Comment Tool dialog box by right clicking on a source file or one of its elements in the Explorer or Object Browser and choosing Tools Auto Comment The Auto Comment Tool dialog box consists of two panes seven filter icons and four buttons Tip You can use the Auto Comment Tool for multiple files simultaneously To do so hold down the SHIFT key whil
317. ts to executed applications To pass command line arguments to executed Java applications 1 Select the object in the Explorer 2 Choose Build Set Arguments from the main menu 3 Enter the arguments in the dialog box separated by spaces or 1 Select the object and open its property sheet by choosing View Properties from the main menu 2 Click the Execution tab and type the argument in the Arguments property Note This applies only to application arguments not to Java virtual machine arguments which must be configured on the object s executor see Adding and modifying service types on page 204 56 Chapter 3 Developing Java Applications Execution Settings node In the Global Options window is the Execution Settings node where you can configure the IDE s behavior when running applications The options include whether to automatically compile applications before execution and whether to create a new output tab each time you run a class See Execution Settings reference on page 269 for more information Applet viewer settings You can choose which viewer to use when running applets You can use either Sun s JDK utility AppletViewer which is set by default An external viewer such as Netscape Navigator or Microsoft Internet Explorer For security reasons internal execution is not possible for applets To change the default viewer 1 2 Choose Project Settings from the main menu
318. tte you can find the current Component Palette categories By expanding a category node you can view a list of all components in that categoty To create a Palette category 1 Choose Tools Global Options from the main menu 2 Right click on the Component Palette node and choose New Palette Category from the contextual menu 3 Enter the new category name in the dialog box and click OK The new category will appear as the last item in the component categoty listing and a tab for the new category will appear in the Component Palette Standatd clipboard operations are available at each level of the Explorer s Component Palette hierarchy Individual components can be cut copied and pasted between component categoties For example you can copy the components you use most to a new categoty for quick and easy access You can also cut copy and paste component categories Component categories can be renamed either by choosing Rename on the contextual menu ot using in place renaming in the Explorer It is also possible to customize the ordering of component categories and the components within a category To move a component category Inthe Global Options window under Component Palette right click on the category node and choose Move Up ot Move Down from the contextual menu or Right click on the Component Palette node and choose Change Order from the contextual menu to bring up the Customize Order dialog box which lists all of the
319. tual menu You will get a dialog box for setting the order of all subcomponents in the container Property Sheet pane in the Component Inspector The lower pane of the Component Inspector displays the property sheet for the object selected in the upper pane The property sheet contains up to five categories represented by the tabs Properties Expert Layout Events and Code Generation COXEEN TITAN Weed Mex Not Set resizable layout modal Depending on the property properties can be edited by 117 Chapter 6 Designing Visual Classes with the Form Editor Clicking on the current value typing in a new one and then pressing ENTER e Double clicking on the property name to select from a fixed list of choices e Clicking on the value and then selecting from the drop down list that appears e Clicking on the value and then clicking the button that appears Clicking on this button brings up a custom property editor dialog box m pese See Custom Property Editors on page 288 for a description of the various custom property editors Custom property editors for component properties When you bring up the custom property editor for a property of a form component the Property Editor dialog box that appears may have more than one tab For example properties on the Properties tab have a Form Connection property editor associated with them see 118 Chapter 6 Designing Visual Classes with the Form
320. ty to Any Host any incoming requests will be honored Many local area networks prohibit arbitrary traffic from entering the network from the Internet so this is not necessarily as unsafe as it sounds Also note that the request is sent through UDP which most firewalls will not pass e Port You may configure the port the server runs on which might be necessary if another program is using port 7318 e Running You may set this property to False to stop the server or True to turn it back on 226 Chapter 11 Configuring and customizing the IDE Stopping the server only affects using the launcher it does not affect opening files from within the IDE using the toolbar button or menu item 221 Appendix A Default Keyboard Shortcuts Table 9 Naming Convention for Function Keys Name Used For LEFT UP RIGHT DOWN Insertion point arrow keys BACKSPACE SHIFT ENTER These keys correspond to common DELETE special keys on most keyboards END HOME PgUp PegDown Other insertion point repositioning keys F1 F2 F12 Numbered function keys across the top of the keyboard Modifier keys Most keyboard shortcuts use one or more modifier keys such as ALT CTRL META and SHIFT which you must hold down while pressing the other key in the combination Note These names are conventional but some systems especially the X Window System may use different names For example META is often equ
321. u 2 Expand the Editor Settings node and select the type or types of editor for which you would like to turn on the highlighting 3 Click the Expert tab of the property sheet 4 Change the Highlight Caret Row property to True The color of the caret row highlighting can be customized Follow the procedure in Setting fonts and text coloring in the Editor choosing the highlight row item in the Fonts and Colors dialog box Setting fonts and text coloring in the Editor You can customize the fonts and background and foreground colors for various types of text tokens in the Editor using the Fonts and Colors property for each type of editor found under Editor Settings in the Global Options window The following are some of the tokens you can set fonts and colors for e default text meaning that the fonts and colors assigned here are the ones used for all types of text except where overridden by configuration of the specific text types e different types of values such as strings and integers text blocks such as current caret row selected text editor bookmarks and guarded uneditable text block comments and line comments e tokens such as methods identifiers and keywords e items found in incremental searches and items found in highlight searches status bar and status bar when highlighted To change the font or color for a token 1 Choose Project Settings from the main menu 213 Chapter 11 Configuring
322. uc edis debe e die dx ie Sensi UE ES S ues EEEN EE A E Usu das 16 Chapter 1 Welcome to Forte for Java Community Edition 17 Product features ccn dean bos hne asa ic ET EOE VIR NC UDU ug cux V uu Suu ti UR LIE 18 C hliapter2 IDE Essentials oit senseo esa uoto beso comuni icu Cuna SR Ead ReE 21 Us rint rface ec 21 Mair QVCDOEHSES ipeo as a RE Pda b Qd nie bid itm CORR a aaa Go osito iria Eel RE even evs 22 Th Explotef zio netu nnii ia ha t eia e ARR Raan aaan an a 23 ENAT eea OS m E fa nidiviiesd lactis anatinnntatntiaeierectis 23 Default operaio Rm 24 Property SHEEP uestes a eS at a A a adus ebd abend A A 24 Axccessinp the property sheet aee E TE aae eb O E A a 24 Contents ofthe property sheet iieo r e ao RP ed edd d aee 25 Property sheet toolbatia s aee dee rro reo Her te e oe Hebe re de QR e P E E S 26 Custom property editors RR RD UE HR EE RR EA Red 26 Fotm DOLOR o aou baundta mosse oed onn iE unam end o ue crede e Rr D DUDEN Ee ud mens 26 Fotm Editor wind ow sssssscssssssiesessssssessssssseiosobessssesssnsnasbosnssasdscotssndasobossssacdssoestassasassagassaaaasagapsasassagaseaanines 27 Component Inspector sii aceite na EEE EE EAEE EES ES EK ES ENEN N NS 27 Editor window ioscecnon onec celata quon na aa aai aina piis 28 Project Settings and Global Options Windows certis edem pietad eat a enRta apip ente dd 29 JavaHelp context help and tool tipS sssesssssssssssssssssssssssssssssesseeeeeeeeseeeee
323. uide to Project Settings and Global Options Output Window reference Table 56 Output Window properties Property Description Background Background color of the Output Window Cursor Background Background color of highlighted text Cursor Foreground Color of highlighted text Font Size Size of the characters in the Output Window Foreground Default text color Jump Cursor Fore Text color for lines of text in the Output Window that are ground linked to lines in the Editor Jump Cursor Back Background color for lines of text in the Output Window ground that are linked to lines in the Editor Tab Size The number of spaces represented by a TAB stroke 275 Appendix D Reference Guide to Project Settings and Global Options Print Settings reference Table 57 Print Settings properties general Property Description Line Ascent Correc A multiplier to adjust the spacing between lines tion Page Footer Align Options LEFT CENTER and RIGHT ment Page Footer Font Has a custom property editor available enabling you to set font face style and size Page Footer Format You can set the footer with a combination of text and the following tags 0 for page number 1 for date and 2 fot file name Page Header Align Options LEFT CENTER and RIGHT ment Page Header Font Has a custom property editor available enabling you to set font face style and size
324. uncher for example C jdk1 2 2 jre bin javaw jar C Program Files forte4j modules utilities jar port 2121 C My Development com mycom MyClass java Note that you may also pass multiple files at once to the launcher The available options are host hostname or IP select an alternate machine to open files on The specified machine should be the one running the IDE You may want to also turn on nocanon below The Open File server must be configured to accept requests from the machine running the command below port port number Select an alternate port to send the Open File requests to via UDP By default port 7318 is used The Open File server must be configured to listen on that port below 225 Chapter 11 Configuring and customizing the IDE canon default or nocanon when using canon any relative file names passed to the launcher are first converted to an absolute name If using host to open files remotely you may want to use nocanon and always specify the correct absolute file name for the machine running the IDE e wait and nowait default by default the launcher sends a message to the IDE asking it to open a file and then immediately exits as soon as the IDE has opened it The command will return a success code zero on Unix normally or an error code nonzero on Unix if there was a problem opening the file Some applications demand that an editor be used to make a specific set o
325. unching the process enter Xdebug in the Java virtual machine s parameter list after classic when running on HotSpot and note the agent password 2 Choose Connect from the Debug menu or toolbar to bring up the Connect to Running VM dialog box 3 Enter the host name and agent password in the dialog box 65 Chapter 3 Developing Java Applications After clicking OK the Debugger will connect to the running VM and you will be able to see all threads as if you were debugging locally If you have source code for the debugged application and you set a breakpoint in the source code the Editor will be opened with the breakpoint line highlighted in the source Setting the debugger The debugging category for example applet or standard is set for each separate object in the IDE When you set debugging you choose from a list of debugger types each of which represents a specific configuration of a debugger including the path to Java and arguments There can be multiple debugging types for a given debugging category though the IDE comes with only one for each category See Adding and modifying service types on page 204 for more information To switch an object s debugging type 1 Select the object under the Filesystems tab in the Explorer 2 Go to the object s property sheet by choosing View Properties from the main menu 3 Click on the Execution tab in the Properties window 4 Rotate through the debugging types by dou
326. usGained and focusLost ate both of type java awt event FocusEvent then you may use the same handler for all of them For example you could set both focusGained and focusLost to use the buttoniFocusChange handler You can also have the same event on several components share a handler When you enter a new name for an existing handler the code block is automatically edited to use the new name When you delete a name the code block is deleted If more than one handler uses the same name and the same block of code deleting a single reference to the code will not delete the code only deleting all names will delete the corresponding code block and a confirmation dialog box will be displayed first Note If you delete an event but do not delete the event handler when prompted by the confirmation dialog box an orphaned handler will remain in the guarded text If you wish to delete the orphaned handler you will have to add another event attach it to the handler delete that event and then agree to delete the handler in the confirmation dialog box Removing event handlers To remove an event handler 1 Select the object in the Component Inspector and select the Events tab on the property sheet 2 Select the event in the property sheet delete all of the text of its name and press ENTER The value none will reappear in the value field for that event Renaming event handlers To rename an event handler 1 Select the object in
327. ut by default e Panel and JPanel have Flow Layout as the default layout Layout managers do not apply to all containers For example ScrollPane JScrollPane JTabbedPane JLayeredPane JDesktopPane and JSplitPane have their own special layouts which cannot be changed Setting and changing layout managers To change the layout manager 1 Select the desired layout in the Layouts tab of the Component Palette y AMT Swing Swing Other Beans Layouts Borders 2 On the form click inside the container whose layout you want to change Or 1 Right click on the target container either an empty part of the form in the Form Editor window or the node for the container in the Component Inspector 2 Change the layout using the Set Layout submenu Note When you change layouts the IDE remembers the constraints used on the discarded layout Therefore if you change the layout back it looks the same as it last looked in that layout The only exception to this is when you switch from Absolute Layout to GridBag Layout When you switch from Absolute to GridBag the GridBag constraints are created so that the GridBag Layout looks as close as possible to the previous Absolute Layout See Standard layout managers on page 122 for more information on the various layouts Setting layout properties and constraints You can modify the appearance of a container on your form by setting general properties for the layout manager and con
328. utton which you can press to access context help Tool tips Tool tips are panels with short text descriptions that appear when you briefly hold the mouse cursor over a part of the IDE They are particularly useful for explaining the use of tree nodes and individual properties listed in the property sheet QuickStart and Tutorials You can view the GuickStart Guide as well as tutorials for Forte for Java Community Edition in the internal web browser From the main menu choose Help Getting Started or Help Tutorials Installation Guide Besides installation instructions the Installation Guide provides an overview of directories and files included in the installation directory as well as a list of switches that you can use to do things such as add class paths set the IDE font size and change the look and feel Browsing the documentation with an external web browser HTML copies of the User s Guide Getting Started and the Tutorials can be found in the docs folder of the installation directory You can open these files in an external web browser Printing the user s documentation Copies of the User s Guide the QuickStart Guide and the Tutorials for Forte for Java Community Edition ate included with the IDE in PDF format You can find them in the docs subdirectory of the IDE s installation directory Using Acrobat Reader available free from Adobe Software you can view and print these files 32 Chapter 3 Developing Java
329. utu an don cel dO SUR Cu Eel Ibn SR ua En TRU RD 103 Bean Info node 5 tadenadennaogenetientirieteri etri i e P vb eb tb eb eie e eb Pete eb tape e Fee eani 104 Properties and Event Sources nodes sees 105 Subnodes of the Properties and Event Sources nodes sse 105 Iona blond 106 Regenerating Beanlfi ouis emere nc oe nete eg iade need mnes 106 Customizing JavaBeans components eeeeeeeeeeee esee eene ennt nnne tnnt nnns 106 Adding JavaBeans components to the IDE eese eene 107 Is Container iO Petty Gon SOR ue ted E at metu tuvtub teat a PI MR rM adiectum M IHE 108 Adding JavaBeans from a JAR or local directory iiie tesa tse deitatis vete tes 109 Adding JavaBeans using the beans OitecboEy osuere ese t pep ie oq WDR ERAT 110 Chapter 6 Designing Visual Classes with the Form Editor 111 Opening the Form Editor iso eco aire E eno E TR canna 2 IRR ia I TUN OD RM TA E QDR Eo ER AE ERA CHUA 111 Creating d new form dos cotidie dastiesad edle dnas etl nb Ede rete eee eheu ces 113 Working with components cu ce ea eren nhe e RO edey S RENE REN DeT eR Y SOINS TRAIN XD NER RU EINE ATA 114 Adding nes comparieH Sono apes odit erts Feeds ubera etel picta lee bed 114 oBlec itig COMMONS orci od anune aa dirai fum busta idu Gears ERG a a DE 115 Connector modesaus a ede de nat aui n T Ua cte atat p Ceca niaii 115 Moving c
330. ve positions Center which expands to fill any empty space left in the other four parts of the component and along the four sides North West South and East Components in the North and South positions automatically expand horizontally to take up the whole space and the West and East components automatically expand vertically The horizontal and vertical gap properties control spacing between the components Flow Layout A Flow Layout arranges components in a container like words on a page it fills the top line from left to right then does the same with the lines below You can specify the alignment of the rows left center right You can also set the horizontal spacing between components and the vertical spacing between rows 122 Chapter 6 Designing Visual Classes with the Form Editor Grid Layout The Grid Layout divides its container into a configurable number of rows and columns Like the Flow Layout components ate added to the grid from left to right and top to bottom But unlike Flow Layout the dimensions of the grid are fixed individual components can not have different sizes Card Layout You can think of a Card Layout as a deck of cards During run time only one component the top card is visible at a time and each component card is the same size In design time in the Form Editor the Card Layout is displayed as a JTabbedPane to make it easier to design the form This enables you to switch between cards
331. watch for example mywatch Checking Suspend Debugging suspends the debugging session all threads when the breakpoint is reached You can also set these options and later change them in the property sheet for the breakpoint in the Debugger Window To remove a breakpoint 1 Position the insertion point on the line in the Editor window where the breakpoint has been set 2 Choose Debug Add Remove Breakpoint from the Main Window or use the keyboard shortcut CTRL F8 Breakpoints can also be removed directly from the Debugger Window by right clicking on a listed breakpoint and choosing Delete from the contextual menu ot by selecting the breakpoint and pressing DELETE on the keyboard Threads The Threads tab displays all thread groups in the current debugging process These thread groups are expandable hierarchies each group containing other thread groups or single 60 Chapter 3 Developing Java Applications threads which in turn contain CallStack and Locals nodes zal Debugger Window Threads Beis D esten HEADE 9 bar nan Q Thread 0 suspended at breakpoint Ty CallStack Locals examples advanced Memo Q Es examples advanced Memory view main Ei cana Line Numb calistack setis dad e examples advanced MemoryView m Stack Depth bg Locals Suspended Q args java lang String Ljava la Signal dispatcher running Reference Handler cond waiting amp Finaliz
332. which represents a specific configuration including the path to Java and arguments of an execution category There can be multiple executors for a given execution category though the IDE comes with only one for most categories See Adding and modifying service types on page 204 for more information To switch an object s executor 1 Select the object under the Filesystems tab in the Explorer 2 Go to the object s property sheet if it is not already open choose View Properties from the main menu and click on the Execution tab 3 Rotate through the executors by double clicking on Executor or click on the 54 Chapter 3 Developing Java Applications Executor property s value and choose from the pull down menu bI Properties Window Multiple Objects BEE Arguments Debugger Standard Debugging Internal Execution Applet Execution JSP Execution do not execute Tip To switch executors for multiple classes simultaneously select the classes while holding down the CTRL key and then switch the executor on the property sheet Explorer Filesystems L OL x Q Gi tutorial Q G clock A parti G part2 Q C part3 E ClockFrame class ClockFrame E ClockFrame JFrame Q GF colorpicker E ColorPicker E ColorPreview Cy ColorPreview e ColorPreviewBeanlnfo Q F imageviewer B ImageFrame E Imageviewer 3 Filesystems GE Switching the default executor It is poss
333. will appear in the property sheet pane If the Is Container property is set to True you can use the component in your forms as a container When you select such a component from the Component Palette the Form Editor will assign the component a layout manager and you will be able to add other components to it Howevet if the JavaBeans component you have created contains sub components these sub components will not be recognized by the Form Editor In addition the container and layout manager code that the Form Editor generates could conflict with the original placement of your components To keep the Form Editor from creating container code which could conflict with your sub components you can set Is Container to False Even though the Form Editor will not recognize the sub components they will not be listed in the Component Inspector they 108 Chapter 5 Developing and Customizing JavaBeans Components will appear in the Form Editor window and should work correctly in your program Adding JavaBeans from a JAR or local directory You can also add beans from a JAR archive or from a local directory To add a bean from a JAR archive 1 Either Choose Tools Add JAR from the main menu e Right click the Filesystems node under the Filesystems tab in the Explorer and choose Add JAR from the contextual menu Open the Project Settings window right click on the Filesystems Settings node and choose New Jar Archive 2 S
334. with a list of possible packages Select one and press Mount The package you select will determine which directory will be mounted in the Explorer The file will then be opened and the proper directory will be mounted If you are opening a Java source file the IDE tries to determine the correct directory to mount by looking through the source file and trying to find a package declaration For example if you are opening C mysources com mycom MyClass java and this file T Chapter 4 The Explorer and Object Browser begins with the declaration package com mycom then C mysources will be selected as the default If there is no package declaration the directory directly containing the source file will be the default to mount You can override the default but be sure that you choose the right mount point If you do not choose the cotrect mount point you will not be able to wotk with the file your package declaration will be invalid you will not be able to compile or execute the source debugging will not work and so on When opening other types of files such as GIF images HTML or resource property files that do not have package declarations you must be sure to mount the correct directory look at the bottom of the dialog box to see what package will be used for the file The choice will affect any Java sources that ate in the same mounted directory If you ate using classloader based resource loading that is based on an abs
335. x C Main Window Menus and Toolbars Execute Project execute the project Debug Project start the Debugger on the main class of the project Import Project import a project developed in another IDE Settings open the Project Settings window Build Menu e Compile compile selected object If a folder is selected compile all sources in that folder that are uncompiled or have been modified since the last compilation e Compile All recursively compile compile all uncompiled or out of date files in a folder and all its sub folders Build force compilation of all classes whether current or not Build All recursively build build a folder and all its subfolders e Clean delete all class files in the selected package Clean All recursively delete all class files in the selected package and its sub packages Stop Compilation stop the current compilation process Next Error jump to the next error in the Output Window e Previous Error jump to the previous error in the Output Window Set Arguments set command line arguments to be passed to an executed application May also be set in the Arguments property under the Execution tab of the property sheet of the class e Execute execute the selected object Debug Menu Start Debugging initiate a debugging session and run the program e Continue resume a debugging session that has been halted
336. xecution Window Explore From Here Open a new instance of the Explorer with the selected node as the root Explorer Window Open a new instance of the Explorer Global Properties Open a Property Sheet window to display the property sheet for any subsequently selected object Next Workspace Switch to the next workspace Object Browser Open the Object Browser OutputWindow Open a new instance of the Output Window Previous Workspace Switch to the previous workspace Properties Open the property sheet in a separate window for the selected object Status Line Install the IDE s status line available only for toolbars Web Browser Window Open a new instance of the Web Browser win dow Workspaces List and switch Workspaces Table 71 Window Actions Action Description Clone View Clone the current view Dock Into Dock the current window into a separate window or into a multi tab window Next Tab Switch to the next tab in a multi tab window Opened Windows List opened windows in the Windows menu available only for menus 286 Appendix E Actions Action Description PreviousTab Switch to the previous tab in a multi tab window Undock Window Undock the current tab from the MultiWindow 287 Appendix F Custom Property Editors The following property editors are available both for modifying prope
337. xt ALT b Scroll the text down so that the insertion point moves to the bottom of the window while remaining at the same point in the text SHIFT ALT t Move the insertion point to the top of the window 235 Appendix A Default Keyboard Shortcuts Press To SHIFT ALT m Move the insertion point to the middle of the window SHIFT ALT b Move the insertion point to the bottom of the window Table 19 Jump list shortcuts Press To ALT k Go to previous entry in the jump list ALTI Go to next entry in the jump list SHIFT ALT k Go to the previous jump list entry not in the same file SHIFT ALT 1 Go to the next jump list entry not in the same file Table 20 Miscellaneous navigation shortcuts Press To F2 Go to next bookmark CTRL F2 Toggle bookmark CTRL b Find matching bracket CTRL SHIFT b Select block between current bracket and matching one Table 21 Find shortcuts Keyboard With no selected y With selected text shortcut text CTRL f Show Find dialog Show Find dialog and show selected text as the text to find CTRL r Show Replace dialog Show Replace dialog and show selected text as the text to find F3 Search fot the next occur rence SHIFT F3 Search for the previous occurrence 236 Appendix A Default Keyboard Shortcuts Keyboard With no selected y With selected text shortcu
338. y To generate Javadoc documentation 1 Select the packages and or source files for which you would like to create documentation in the Explorer under the Filesystems tab or in the Object Browser 2 Right click on the object s node and choose Tools Generate Javadoc from the contextual menu A dialog box will appear asking you to name the directory where you want the Javadoc documentation generated Once you enter a directory another dialog box will appear and ask you whether to open the generated documentation in the internal web browser By default the generated Javadoc documentation will be stored in the directory javadoc in the IDE s home directory Since this is mounted under the Javadoc tab by default you can later search its contents using the Javadoc Index Search See Searching in Javadoc directories on page 170 Javadoc properties You can set options for both Javadoc and the standard doclet to modify the way the documentation is created Note Doclets are programs you can use within Javadoc to customize the Javadoc output 175 Chapter 10 Searching and Creating Javadoc Documentation Forte for Java uses the Javadoc standard doclet To view or change Javadoc and standard doclet options 1 Choose Tools Global Options from the main menu to open the Global Options window 2 Select the Internal Javadoc otStandard Doclet node The property sheet for the selected node will appear in the right pane of
339. y a window with the file s status information e Log display a window with the file s log information Check Out Revision cvs checkout r revision number use this command to extract any desired revision from the CVS repository into your working directory A dialog box with available revisions is displayed Update Revision cvs update r revision number use this command to update your file in the working directory with any desired revision from the CVS repository A dialog box with available revisions 1s displayed e Commit To Branch cvs commit r branch number use this command to commit your file to a specific branch A dialog box with available branches is displayed Merge With Branch cvs update j branch number use this command to merge your changes with a desired branch A dialog box with available branches is displayed e Remove Sticky Tag cvs update A use this command to remove any sticky tag which is associated with your file after update of a given revision This also updates your file with the head revision E Add Tag cvs tag b r RevisionNumberotcvs rtag b r RevisionNumber use this command to add a symbolic tag to your file You may specify a desired revision numbet View Branches display a window with a revision tree You may select any two revision numbers and compare their differences Select the first revision to compare with the left mouse button and select the second with the ri
340. y of executor such as External Execution Internal Execution Applet Execution and JSP Execution and under these nodes are listed the executors themselves See Adding and modifying service types on page 204 for information on creating custom executors 179 Chapter 11 Configuring and customizing the IDE You can also access the custom property editor for executors from the property sheet of individual classes See Editing service types from the Filesystems tab in the Explorer on page 207 For Applet Execution you can modify the External Viewer property It is not possible to modify the Thread internal executors Debugger Types Just as with Execution Types you can make custom configurations for debugger types the actual system command called when you debug an object including the path to Java the working directory and any arguments You can use the default debugger types of each category for example standard debugging or JPDA debugging modify the default debugger types ot write new ones You can then associate any of your classes to one of these debugger types if the default debugger type assigned for that class does not suit your needs You can also access the custom property editor for debugger types from the property sheet of individual classes See Setting the debugger on page 68 and Adding and modifying service types on page 204 for more information Compiler Types Here you can set specific c
341. y settings in the Update Center wizard 1 Choose Help Update Center from the main menu to start the Update Center wizard 2 In the first page of the wizard press the Configure Proxy button to bring up the Proxy Configuration dialog box 3 Click the Use Proxy checkbox to select it so that the IDE will use a proxy If you do not know them ask your system or network administrator 4 Fill in the Proxy Host and Proxy Port fields and press OK To specify the HTTP proxy settings in the Global Options window 1 Choose Tools Global Options from the main menu to open the Global Options window and select the System Settings node The property sheet for this node contains the settinps Proxy Host andProxy Port 2 Filin these settings for Proxy Host andProxy Port 3 SettheUse Proxy propetty to True To specify the HTTP proxy settings on the command line on a Windows machine 0 Gotothebin forte4j cfg file in the installation directory open it in a text editor and add the switch J Dhttp proxyHost HOST J Dhttp proxyPort NUM replacing HOST and NUM with your local settings To specify the HTTP proxy settings on the command line on a Solaris or Linux machine 0 Gotothebin forte4j sh file in the installation directory or the bin forte4j multiuser sh for multi user installations open it in a text editor and add the command line switch Dhttp proxyHost HOST Dhttp proxyPort NUM replacing HOST and NUM with your local set
342. yViewLocale texteditor Q GF tutorial G clock colorpicker imageviewer E readme Ji Filesystems Hl Properties Window class MemoryVi Mi E3 p Re ee n Javadoc Comment org openide src JavaDoc Class pwc Nene 74 Chapter 4 The Explorer and Object Browser There are four tabs in the Explorer Filesystems contains work objects e Projects shows the directories and files from Filesystems that you have added to the current project Runtime contains a list of currently running processes and debugger information Javadoc contains directories of API documentation in Javadoc format Filesystems The Filesystems tab is the most important segment of the IDE s Explorer It holds all the files that the IDE uses and all the files you create Filesystems gives a unified view of files of all different types You can access objects from different sources by mounting different file systems and JAR and ZIP archives in Filesystems File systems and the class path A file system represents a hierarchy of files and folders File systems can represent plain local files or the network drive depending on the operating system or ZIP or JAR archives Once mounted the file system transparently hides any differences between these sources Some default items are added to Filesystems when the IDE is launched However there are additional file systems used by the IDE that are mounted at

Download Pdf Manuals

image

Related Search

Related Contents

ECO Spot 35FC™ User Manual  Hitachi 51S700 Projection Television User Manual  Skil 7450 AA  EVH SPACE - Aircotech    Finance – Tesouraria de Igreja Manual de instruções.  Samsung BX2035 Vartotojo vadovas  phillips_pm 3375 - Micro Precision Calibration    

Copyright © All rights reserved.
Failed to retrieve file