KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > TeamSynchronizingPerspective


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.ui.synchronize;
12
13 import org.eclipse.team.ui.history.IHistoryView;
14 import org.eclipse.team.ui.synchronize.ISynchronizeView;
15 import org.eclipse.ui.*;
16
17 public class TeamSynchronizingPerspective implements IPerspectiveFactory {
18
19     public final static String JavaDoc ID = "org.eclipse.team.ui.TeamSynchronizingPerspective"; //$NON-NLS-1$
20

21     /* (Non-javadoc)
22      * Method declared on IPerpsectiveFactory
23      */

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

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

40         // Add "show views".
41
layout.addShowViewShortcut(ISynchronizeView.VIEW_ID);
42         layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
43         layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
44         layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
45         layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
46         
47         // Add "action sets"
48
layout.addActionSet("org.eclipse.team.ui.actionSet"); //$NON-NLS-1$
49

50         // Add "perspective short cuts"
51
layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$
52
}
53
54     /**
55      * Defines the initial layout for a page.
56      * @param layout the page layout
57      */

58     public void defineLayout(IPageLayout layout) {
59         String JavaDoc editorArea = layout.getEditorArea();
60         IFolderLayout top = layout.createFolder("top", IPageLayout.LEFT, 0.45f, editorArea); //$NON-NLS-1$
61
top.addView(ISynchronizeView.VIEW_ID);
62         IFolderLayout top2 = layout.createFolder("top2", IPageLayout.BOTTOM, 0.80f, editorArea); //$NON-NLS-1$
63
top2.addView(IHistoryView.VIEW_ID);
64         top2.addView(IPageLayout.ID_TASK_LIST);
65         top2.addView(IPageLayout.ID_PROBLEM_VIEW);
66         layout.setEditorAreaVisible(true);
67     }
68 }
69
Popular Tags