KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > CVSPerspective


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.ui;
12
13
14 import org.eclipse.team.internal.ccvs.ui.repo.RepositoriesView;
15 import org.eclipse.team.ui.history.IHistoryView;
16 import org.eclipse.team.ui.synchronize.ISynchronizeView;
17 import org.eclipse.ui.*;
18
19 public class CVSPerspective implements IPerspectiveFactory {
20     
21     public final static String JavaDoc ID = "org.eclipse.team.cvs.ui.cvsPerspective"; //$NON-NLS-1$
22

23     /* (Non-javadoc)
24      * Method declared on IPerpsectiveFactory
25      */

26     public void createInitialLayout(IPageLayout layout) {
27         defineActions(layout);
28         defineLayout(layout);
29     }
30
31     /**
32      * Defines the initial actions for a page.
33      */

34     public void defineActions(IPageLayout layout) {
35
36         // Add "new wizards".
37
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.project"); //$NON-NLS-1$
38
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
39
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
40

41         // Add "show views".
42
layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
43         layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
44         layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
45         layout.addShowViewShortcut(IHistoryView.VIEW_ID);
46         layout.addShowViewShortcut(RepositoriesView.VIEW_ID);
47         layout.addShowViewShortcut(ISynchronizeView.VIEW_ID);
48         
49         // Add "perspective short cut"
50
layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$
51
layout.addPerspectiveShortcut("org.eclipse.team.ui.TeamSynchronizingPerspective"); //$NON-NLS-1$
52
}
53
54     /**
55      * Defines the initial layout for a page.
56      */

57     public void defineLayout(IPageLayout layout) {
58         String JavaDoc editorArea = layout.getEditorArea();
59         IFolderLayout top =
60             layout.createFolder("top", IPageLayout.LEFT, 0.40f, editorArea); //$NON-NLS-1$
61
top.addView(RepositoriesView.VIEW_ID);
62         layout.addView(IHistoryView.VIEW_ID, IPageLayout.BOTTOM, 0.70f, editorArea);
63         layout.setEditorAreaVisible(true);
64     }
65 }
66
Popular Tags