Difference between revisions of "Ide/Project Tree"

From wiki.visual-prolog.com

m
m
 
Line 1: Line 1:
{{ideNavbar|Project Window and Project Tree111}}
{{ideNavbar|Project Window and Project Tree}}


=== The Project Tree ===
=== The Project Tree ===

Latest revision as of 12:10, 11 September 2019

IDE

The Project Tree

The Project window is opened when you load a project into the IDE or create a new project.

The Project window provides the main view onto the loaded project. The Project window consists of two panes:

  • The Project Tree pane. It is the left pane. It displays the Project tree. In the Project tree you can see all modules included into the project.
  • The Browse Information pane. It is the right pane. It displays the Browse information from the file selected in the Project Tree pane. These are: names of interfaces, classes, predicates, and other Visual Prolog names declared/defined in this file.

In the Project tree you can see files that are registered in the project: object libraries (and type libraries), DLLs (Dynamically Linked Libraries), object files, resource description (descriptions of menus, dialogs, windows, forms, toolbars) and resource files (bitmaps, icons, cursors), the manifest file and Visual Prolog packages (*.pack).

The Project tree for a new not compiled GUI style project

After a package is compiled, the Project tree starts to show some additional information about the package files. You can see the package headers (*.ph) and Visual Prolog source files (interfaces - *.i, classes - *.cl, class implementations - *.pro).

And the Browse Information pane starts to display for each file:

  • Interfaces and classes that are declared in the file.
  • Classes that are implemented in the file.
  • Constructors, class predicates, object predicates, and local predicates that are declared and implemented in the file. Declarations and implementations are displayed with their arities.
  • Class and object facts that are defined in the file.
  • Domains and constants that are defined in the file.
  • Properties that are defined in the file. They are displayed with their flow patterns.
The Project tree - as you see it for a compiled project

Icons Used in the Project Window

The Project window uses the following icons to identify different kinds of items:

Icons Used in the Project Tree Pane

Icon Description
Project Directories
Ide PT Folder.png The Visual Prolog root directory. This is the root directory of your Visual Prolog system installation.
Ide PT Folder.png Project subdirectories
Project Source Files
Ide PT Gui.png Project file
Ide PT Package.png Package file
Ide PT ComPackage.png Vipcom Package file
Ide PT CFolder.png Project module file that is not a package or a type library. For example, object libraries *.lib
Ide PT SubModule.png A project include file. Such files are included into one or more project packages (modules)
Ide PT Manifest.png Manifest file
Project Resource Files
Ide PT Image.png Image (bitmap, cursor or icon) file
Ide PT Menu.png Menu description file
Ide PT Toolbar.png Toolbar description file
Ide PT Dialog.png Dialog description file
Ide PT Form.png Form description file
Ide PT Control.png IDE custom control description file
Ide PT Window.png Task window description file

Icons Used in the Browse Information Pane

Icon Description
Compilation Items
Ide PT Interface.png Interface definition
Ide PT Class.png Class declaration
Ide PT Class Impl.png Class implementation or a goal section
Constants, Domains, Predicates and Facts
Ide PT NetDisk.png Groups of constants, domains, predicates, facts or properties.
When you check ON the Group Members in the Browse Information pop-up menu, then it groups together all constants, domains, predicates, and facts (declared or defined in a file). This icon is displayed before each such group.
Ide PT Facts section.png facts sections. This icon is displayed before each named facts section. All unnamed facts sections in one compilation item are merged into one
Ide PT Constructor.png Public constructor
Ide PT Constructor local.png Private constructor
Ide PT Pred cl.png Public class predicate
Ide PT Pred loc.png Private class predicate
Ide PT Pred obj.png Public object predicate
Ide PT Pred locObj.png Private object predicate
Ide PT Domains cl.png Public domain
Ide PT Domains.png Private domain
Ide PT Constant cl.png Public constant
Ide PT Constant.png Private constant
Ide PT Facts.png Class fact or private class property
Ide PT Facts obj.png Object fact or private object property
Ide PT Property.png Public class property
Ide PT Property obj.png Public object property

Project Tree Properties

Using the File |New and the File | Add commands, you should register in the Project Tree pane all source modules that you wish to be used while project compiling and linking. Notice that Project Settings automatically registers here (during creation of a new project) standard libraries, which are referenced by build script symbols (see also Make facility), and PFC packages used in the project. Notice that if you delete some of PFC packages required for the project, then the IDE restores these packages using #requires directives.

Initially (before packages are compiled) only the Project Tree pane of the Project window displays the reduced view of the Project tree, which contains only names of registered modules, libraries, and resource files. The Browse Information pane of the Project window is initially empty.

After compilation of a package, the package "browse" information generated by the compiler (for the Source Code Browser) is used to display additional information about the package in both the Project Tree and Browse Information panes. The Project Tree pane starts to display names of all Prolog source files in the package (not only the package file). The Browse Information pane starts to display information about Prolog instances declared/defined in Prolog source files.

In the Project Tree pane. Double clicking (or pressing Enter) the name of a Prolog source file loads this file into the text editor (activates the corresponding text editor window if the file is already edited). Double clicking (or pressing Enter) the name of a resource description file opens this resource in the corresponding resource editor.

You can click (or press the right arrow) the plus Ide Plus Icon.png icon to expand this tree node. Click the mouse button (or press the left arrow) on a minus Ide Minus Icon.png icon to collapse the correspondent sub-tree, which is started from this node.

In the Browse Information pane. When a Prolog source file is selected in the Project Tree pane, then the Browse Information pane displays names of all declared interfaces and classes, implemented classes, supported interfaces, inherited classes, and all other Prolog instances declared/defined in a file. Usually each file contains only one interface or class declaration or only one class implementation.

Names of interfaces, classes, class implementations are prefixed with the plus Ide Plus Icon.png or minus Ide Minus Icon.png icons. Clicking a plus Ide Plus Icon.png or minus Ide Minus Icon.png icon (or pressing the right and left arrows) you expand (or collapse) the correspondent node.

Notice that the displayed view depends on the chosen Group Members mode in the pop-up menu. When it is checked ON, then the tree displays the program sections (predicates, facts, domains, constants, properties) prefixed with the Ide PT NetDisk.png icon, which is prefixed with the plus Ide Plus Icon.png or minus Ide Minus Icon.png icons.

Double-click any Prolog name (predicate, domain, constant, fact, class, etc.) loads the correspondent file into the text-editor (activates the correspondent editor window if the file is already edited) and positions the caret onto the declaration/definition of the selected name. Notice that predicate names are suffixed with the predicate arity and return value mark (->, if any).

Notice that icons prefixing class entities contain double colons, like this Ide PT Facts.png. Icons prefixing object entities contain single colons, like this Ide PT Facts obj.png.

Notice that icons prefixing public entities have colored background, like this Ide PT Pred obj.png. Icons prefixing private entities have white background, like this Ide PT Pred locObj.png.

Pop-up Menus

Depending on the type of the node selected in the Project window, clicking the right mouse button activates context pop-up menus.

Ide PT Folder.png Project Root Node or Folders

Ide PT Popup Folder.png

The menu contains:

  • New and Add items activate the File | New and File | Add commands correspondingly (giving you possibility to add new project items into the selected folder).
  • Remove From Project command deletes this folder from the project.
  • Explore command activates the standard Windows Explorer with this folder selected.
  • Build Directory command activates the Build | Build command, which compiles packages in the selected folder.
  • Rebuild Directory command activates the Build | Rebuild ALL command. This command deletes all object (and other intermediate) files generated from files in the selected folder and then compiles all packages in the selected folder.
  • Optimal Set of Include Directives command activates the check for the structure of included files in order to make it optimal. This feature allows to exclude not needed inclusion directives and / or to add the obligatory inclusion directives which will make the units all-sufficient.
  • View Unused Predicates command displays some information for public predicates which are not used in a project, duplicated domain and constant names, etc.

Project File

When you click the right mouse button on project file (*.vipprj), then the following pop-up menu appears:

Ide PT Popup Project.png

The menu contains:

  • Build command activates the Build | Build command, which compiles project.
  • Rebuild All command activates the Build | Rebuild ALL command. This command deletes all object (and other intermediate) files generated from files and then compiles all packages in the project.
  • Settings... item opens the Project Settings dialog.
  • Explore Containg Folder... item explores the folder for a file.
  • File Properties... item activates the standard Windows dialog 'SelectedFileName' Properties in which you can view/modify some Windows properties of the 'SelectedFileName' file.

Project Source Files and Package Header Files

When you click the right mouse button on Visual Prolog source files (containing interfaces - *.i, classes - *.cl, and class implementations - *.pro) of the project, or package header file (*.ph), then the following pop-up menu appears:

Ide PT Popup Source.png

This pop-up menu contains:

  • Compile Package item activates the Build | Compile command that compiles the package into which the selected file is included.
  • Open command activates the text editor for the selected file (or switches to the text editor window with this file if it is already edited).
  • Explore Containg Folder... item (it is described above).
  • File Properties... command (it is described above).

Packages

When you click the right mouse button on package files (*.pack), a pop-up menu appears:

Ide PT Popup Package.png

This pop-up menu contains:

  • New and Add commands activate the File | New and File | Add commands correspondingly (giving you possibility to add new project items into the selected folder).
  • Compile activates the Build | Compile command that compiles the selected package.
  • Open item (it is described above).
  • Remove From Project command deletes the selected package from the project.
  • Explore Containg Folder... item (it is described above).
  • File Properties... item (it is described above).

Resource Description Files

When you click the right mouse button on resource description files (dialogs - *.dlg, windows - *.win, forms - *.frm, menus - *.mnu, toolbars - *.tb, bitmaps - *.bmp, icons - *.ico, and cursors - *.cur), then the following pop-up menu appears:

Ide PT Popup Resource.png

This pop-up menu contains:

  • Attribute command activates the Attributes dialog for this resource.
  • Open command opens this resource for editing in the correspondent resource editor.
  • Remove From Project command deletes this resource from the project.
  • Explore Containg Folder... item (it is described above).
  • File Properties... item (it is described above).

Prolog Names

When you click the right mouse button on Visual Prolog names (interfaces, classes, class implementations, or names of predicates, facts, domains, and constants), the following pop-up menu that contains the following entries appears:

Ide PT Popup Prolog.png

  • Go to Declaration command opens the text editor, loads the selected file and jumps on this name declaration.
  • Go to Definition command opens the text editor, loads the selected file and jumps on this name definition.