KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > actions > SyncViewerShowPreferencesAction


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.actions;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.jface.preference.PreferencePage;
15 import org.eclipse.team.internal.ui.IHelpContextIds;
16 import org.eclipse.team.internal.ui.Utils;
17 import org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog;
18 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
19
20 public class SyncViewerShowPreferencesAction extends Action {
21     private final ISynchronizePageConfiguration configuration;
22     
23     public SyncViewerShowPreferencesAction(ISynchronizePageConfiguration configuration) {
24         this.configuration = configuration;
25         Utils.initAction(this, "action.syncViewPreferences."); //$NON-NLS-1$
26
}
27
28     public void run() {
29         PreferencePage[] pages = configuration.getParticipant().getPreferencePages();
30         PreferencePageContainerDialog dialog = new PreferencePageContainerDialog(configuration.getSite().getShell(), pages);
31         dialog.setHelpContextId(IHelpContextIds.SYNC_VIEW_PREFERENCE_DIALOG);
32         dialog.setBlockOnOpen(true);
33         dialog.open();
34     }
35 }
36
Popular Tags