Active 8 years ago. Viewed 5k times. DarenW DarenW Questions about development tools are off-topic here, but are on-topic on Stack Overflow. Add a comment. Active Oldest Votes. There are some other, less visible things to it such as key bindings. For instance, the standard debug perspective binds the standard debug stepping keys to editor windows and to the debug window, while the Java persective has them only in the debug window.
The idea is always to support a particular specific task, e. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. Clicking a perspective name switches to that perspective. This is quick and easy, and means that you do not need to have space taken on screen by irrelevant views at any time in the development process. Clicking the Open Perspective button the icon with the twinkle, opens a dialog box that enables you to choose from other perspectives that you might want to open.
You can always return a perspective to its default state by right-clicking the perspective button in the right top corner of the Eclipse IDE and clicking Reset.
Note that this operation cannot be undone. The visible resources in the second perspective are a subset of those in the first. Each perspective contains a set of views and editors which exist wholly within the perspective and are not shared with the other.
These parts define the presentation for a shared, underlying model. Information Filtering In a large, real world project the Eclipse Workspace may contain hundreds or thousands of resources. For instance, consider the following project in Eclipse.
It may be small, but this project represents a typical three tier B2C web application. Each folder represents a different tier in the application. The files types in each folder are also different. WebApplicationProject ClientSide index.
MiddleTier script1. DatabaseServer sqlScripts. The contents of this project are very typical of application development in the Internet age. No single language or technology can do it all, and software development involves the application of many technologies rather than just one.
An important tool for comprehension is information filtering. In other words, remove the irrelevant so you can see the relevant. In Eclipse this is performed in two ways, by using the inherent structure of the information the resource tree and the unstructured attributes of the information file name, nature, resource type, etc.
For this discussion only the first style of information filtering is relevant. In a large project the resources are usually structured within a hierarchy. The workspace contains many projects containing many folders containing many files.
It's a tree, and each subtree within the whole defines a physical subset of information. This idea is the basis for information filtering within the workbench. The user can open a perspective on any resource subtree within the workspace. In the resulting perspective only the children of the subtree root are visible. The subtree root is known as the input. For example, if you open a perspective on MiddleTier within the WebApplicationProject only the children of MiddleTier are visible within the resulting perspective.
Task Oriented Interaction with Your Information As a development platform Eclipse was designed to fulfill the needs of a large product development team, from product manager to content developer to product tester. It is fully extensible and may be configured with hundreds of action, wizard, view and editor extensions for any number of languages, tasks, roles, and phases within the development life cycle.
In other words, it may contain a lot of junk you'll never use. To avoid the visual overload and confusion which would occur if everything was visible in the UI some mechanism is required to filter the user interface. In Eclipse a task oriented approach was taken to filtering. Consider a Java developer. Within a single development cycle a Java developer may iterate through the following phases: Analysis and Design, Implementation, Debug, Testing and Documentation. In one phase the developer may use a UML modeling tool.
In another you use a Problem Reporting tool. The time spent in each phase will vary but rapid transition between phases may occur several times a day. If we say that each phase is a "task" then it is possible to say there is rapid transition between tasks. In addition, the preferred way to look at resources in the workspace will change with the active task.
In Eclipse task orientation is embodied by perspective type. A perspective determines the visible actions, views, and view layout within the window. There are many types of perspective, and each one defines the layout in a different way.
Ideally, the layout should be tailored to suit a particular set of related tasks. For instance, the standard Eclipse platform includes a Java perspective and a Team perspective. This is useful for java development. The Team perspective defines a layout containing the Repositories and Synchronize view. This is useful for code sharing and versioning. In Eclipse the user can open a new perspective with a particular type, switch from one perspective to another with different type, or change the type layout of an existing perspective as they move from one task to another.
Two is Always Better than One In an earlier section we saw how information filtering can be used to limit information overload. When information filtering is implemented a new need develops: the need to see information which is not visible.
For instance, a Java developer may explore one class hierarchy while they modify code in another. In Eclipse this functionality is provided by opening a second perspective on the information required. The ability to create two separate perspectives or more makes it possible to switch between information without loss of context. The ability to open more than one perspective is also crucial for multi-tasking support. Developers often multi-task without even knowing it.
For instance, in a team environment a coworker may walk into your office to ask a question. In response, you open up a class hierarchy and explore the code for a few minutes. This is a new task and it should have no impact upon your previous task. It demands good task separation. In Eclipse the creation of the second task can be accomplished by just opening a new perspective.
When the task is complete you can close the perspective and return to the old task without loss of context. Moving from Concept to Implementation At a conceptual level a perspective is quite simple. A perspective is a visual container for a set of views and editors. It has an input and type. At the implementation level things become more complex. The platform user interface is exposed through a series of interfaces in org.
The root of the user interface is accessed by invoking PlatformUI. This returns an object of type IWorkbench. A workbench has one or more windows of type IWorkbenchWindow. And each window has a collection of pages of type IWorkbenchPage. In the user interface a page is known as a "perspective". Within each window there is at most one active and visible page.
The structure of the workbench is exposed within the following diagram. The workbench window is outlined in red. Within this window there is a single open perspective. It's purple. But to be truly accurate, the user calls it a "perspective". At the implementation level it is an IWorkbenchPage. While the workbench is running new windows and pages can be created interactively by invoking Open Perspective from the window menu or from the Navigator context menu.
For instance, the following code demonstrates the creation of a new page. The perspective type is identified by a string. Each perspective has a unique id. In this case "org. The perspective input may be any object of type IAdaptable. In this case the input is the entire workspace. The openPage method creates and returns an object of type IWorkbenchPage.
Given a page, you can get the input and perspective type by using the following methods. When a new page is created you identify the perspective type by id. In the openPage method the id is mapped to a perspective descriptor within a list of known perspectives types and the result is stored within the return page.
This object has accessor methods for the perspective id, label and icon. The page input determines which resources are visible in the page. In practice, resource visibility in a page is implemented through collaboration between the page and the views within that page. The page itself is a visual container for views and editors. It doesn't provide any presentation for resources.
That is delegated to the parts within the page. The hand-off usually occurs during part creation. In the early stages of part life cycle a part can obtain a handle to the containing IWorkbenchPage and from this it may call getInput.
The result will be used as the initial input for this view. For instance, if a new perspective containing the Navigator is opened the Navigator will use the page input as its own input.
The Packages view does the same. In some cases the view may provide additional actions to dynamically change the view input. The perspective determines which views are visible in a page. For instance, if you open a new page with the Resource perspective the Navigator, Outline, and editor area will be visible.
If you open a new page with the Java perspective the Packages, Hierarchy, Tasks, and editor area will be visible.
0コメント