|
FAQ |
||||||||
|
Home
Products Product Comparisons Features Screen Shots Downloads Updates Free Licenses Support FAQ Papers AJAX JSON Editors Java HTML Perl JSP JavaScript PHP VBScript Velocity XML |
How can I assign a hotkey to a script? Go to the tools tab (the one with pencil icon) in the workspace panel, find the script and then use the context menu (right mouse click) on the script. Then choose the Hotkey item. If you do not know the location of the script, first run the trace script in Tools/Misc and then run the command you would like to have a hotkey assigned to. If any scripts are executed they will be listed in the output panel. To turn the trace function off just run the trace script again. How can see the list of assigned hotkeys? Go to the tools tab (the one with pencil icon) in the workspace panel and run the listhotkeys scirpt in Tools/Misc. Can I use Mozilla for showing HTML documents that interact with the IDE? Not at this time and perhaps never. While IE and Mozilla both support JavaScript they do so with different engines which are not compatible. the IDE uses the same engine as IE which enables JavaScript in the browser to interact with the IDE. The common mechanism that allows the IDE to interact with IE is COM and it extends not only to JavaScript and C++ but also to almost everything supported by Microsoft including the Common Language Runtime (CLR) that underlies the .NET platform. While Mozilla does support its own version of COM it is not fully compatible with Microsoft's COM. One consequence of this is that if you use the Mozilla Preview to view a HTML file that interacts with the IDE, it will not be fully functional. Examples include documents in the @Documents/Ide/Help Topics folder. I'm trying to build my own Java package, but the compiler cannot find my classes. What's wrong? If you are using a project, then add the missing package to the project. Another option is to add the classpaths that you need using the standard or custom classpaths dialog. Still another option is to add the classpath to your CLASSPATH environment variable and turn on the option "use environment classpath" in JDK/Edit Options... dialog. You also need to be sure that your source files are in the proper directory. For example, Java expects the goo.java Java source file with a package statement of "package com.foo;" to be in "/com/foo/goo.java". Java also expects the class file to be at "/com/foo/goo.class". Is it possible to compile servlets in the IDE? Yes, just compile as you would any java class. If you are getting class not found then you will need add one or more classpaths. To add the classpaths use the browse button in the Standard Classpath or Custom Classpath dialog to select the jar or zip file containing the needed classes. For class files not in a jar or zip archive Java will find the files given a directory classpath. My applet runs just fine under the IDE but it does not run when I open my html page using a browser. What's wrong? Check the parameters for your applet or object tag. You may need to add a codebase parameter to your applet or object tag in your html file. Note that the applet tag is depreciated and you should use the object tag. For more information see Java Plug-in HTML How can I change MyProjects directory? Use the setMyProjectsDirectory script in Tools/Configuration. You will need to restart the IDE before the change fully takes effect. How do I set the initial directory for file dialogs in my Java application? The best solution is to set the user.dir property in java.lang.System to your initial directory before displaying any file dialogs. In Windows the default initial directory for standard file dialogs is the current directory. The runApplication and debugApplication scripts sets the current directory to the classpath of the class being run before executing the Java command line. You can also change the current directory for you application by using the Project/Set Runtime Directory... This command will then cause the current directory to be set to specified directory each time you run your application. How do I set the initial directory for file dialogs? There are several options that you can set in the View/Preferences... to control the initial directory. Briefly you can set options to use the directory of the active editor, the directory of the active project, the directory of the last file opened or the MyProjects directory. Also note that you can use the Named Directories tool in the Standard File dialog to quickly go to any of the named directories. Other options include the File/Open In menu, the Open Above context menu for editors and context menus in the workspace panels How do I use the column editing scripts? The column editing scripts are located in Tools/Misc. They include columnCopy, columnCut, columnPaste, and columnInsert. The first two scripts create a column of data with each line containing the data from the corresponding column. The columnPaste script replaces the selected column with the data in the clipboard using each line in the clipboard just once. The columnInsert replaces each column in the line with the same data (it will ask you for the data). To use these scripts you must first select a column. These scripts define a column as going from the starting character of the selection to the ending character of the selection. For example, to select all the '-' in front of the '0.' in the following code the selection starts just before the '-' and ends just after the '-'.
Is there any way that I can configure an editor as it is being opened? There are several ways that this can be done. The first is to edit the onConfigureEditor script located in @Tools/Eventhandlers/File. This is the catch all script that is called when a file is being opened. The default implementation shows how the onConfigureEditor can be used to configure an editor based upon the first few lines of a file. If you only want to configure an editor based upon a file type, then you can define onConfigureEditor script in the @Tools/Eventhandlers/<file> type folder. A third way is to define an $OnConfigureEditor.script in a folder that contains the files you wish to configure. For example, here is a script that will lock an editor and scroll to the end of the file every time a file is opened in that folder.
function OnNotify(editor)
{
if (editor)
{
editor.lock();
var scrollTo = editor.getLineCount() - 20;
if (scrollTo > 0)
{
editor.scrollTo(scrollTo);
}
}
}
How can I rename or move a file? You can use the File/Rename... menu command to both rename a file and to move a file from its current location to a new location. In the Rename dialog just edit the full path of the file. Changing the file name or type will move the file within the specified directory. Changing the path will move the file to the new path. Named directories can make it easier to move a file. You can also rename files using a script using the File.rename(oldpath, newpath) static method. See the Script Reference for details. How can I color syntax a non-html file type with the same color coding as an html file type? Create a copy of the onPrestartupHtmFiles located in Tools/Eventhandlers/Startup folder and name it onPrestartupZZZZFiles, where ZZZZ is your file type. Then edit onPrestartupZZZZFiles changing the "Htm" to "ZZZZ". Be sure you change the statement:
Application.createDocumentType("HTM file", "",
"htm (*.htm)", ".htm", "html", "html");
to
Application.createDocumentType("ZZZZ file", "",
"ZZZZ (*.ZZZZ)", ".ZZZZ", "html", "html");
Then save your onPrestartupZZZZFiles script and restart the IDE. You may also want to copy the files in Tools/Eventhandlers/htm file to Tools/Eventhandlers/ZZZZ file. See "Documents/Ide/How to/add a new document type" for details. How can I add support for creating a family of files or custom templates when I choose File/New? Add a new 'file type'. As an example, take a look at the Java Applet folder in Tools/Eventhandlers. When File/New/Java Applet is selected the onCreate script in the Java Applet folder is called which creates both a html test file and a Java applet file. The onCreate script can do almost anything from creating one or more files with a custom template to creating a family of files. To add a new menu item create an onPreStartupX script where X is the name of your item and include the following statement in the DoCommand function:
Application.addNewMenuDialogItem(
"X", "EventHandlers\\X\\onCreate.script");
Before you will see the file type in the File/New list you will also need to enable the new file type by turning it on in the View/Enable File Types. Note that you will need to restart the IDE before your changes take effect. I added a new onPreStartupX script to add new custom file type, but my new type is not shown in the File/New. How can I fix this? Go to the View/Enable File Types dialog and enable the file type. Note that you will need to restart the IDE before your changes take effect. Where can I find a Java winHelp files? You can find winHelp Java Documentation at http://www.javasoft.com/docs/windows_format.html. I have used the Hotkey... context command to assign a hot key, but when I use the hot key some other command runs. How can I fix this? It sounds like you may have assigned a hot key that is already in use. Try choosing a new hot key for this script. To see a list of hot keys assigned to other scripts run the listHotkeys script in @Tools/Misc. This script will list all hot keys assigned to scripts, but it does not include menu accelerators. How can I determine what was changed after installing an update? Run the installReport in Tools/Installer after installing an update. It will list all the changes for the last install. Can I use other compilers with JDK? Yes, use the script "replace JDK compiler" in Tools/Configuration and select your other compiler. You may also need to change your options for the compiler in the JDK/Edit Options... dialog. To enter options for your other compiler, just type them in next to the compiler. How can I add a custom option to the JDK compiler? Go to the JDK/Edit Options dialog and just type in the option in the edit box next to the javac line. Can I use the IDE both at work and at home? Yes, provided you are the only one using it. One copy of the IDE may either be used by a single person who uses the software personally on one or more computers, or installed on a single workstation used non-simultaneously by multiple people, but not both. You may access the IDE through a network, provided that you have obtained individual licenses for the software covering all workstations that will access the software through the network. For other licensing arrangements contact Modelworks Software. I had to reformat my hard drive and now the IDE is no longer licensed. How can I fix this? Just use your order number to re-register by going to help/register... If you do not know your order number use one of the free licenses How can I get a full version of the IDE? All Modelworks products are distributed only as evaluation/demo versions. To unlock the distributed versions you will need to register the IDE by going to help/register and entering your order number and email address. If you are still having problems please use one of the free licenses. How do I register the IDE? To register the IDE you will need to first install the IDE on your machine. Then start the IDE and go to the Help/Register... menu command. If you do not know your order number use one of the free licenses Next, enter your order number and your email address in the Register dialog. We recommend that you use the "Register Online" method since it will automatically install your license. If you use the "Register via Email" you will have to enter your license when you receive your JPad Pro License email. Can I add my own menus? Yes, scripts are assigned to a menu in two steps. First you need to create or get an existing menu and second you add menu items to that menu. Here is sample code to add a Project menu after the View menu:
var menu = newMenu("&Project", ".main", "&View"); // Create a new menu in the "Main" menu bar
menu.appendItem("Add Package...", // the menu name
"\\Project\\addPackage.script", // the script path relative to the Tools folder
"Create and add a top level package to the current project"); // The status help message
...
menu.drawMenuBar();
For examples, see the EventHandlers/onStartup script. NewMenu and getMenu
functions are defined in the Script/Host object and menu operations are defined
in the Script/Menu object. Note that there is a separate menu bar for each
document/file type. The second parameter of the newMenu or getMenu is used to
locate the appropriate menu. For example, to create a new menu in the Java menu
you would use the statement: Generally menus are added in the EventHandlers/onStartupX scripts, but menus can be added and removed by any script at any time. The shortcut mnemonics letters are NOT underlined in the menus. Is this a feature? Yes, this is a feature of Windows 2000. You can turn it off in Display properties, Effects tab. Deselect "Hide keyboard navigation indicators until I press Alt key" option. What is MINDS? MINDS stands for Modelworks INdex Document Search. MINDS consists of index files and a user interface in the workspace panel under the '?' tab. Subtabs are included for Documents, Content, Index, Search and Favorites views of help. The Documents view is a tree view of files included in the Documents folder. The Content view is a tree view of the contents of each index file. The Index view is a sorted list of keywords for the Active Subset. The Search view lets you search the Active Subset for matching keywords. The Favorites view lets you keep your own list of topics. Content sensitive help also uses MINDS. To use it select a keyword or place the caret in a keyword and hit F1. The javaContextHelp script located in Tools/Help can use either win help or MINDS. To use MINDS turn off the option "use win32 help" in the preferences dialog. A number of index files are available for download from http://www.modelworks.com. Index files for the IDE help are included in the standard distribution. Index files can be used to index JavaDocs, HTML and any text based document system including source files. You can build your own index files. Scripts are included in Tools/Help/Index Generation to assist you in building your own indexes. See the readMe in that folder for details. How can I use new index files? Index files must be put in the Documents folder before MINDS will find them and you must restart the IDE before they are processed. You may also need to set the document path to the location of the documents indexed by the index file using the View/Edit Help Paths. And you may also need to turn off the "Use win32 Help" option in the View/Preferences dialog. Can I build my own index files? Yes, you can build MINDS indexes for your own JavaDocs. See Tools/Help/Index Generation/_readMe for details. Is it possible to have the MINDS index use local documentation? Yes. Just go to View/Edit Help Paths... and change the URL to point to your local copy. Be sure to select the correct folder on your disk. For example the Java indexes must point to the docs/api folder. How do I create an output tab? Just use the statement getOuput("
var gOutput = getOutput("MyTool");
function DoCommand()
{
//...
gOutput.writeLine(results);
}
I have lost the workspace panel. How can I get it back? You can reset your toolbars and panels by deleting your the IDE.ini, the IDE.bin, the IDEtoolbarstates.map, and the windowlist.map files in your IDE/Data folder. Deleting these files will set your toolbars and panels back to their initial state. If you have the Help/Repair menu command you can do the same thing by choosing the Reset Panels command (this command is only available on newer releases). How do I run a script? You have several choices. First, open the tools tab in the workspace (the tools tab is the one with a pencil icon). Then open the folders in the tree view until you see the script that you want to run. Then double click on the script to run it. You can also use the context menu by doing a right mouse down on the script and then selecting run or run batch. The Run command will run the script in the current thread. This means that you will have limited interaction with the IDE while the script is running which is OK for most editing scripts. The Run Batch command runs the script in a separate thread that allows you to continue interacting with the IDE while the script is running. The Run Batch command also activates the red X so that you can kill the script. If you plan on using the script often you may want to assign a hot key to run the script using the Hot key... menu item in the context menu. You can also assign the script to a tool button or to a menu. What's the difference between "Run" and "Run Batch" commands for scripts? The Run command will run the script in the current thread. This means that you will have limited interaction with the IDE while the script is running. If the script object already exists in memory, then the Run command just requires calling the DoCommand function. If the script object does not exist in memory or is out of date, calling the Run command requires reparsing the script. Note: A script without a DoCommand function is always removed from memory after running it. This means that for efficient execution, scripts should have a DoCommand function. Also note that the process of parsing a script automatically evaluates the global statements. This means that the global statements are evaluated only once, while the DoCommand function can be called many times. The Run Batch command runs the script in a separate thread that lets you continue to interact with the IDE while the script is running. The Run batch command always parses the script each time it is run. This means that it is less efficient for simple operations than the Run command. The Run Batch command also activates the red X so that you can kill the script. Also note that some scripts run tools by setting the tool.async property to true. This is similar to using the Run Batch command in that the tool.run{} command will return before the tool has completed. Using the tool.async property also causes the tool.run() command to activate the stop button so that you can kill the process. When I try to run an application in a Console Window no MSDOS window appears and nothing happens. It looks as if command.com is not being run before attempting to run java.exe with the .class file. How can I fix this? When tool.showCommandWindow is true, the IDE uses the "comspec" environment variable to find the program to run to show a console window. If the comspec environment variable is not defined then "command.com" is used on Windows 95 and 98 and "cmd.exe" is used on NT and Windows 2000. You can fix this by setting the comspec environment variable. In Windows 9x or windows ME you will need to edit your autoexec.bat file to set the path of your console program. In Windows 2000 or later you will need to run the System applet located in your Control Panel. Then click on the Advanced tab and then choose Environment Variables to set the comspec variable. What are scripts? The IDE uses scripts for writing most tools. All the scripts provided with the IDE are written in JavaScript. The current implementation of the IDE uses Microsoft's ActiveXScript engine for the core JavaScript capability. In addition the IDE exposes over 50 script objects with over 600 methods. See the Script Reference in the Documents tab. Insert scripts for all the properties and methods are included in the Tools/Script folder which can also be used as a quick reference. To see example scripts try opening some of the scripts in Tools/Examples or Tools/Misc tab. To open a script in the editor use the context menu and choose "Open". I have a script that is entering a endless or very long loop. Is there any way short of killing the IDE or rebooting my machine to stop the script? Yes, run the script using the Run Batch command found in the context menu. This command will start a new copy of the script in a new thread that can then be killed by using the stop command (the red X) on the toolbar. If you are adding the script to a user interface element (e.g., menu, button) then set the async parameter to true to causes the script to be run in a new thread. I just made a change in a script and now I'm getting a flood of error messages in the output window. What is going on? Any script that is linked to a user interface command (e.g., menu, button) is checked for a DoUpdate() function every time the the IDE needs to update the state of the user interface item. If there is a syntax error in the script source you will get an error message report every time the script is parsed and since the parsing is failing you will get the flood of error messages (usually when you move the mouse). If the flood of error messages occurs as the IDE is starting - because the script with the syntax error is in one of the user interface items installed during startup - then quit and restart the IDE while holding the control key down until the startup process is complete. This will prevent the startup scripts from running and let you correct the error. I just made a change in a script and it does not appear that the change is taking effect. What is going on? There are several possible sources for this problem:
If none of the above solutions works then quit the IDE and restart. How do I use smart complete? To use smart complete in a Java, C#, Script or HTML based files just type ctrl+space. You should then see a popup list containing the matching members. If you do not see a popup list and do not see any message indicating an error in the output panel, first check View/Preferences... and make sure Smart Key Active is turned on. You should also make sure that the Smart Complete keys are active in View/Smart Keys... If you see a message indicating a syntax error, then you will need to correct it before you can use smart complete (in most cases the parser will ignore syntax errors). What is a sourcepath? A sourcepath is like a classpath except that it is a path that points to Java source files. It is used by some JDK tools and by the visual debugger. How can I start the IDE using command line parameters? One way is to create a shortcut to the exe and then add the command line parameters to the shortcut's command line (to get to the shortcut's command line use the context menu). For example, to run the IDE with the /nominds option add /nominds after the file name. Then to run the exe just double click on the shortcut. Another way is to add the command line options using explorer's File Types dialog for that file type and operation. You can even add a new operation and then use explorer's context menu to select it. In this case you should add the option in quotes and be sure to have a %1 so that the file path will be passed on the command line. For example, to open a file with the /nominds option you would add "/nominds %1" including the quotes. How come Windows XP takes so long to search for a file? Windows XP search is slow because it searches compressed files. To turn this feature off Type regsvr32 /u zipfldr.dll in the run box for zips and regsvr32 /u cabview.dll for cabs. These commands will unregister the dlls that are used to search through the archives. These searches can be enabled again by removing the /u from the command. Do I need set the CLASSPATH environment variable in order to use Java tools in the IDE? No. The default behavior of the IDE is to use a command line parameter to pass information to most tools. The classpath arguments are determined using the the project, the standard classpaths and custom classpaths. If you do want the IDE to use the environment CLASSPATH turn on the option "Use environment classpath" in JDK/Edit Options... What is the difference between the standard and custom classpaths? The standard classpaths are for classpaths that are used by multiple projects. The custom classpaths are saved with projects. Another difference is that standard classpaths are added to the classpath before the custom classpaths are added. How can I run an exe program from the IDE? The easy way is to use the Command Line toolbar (see View/Toolbars...) You can also write a script to run the exe. You can use either the Tool object or the Process object. Here is a simple code fragment using the Tool object:
var commandLine = "
Do a search for "newTool" or "newProcess" in the @Tools folder in script files for examples. I entered the classname in the Run Application dialog, but it does not run. What's wrong? The Run Application and Debug Application scripts expect a full path to the class file you are going to run. Use the browse button to select your classfile and try again. If you want to just enter a classname use Run Class or Debug Class and be sure to set up the classpath correctly in your environment. How can I add command line options that are not supported by the IDE like "-target" and all the -X* options? You can add any option by just typing it in on the line next to the tool in the Edit Options... dialog. How can I improve the time it takes to compile a java program? Do you have sufficient free disk space on your C drive for the virtual memory swap file? If you have less than 1 GB free space try cleaning up your drive. Also make sure you have the 'Use command file when compiling" option on in JDK/Edit Options... You may also want to try IBM's Jikes compiler. Use the replace JDK compiler in Tools/Configuration to use Jikes rather than javac. How can I wrap text? To wrap text in the editor use the Word Wrap command in the Edit/Special Menu (Ctrl+Shift+A). This command will adjust all lines in a selection so that no line is longer than a specified column position (excepting very long words). To use the command just select the lines you want to wrap and then choose the command. The starting and ending character positions do not matter. Only the starting and ending line numbers are included in the operation. Blocks are delimited by empty lines. This lets you select more than one block or even an entire file if you separate text blocks with empty lines. To word wrap a single line just make sure the caret is in the line. This lets you type a very long line and then wrap it when you are finished typing the line. The default maximum line length is 80. To change the default line length edit the wordWrap script located in the @Tools/Misc folder. |
||||||||
|