Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9e35c6ad1d51ec157300223444bda16018034f42 (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
/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.ui.synchronize.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantReference;
import org.eclipse.team.ui.synchronize.ISynchronizeView;

public class ShowSynchronizeParticipantAction extends Action {
	
	private ISynchronizeParticipantReference fPage;
	private ISynchronizeView fView;
	
	public void run() {
		if (!fPage.equals(fView.getParticipant())) {
			fView.display(fPage);
		}
	}
	
	/**
	 * Constructs an action to display the given synchronize participant in the
	 * synchronize view.
	 * 
	 * @param view the synchronize view in which the given page is contained
	 * @param participant the participant to show
	 */
	public ShowSynchronizeParticipantAction(ISynchronizeView view, ISynchronizeParticipantReference ref) {
		super(ref.getDescriptor().getName(), Action.AS_RADIO_BUTTON);
		fPage = ref;
		fView = view;
		setImageDescriptor(ref.getDescriptor().getImageDescriptor());
	}
}

Back to the top