Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0a2e0cbb010696c85902d6e389b1d83183cc2e6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*******************************************************************************
 * Copyright (c) 2007, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.rcp;

import org.eclipse.ui.*;

/**
 * Perspective which makes the standard provisioning views available.
 * 
 * @since 3.4
 * 
 */
public class ProvisioningRCPPerspective implements IPerspectiveFactory {

	private IPageLayout factory;
	private static final String METADATA_REPOSITORIES = "org.eclipse.p2.ui.admin.MetadataRepositoriesView"; //$NON-NLS-1$
	private static final String ARTIFACT_REPOSITORIES = "org.eclipse.p2.ui.admin.ArtifactRepositoriesView"; //$NON-NLS-1$
	private static final String PROFILES = "org.eclipse.p2.ui.admin.ProfilesView"; //$NON-NLS-1$

	public ProvisioningRCPPerspective() {
		super();
	}

	public void createInitialLayout(IPageLayout layout) {
		this.factory = layout;
		addViews();
	}

	private void addViews() {
		IFolderLayout top = factory.createFolder("top", //$NON-NLS-1$
				IPageLayout.TOP, 0.5f, factory.getEditorArea());
		top.addView(METADATA_REPOSITORIES);
		factory.getViewLayout(METADATA_REPOSITORIES).setCloseable(false);
		top.addView(ARTIFACT_REPOSITORIES);
		factory.getViewLayout(ARTIFACT_REPOSITORIES).setCloseable(false);
		factory.addView(PROFILES, IPageLayout.BOTTOM, 0.65f, "top"); //$NON-NLS-1$
		factory.getViewLayout(PROFILES).setCloseable(false);
		factory.setEditorAreaVisible(false);
	}
}

Back to the top