Source Explorer User Guide

Source Explorer is a tool for building tree-like document maps for documents in various grammars. Each tree node in the map represents a piece of the textual document. The parent-child relationships in the tree are choosen to facilitate understanding of the document and operations with its logically grouped sections. You can move and copy nodes by using drag'n'drop or cut'n'paste functionality. Source Explorer also contains experimental tools for refactoring and the Refactoring Editor which can be used to customize refactoring commands. Source Explorer is available as an addin, fully integrated into Visual Studio 2003 and 2005, or as a standalone application.

 

Archive Folders

The archive contains the following sub-folders:

2003 The application version that uses .NET Framework 1.1 and plugin for Visual Studio 2003
2005 The application version that uses .NET Framework 2.0 and plugin for Visual Studio 2005
Documentation User guide and help files
Grammars Grammars that the application supports
The following grammars are included into this version:
  • C#
  • Java
  • C++
  • VB.NET
  • XML
  • Transact SQL
RefactoringRules Simple Refactoring Rules
Refactoring commands are 100% user defined. Some pre-created refactoring rules are included in the archive.

Installation

Unpack the downloaded archive into any directory on your hard drive. We will assume in documentation examples, that the archive was unzipped into the folder C:\SE\ and refer to it as  <SE Installation Folder>

Installing standalone application

The standalone version of Source Explorer does not require installation.

If you have .NET Framework 2.0, just run <SE Installation Folder>\2005\app\AppLoader.exe

If you have .NET Framework 1.1, just run <SE Installation Folder>\2003\app\AppLoader.exe

Installing Visual Studio 2003 addin

1. Open the Visual Studio Command Prompt window. To do it, choose the menu

Start -> Microsoft Visual Studio .NET 2003 -> Visual Studio .NET Tools -> Visual Studio .NET 2003 Command Prompt.

2. From the command prompt change current directory to <SE Installation Folder>\2003\plugin

Example:
cd C:\SE\2003\plugin\

3. Run install.bat

Installing Visual Studio 2005 addin

1. Copy the file <SE Installation Folder>\2005\plugin\SourceExplorer.AddIn to My Documents\Visual Studio 2005\Addins.

Example:
copy C:\SE\2003\plugin\SourceExplorer.AddIn C:\Documents and Settings\<your profile name here>\My Documents\Visual Studio 2005\Addins

2. Modify the copied file so that the <Assembly> attribute contains the path to <SE Installation Folder>\2005\plugin\IvDev.SourceExplorerAddin.dll

Example:
<Assembly>C:\SE\2005\plugin\SourceExplorerAddin2005.dll</Assembly>

3. Run install2005.bat from the /2005/plugin/ folder.

Note: You should get the message that the types are registered successfully . If you do not get the message, regsvr32.exe is probably not in your command search path. In this case, open the Visual Studio Command Prompt window as described in the section Installing Visual Studio 2003 addin above and run install2005.bat from the command prompt.

Running Source Explorer Plugin from VS.NET

After you registered the plugin according to the installation instructions, you need to tell Visual Studio Environment to load it and add  the corresponding menu item. You only need to do it first time, after that you wil be able to open the SE window using the installed menu item or toolbar command.

 Go to the menu Tools->Add-in Manager and check the Source Explorer Addin as shown in the picture. Press OK to close the Add-in Manager window.

After you do it, a new menu item will be created at the top of the Tools menu, called "Source Explorer Window". Now you can choose this menu every time when you want to create a new SE window.

Please ensure that the path to the directory with grammars is set and correct. In order to do this please open a new SE window ( Tools-> Source Explorer Window) and open the Preferences dialog by clicking the "Preferences" button on the SE toolbar.

Ensure that the "Root File Location" points to the file "root.xml1". Example: C:\SE\2005\grammars\root.xml1

Ensure that the "Refactoring File Location" points to the file "refactoring.xml". Example: C:\SE\2005\grammars\refactoring.xml

To test that Source Explorer is installed and loaded correctly, open a CSharp, Java, or Xml document and press the "Process Current Document" button on the SE toolbar. You should get the tree for the current document.

Building Trees

After the Source Explorer window is open, you can construct representation tree for the currently open document by pressing the button "Process Current Document" on the SE toolbar. If you change the document from the VS.NET environment AFTER the tree was built and would like to synchronize the tree with the new version of the document, press the button "Refresh" on the toolbar.

Grammars are loaded dynamically when they are required. The grammar that will be used by SE is based on the extension of the open file. It is possible to edit the file "root1.xml1" to map a particular file extension to a particular grammar.



Manipulating Tree Nodes

 Once you have the tree, you can manipulate its nodes and the corresponding document content using the following operations:

When you perform node manipulation, the corresponding textual document content is also updated.

Insert Dialog

While performing node manipulation operations that involve node insertions, you will get node insertion dialog which will let you choose how to attach the node(s) to the target node: Above it, Below it, as its First Child, or as its Last Child.

When the Smart Drag option is checked in the dialog, Source Explorer attemtps to move/copy nodes while preserving text formatting.

Selecting multiple nodes

You can perform operations on one of multiple nodes at a time. To select multiple nodes hold down the Ctrl key while clicking on nodes that you want to add or remove from the selection. If you want to select a continuous range of nodes on a tree branch, click one node and hold down the Shift key while clicking on another node.

Warning: You can not select a node if one of its parent has already been selected.



Drag and Drop

You can drag and drop nodes within one SE Window or between different SE Windows.

 

Holding SHIFT down when nodes are dropped suppresses the Node Insertion dialog; by default, the nodes are inserted below the target node.

Holding CTRL down when nodes are dropped turns 'MOVE NODES' operation into 'COPY NODES' operation, i.e. nodes are not removed from their previous location.

Warning: If the tree is out of synch with the corresponding document, drag and drop is disabled. Press the "Refresh" button on the SEToolbar in order to rebuild the tree.

You can use the Search tab in the Source Explorer window to search for the specific document tokens.

In order to search, start typing into the textbox as shown in the picture. The list of matching nodes will appear below. Whenever you select a node in search results, it gets selected in the main tree and you navigate to the corresponding place in the document.

Check the Case Sensitive box below to include only exact matches in search results.

Traditional editing

After you modify the document from Visual Studio text window (i.e. without using tree node manipulations ), tree becomes out of date and tree editing operations will not work. Press the Refresh button on the Source Explorer window toolbar to bring the tree up to date with the attached document.

 
In case the document is closed in Visual Studio and re-opened again, SE will re-attach the existing trees for this document if any. If the document was modified outside the environment, SE will offer to either use the tree version and override the open document OR rebuild the tree.


Subtrees

If you right click a tree node and choose "Open Subtree in new window", a new SE Window will be open in which the selected node will be used as the root node. This tree is just a link to the original tree. All subtree operations will cause the corresponding changes in the original tree and , of course, the attached VS.NET document.



Intro to refactoring and adding refactoring commands ( experimental feature )

Refactoring commands are 100% user defined. However, some pre-created refactoring rules are already included in SE.
Choose the Refactoring submenu in the tree node context menu to view the list of refactoring commands available for the selected nodes.

 

If the particular refactoring operation you selected requires parameters, you will be presented with the Parameters dialog. 

It is possible to edit and create refactoring commands using the Refactoring Editor. To open this window, press the "Edit Refactoring Commands" button on the SE toolbar.

 
Working with the refactoring command editor is outside the scope of this document.


Grammar Editor

We create new grammars and establish tree parent-child relationships between different types of document tokens using our internal application called "Grammar Editor". If you would like to add your grammar to SE, please send a request to support@ivdevinc.com to contact our sales and consulting department.



The standalone version of Source Explorer

The standalone Source Explorer application works in the same way as Source Explorer plugin except the Visual Studio.NET does not have to be installed.

 
To edit the contents of the document in plain text form, use the Text tab in Source Explorer window. After you have finished changing the document text, press Refresh to make the tree up to date.

Source Explorer toolbar buttons


 



Tree keyboard shortcuts

Press 2, 3, or 4 on the keyboard to expand the corresponding number of levels of nodes under the currently selected node.



Please see http://www.ivdevinc.com and http://www.officialsourceexplorer.com for latest updates and downloads