1734
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
package com.nokia.carbide.internal.discovery.ui.view;
|
|
18 |
|
|
19 |
import java.util.ArrayList;
|
|
20 |
import java.util.List;
|
|
21 |
|
|
22 |
import org.eclipse.jface.action.IAction;
|
|
23 |
import org.eclipse.ui.IEditorPart;
|
|
24 |
|
|
25 |
import com.nokia.carbide.discovery.ui.Messages;
|
|
26 |
import com.nokia.carbide.internal.discovery.ui.extension.IActionBar;
|
|
27 |
import com.nokia.carbide.internal.discovery.ui.extension.IActionUIUpdater;
|
|
28 |
import com.nokia.carbide.internal.discovery.ui.extension.ICommandBarFactory;
|
|
29 |
import com.nokia.carbide.internal.discovery.ui.extension.OpenPreferencePageAction;
|
|
30 |
|
|
31 |
public class SettingsBarCreator implements ICommandBarFactory {
|
|
32 |
|
|
33 |
private class SettingsBar implements IActionBar {
|
|
34 |
@Override
|
|
35 |
public String getTitle() {
|
|
36 |
return Messages.SettingsBarCreator_Title;
|
|
37 |
}
|
|
38 |
|
|
39 |
@Override
|
|
40 |
public IAction[] getActions() {
|
|
41 |
List<IAction> actions = new ArrayList<IAction>();
|
|
42 |
actions.add(new OpenPreferencePageAction(
|
|
43 |
Messages.SettingsBarCreator_CapabilitiesActionLabel,
|
|
44 |
"org.eclipse.sdk.capabilities")); //$NON-NLS-1$
|
|
45 |
actions.add(new OpenPreferencePageAction(
|
|
46 |
Messages.SettingsBarCreator_CodeStyleActionLabel,
|
|
47 |
"org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage")); //$NON-NLS-1$
|
|
48 |
actions.add(new OpenPreferencePageAction(
|
|
49 |
Messages.SettingsBarCreator_KeyBindingsActionLabel,
|
|
50 |
"org.eclipse.ui.preferencePages.Keys")); //$NON-NLS-1$
|
|
51 |
actions.add(new OpenPreferencePageAction(
|
|
52 |
Messages.SettingsBarCreator_ProxiesActionLabel,
|
|
53 |
"org.eclipse.ui.net.NetPreferences")); //$NON-NLS-1$
|
|
54 |
return (IAction[]) actions.toArray(new IAction[actions.size()]);
|
|
55 |
}
|
|
56 |
|
|
57 |
@Override
|
|
58 |
public String[] getHighlightedActionIds() {
|
|
59 |
return null;
|
|
60 |
}
|
|
61 |
}
|
|
62 |
|
|
63 |
@Override
|
|
64 |
public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) {
|
|
65 |
return new IActionBar[] { new SettingsBar() };
|
|
66 |
}
|
|
67 |
|
|
68 |
} |