blob: 0c1258f4254a1e8e2b3fbee8d022131e85150c63 (
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
49
50
51
52
|
/*******************************************************************************
* Copyright (c) 2018 Manish Khurana , Nathan Ridge 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
*******************************************************************************/
package org.eclipse.lsp4e.cpp.language;
import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
/**
* This class represents the preference page for C/C++ Language Server.
*/
public class CPPLanguageServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private FileFieldEditor serverPath;
private RadioGroupFieldEditor serverChoice;
private StringFieldEditor serverOptions;
public CPPLanguageServerPreferencePage() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription(Messages.PreferencePageDescription);
}
@Override
public void createFieldEditors() {
serverChoice = new RadioGroupFieldEditor(PreferenceConstants.P_SERVER_CHOICE, Messages.ServerChoiceLabel, 1,
new String[][] { { "ClangD", CPPStreamConnectionProvider.CLANGD_ID }, //$NON-NLS-1$
{ "CQuery", CPPStreamConnectionProvider.CQUERY_ID } }, //$NON-NLS-1$
getFieldEditorParent());
addField(serverChoice);
serverPath = new FileFieldEditor(PreferenceConstants.P_SERVER_PATH, Messages.ServerPathLabel,
getFieldEditorParent());
addField(serverPath);
serverOptions = new StringFieldEditor(PreferenceConstants.P_SERVER_OPTIONS, Messages.ServerOptionsLabel,
getFieldEditorParent());
addField(serverOptions);
}
@Override
public void init(IWorkbench workbench) {
}
}
|