Navigating Your Code and FDT's Workspace

From FDT Documentation

Revision as of 14:53, 14 October 2010 by Aklement (Talk | contribs)
Jump to: navigation, search
001 0005x.png

With all the ins and outs of an IDE like FDT, a developer can get lost in seemingly endless windows and views. It's important to know how to get around the application and make sure you stay in control of what you're looking at.

This walk through will demonstrate working with views and perspectives, then show off some of FDT's code navigation features.

There are numerous options, windows and keystrokes to remember. In case you forget a particular key binding, right click within the Editor and a popup will appear that will display the available navigation options as well as their keybinding Img preview.png.


Videoicon.png This tutorial has a video, check out the Videos page to watch it.


Contents

Perspectives

When working with Eclipse, the platform FDT is built upon, you develop in something called Perspectives. The perspective you are currently working in will determine which tools are available to you. As a Flash developer, you'll be primarily working within the Flash FDT Perspective. If you have purchased the Max version of FDT you will also have access to the Debug and Profiling Perspectives.

To view all available Perspectives, go to Window>Open Perspective>Other... Img preview.png. The Open Perspective window will appear and you'll see FDT in about the middle.

06 002.jpg

Another way to browse Perspectives is to click on the Open Perspective icon located at the top right of the window Img preview.png.

Right clicking on the perpective icon will provide a popup where you can customize the perspective as well as how the icons appear - e.g. showing the name of the perspective or not Img preview.png - and clicking on the icon perspective itself will switch to the selected perspective Img preview.png.

Flash FDT

06 026.gif

The Flash FDT Perspective Fdt perspective.gif is where you will spend most of your time. It's the default perspective and where you will be writing your code.

Debug

Debug perspective.png

Open the Debug Perspective Debug icon.gif by selecting it within the Open Perspective window Img preview.png. FDT will update the view with a new window layout, that you can change and save, as well as add the Debug icon to the list of perspectives on the top right Img preview.png. Check out Using FDT's Debugger for more information on how to use FDT's debugger.

Profiler

06 027.gif

FDT now includes a Profiler. The Profiler Perspective Profiler icon.gif is where developers can get detailed information about a .SWF that is currently running Img preview.png. Just like all other perspectives, windows can be dragged around and adjusted to your liking. Learn more about the profiler in the Intro To Profiling Applications tutorial.

Views

Views in FDT are panels that display some type of information. In this example Img preview.png, the views that are open are:

Opening, Closing and Minimizing Views

If you need to open a particular View, just go to Window>Show View Img preview.png. Views can also be closed Img preview.png or minimized Img preview.png. A view that has been minimized can be restored by clicking on the Restore button Img preview.png.

Organizing Views

Views can also be dragged and dropped. This allows you to customize the display of the currently active perspective. Grab the tab of a particular view and drag it around as you see fit. Here I'm dragging the FDT Welcome Screen Img preview.png to make a new Editor appear Img preview.png.

Editor

The Editor is not really a view, it's more like a text editor that will activate when a file is opened. Opening up the Main.as file and it will appear within the Editor Img preview.png.

An important note with the Editor is, it will only give you ActionScript error checking and other Smart Editor features when the file it has open is located within a Source Folder. If you were to disable the src folder in this example Img preview.png, the Editor will no longer have features such as code hinting Img preview.png.

Navigating Code

There are numerous FDT features that make moving around your code much easier and intuitive. Let's look at a few of them.

Quick Outline

With a file is active within the Editor, hit Cmd+O (OSX) or Ctrl+O (Win) to call up FDT's Quick Outline Img preview.png. The Quick Outline is a great way to navigate the currently active Class. When activated, begin typing the name of the method or property you'd like to jump to Img preview.png, and then use the arrow keys or mouse to select it Img preview.png, then hit enter to have FDT open it for you Img preview.png.

Open Type

Move the cursor over a variable Img preview.png and hit F4 and FDT will open the Class that the variable is associated with Img preview.png.

Type Hierarchy

Similar to the Quick Outline, the Type Hierarchy, Cmd+T (OSX) or Ctrl+T (Win), allows you to browse and select superclasses associated with the Class that is active in the Editor Img preview.png. Just like the Quick Outline, you can filter the results by typing with the text input at the top Img preview.png.

Show In Explorer

When you have a Class active in the Editor Img preview.png, hit F2 to have FDT locate and highlight the class for you within the Flash Explorer Img preview.png.

Type Dependency Outline

The Type Dependency Outline is works just like the Quick Outline and Type Hierarchy. Just hit Cmd+U (OSX) or Ctrl+U (Win) to bring it up Img preview.png.

Dependency Views

06 045.png

New with FDT 4 is the Type Dependencies view and Package Dependencies view. Access these views by going to the Show View window Img preview.png and going to FDT>Package Dependencies Img preview.png or FDT>Type Dependencies Img preview.png.

Type Dependency

This visualizer will display Classes (Objects) associated with the currently selected Class as well as their relationships. After opening the Type Dependencies view Img preview.png either double click on a Class within the Flash Explorer or activate a Class within the Editor. After doing so, the Type Dependencies view will analyze the selected Class and build a visualization - showing the currently selected Class in yellow Img preview.png.

Some Classes will have many dependencies and this can mean that the view can be come very cluttered. To help with this, the Type Dependency view is also interactive, allowing you to click and drag the icons around the screen. Here the icons have been arranged to show superclasses on the left and Classes that are used or referenced are on the right Img preview.png.

This can be taken even further by selecting one of the iconsImg preview.png and then double clicking on it to jump to that Class Img preview.png.

Clicking on the Back button will return you to the Class you just came from Img preview.png.

Lastly, you can have an alternative view of dependencies by togging the Show ancestors option Img preview.png. This will reorganize the view to include referenced .SWCs, packages and projects Img preview.png.

Package Dependency

Similar to the Type Dependency view, Package Dependencies will visualize referenced packages Img preview.png. To active click on a package within the Flash Explorer.

In this example the demo.powerflasher package contains a reference to the objects.display package Img preview.png. Contrast that to the demo.powerflasher package which does not have a reference to any other packages Img preview.png.

Get FDT5