1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 559674: Migrating from a ILanguageSettingsProvider implementation to IIndexerInfoConsumer (6/6)

Move preference page to new UI plugin.

This is piece six of change https://git.eclipse.org/r/c/159828 being split into pieces.
Splitting is done for code reviewing reasons.

Change-Id: I9db0f3053ef9524a5b79a0fc9b8198ff241acb1a
Signed-off-by: Martin Weber <fifteenknots505@gmail.com>
This commit is contained in:
Martin Weber 2020-05-07 22:11:56 +02:00 committed by Alexander Fedorov
parent e9d6747a74
commit d13343cda9
11 changed files with 106 additions and 110 deletions

View file

@ -151,6 +151,7 @@ org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
org.eclipse.jdt.core.formatter.align_with_spaces=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@ -159,20 +160,27 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@ -182,7 +190,9 @@ org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
@ -191,6 +201,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
@ -209,15 +220,17 @@ org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
@ -264,11 +277,15 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@ -295,10 +312,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declar
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@ -323,13 +344,20 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@ -373,10 +401,13 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_decla
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@ -413,9 +444,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@ -427,17 +461,33 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_decla
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.lineSplit=120
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
@ -452,12 +502,20 @@ org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.text_block_indentation=0
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error

View file

@ -61,7 +61,7 @@ cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_CDT
formatter_settings_version=14
formatter_settings_version=18
internal.default.compliance=user
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true

View file

@ -3,11 +3,11 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.cdt.cmake.is.core.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui
Automatic-Module-Name: org.eclipse.cdt.cmake.is.core.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin
Export-Package: org.eclipse.cdt.cmake.is.core.ui;x-friends:="org.eclipse.cdt.cmake.is.core"
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.cdt.cmake.is.core;bundle-version="1.0.0",
org.eclipse.e4.ui.model.workbench;bundle-version="2.1.700.v20191222-1048"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.cdt.cmake.is.core.ui
Bundle-ActivationPolicy: lazy

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
@ -11,11 +10,5 @@
name="%page.name">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.eclipse.cdt.cmake.is.core.ui.internal.PreferenceInitializer">
</initializer>
</extension>
</plugin>

View file

@ -1,53 +0,0 @@
/*******************************************************************************
* Copyright (c) 2020 Martin Weber.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.cmake.is.core.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public final class CMakeISPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.cdt.cmake.is.core.ui"; //$NON-NLS-1$
// The shared instance
private static CMakeISPlugin plugin;
/**
* The constructor
*/
public CMakeISPlugin() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static CMakeISPlugin getDefault() {
return plugin;
}
}

View file

@ -13,16 +13,15 @@ package org.eclipse.cdt.cmake.is.core.ui.internal;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin;
import org.eclipse.cdt.cmake.is.core.ui.PreferenceConstants;
import org.eclipse.cdt.cmake.is.core.language.settings.providers.PreferenceConstants;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
@ -45,8 +44,6 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
private Button btnWithConsole;
public IndexerSupportPreferencePage() {
super();
setPreferenceStore(CMakeISPlugin.getDefault().getPreferenceStore());
setDescription("Configure how macros and include paths get extracted from the compile_commands.json file");
}
@ -57,6 +54,7 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
*/
@Override
protected Control createContents(Composite parent) {
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("org.eclipse.cdt.cmake.is.core"); //$NON-NLS-1$
final Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
GridDataFactory.swtDefaults().applyTo(composite);
@ -64,8 +62,8 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
final Group gr = createGroup(composite, SWT.FILL, 1, "For compilers with version in name", 2);
btnVersionsEnabled = createCheckbox(gr, SWT.BEGINNING, 2, "&Also try with version suffix");
btnVersionsEnabled.setToolTipText("Can recognize gcc-12.9.2, clang++-7.5.4, ...");
IPreferenceStore preferenceStore = getPreferenceStore();
btnVersionsEnabled.setSelection(preferenceStore.getBoolean(PreferenceConstants.P_PATTERN_ENABLED));
// TODO use OptionMetadata based implementation
btnVersionsEnabled.setSelection(preferences.getBoolean(PreferenceConstants.P_PATTERN_ENABLED, false));
{
Label label = new Label(gr, SWT.NONE);
label.setText("&Suffix pattern:");
@ -76,14 +74,8 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
GridDataFactory.defaultsFor(pattern).applyTo(pattern);
pattern.setToolTipText("Specify a Java regular expression pattern here");
pattern.setEnabled(btnVersionsEnabled.getSelection());
pattern.setText(preferenceStore.getString(PreferenceConstants.P_PATTERN));
pattern.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
final String text = ((Text) e.widget).getText();
// provider.setVersionPattern(text);
}
});
// TODO use OptionMetadata based implementation
pattern.setText(preferences.get(PreferenceConstants.P_PATTERN, "-?\\d+(\\.\\d+)*"));
pattern.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
@ -115,7 +107,8 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
btnWithConsole = createCheckbox(composite, SWT.BEGINNING, 1,
"&Show output of compiler built-in detection in a console in the Console View");
btnWithConsole.setSelection(preferenceStore.getBoolean(PreferenceConstants.P_WITH_CONSOLE));
// TODO use OptionMetadata based implementation
btnWithConsole.setSelection(preferences.getBoolean(PreferenceConstants.P_WITH_CONSOLE, false));
return composite;
}
@ -131,6 +124,8 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
@Override
protected void performDefaults() {
// TODO IEclipsePreferences preferenceStore = InstanceScope.INSTANCE.getNode("org.eclipse.cdt.cmake.is.core"); //$NON-NLS-1$
IPreferenceStore preferenceStore = getPreferenceStore();
btnVersionsEnabled.setSelection(preferenceStore.getDefaultBoolean(PreferenceConstants.P_PATTERN_ENABLED));
pattern.setText(preferenceStore.getDefaultString(PreferenceConstants.P_PATTERN));
@ -141,10 +136,11 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
@Override
public boolean performOk() {
IPreferenceStore preferenceStore = getPreferenceStore();
preferenceStore.setValue(PreferenceConstants.P_PATTERN_ENABLED, btnVersionsEnabled.getSelection());
preferenceStore.setValue(PreferenceConstants.P_PATTERN, pattern.getText());
preferenceStore.setValue(PreferenceConstants.P_WITH_CONSOLE, btnWithConsole.getSelection());
// TODO IPreferenceStore preferenceStore = getPreferenceStore();
IEclipsePreferences preferenceStore = InstanceScope.INSTANCE.getNode("org.eclipse.cdt.cmake.is.core"); //$NON-NLS-1$
preferenceStore.putBoolean(PreferenceConstants.P_PATTERN_ENABLED, btnVersionsEnabled.getSelection());
preferenceStore.put(PreferenceConstants.P_PATTERN, pattern.getText());
preferenceStore.putBoolean(PreferenceConstants.P_WITH_CONSOLE, btnWithConsole.getSelection());
return true;
}

View file

@ -11,18 +11,14 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.cdt.cmake.is.core.internal.Plugin
Export-Package: org.eclipse.cdt.cmake.is.core;x-internal:=true;uses:="org.eclipse.core.runtime,org.eclipse.cdt.core.settings.model,org.eclipse.cdt.cmake.is.core.builtins",
org.eclipse.cdt.cmake.is.core.builtins;x-internal:=true;uses:="org.eclipse.cdt.core.settings.model"
org.eclipse.cdt.cmake.is.core.builtins;x-internal:=true;uses:="org.eclipse.cdt.core.settings.model",
org.eclipse.cdt.cmake.is.core.language.settings.providers;x-internal:=true
Require-Bundle: org.eclipse.ui.workbench;bundle-version="3.8.0",
org.eclipse.cdt.ui,
org.eclipse.osgi,
org.eclipse.core.resources;bundle-version="3.13.700",
org.eclipse.core.runtime;bundle-version="3.17.100",
org.eclipse.cdt.core,
org.eclipse.cdt.managedbuilder.core;bundle-version="8.7.400",
org.eclipse.swt;bundle-version="3.113.100",
org.eclipse.jface,
org.eclipse.osgi,
org.eclipse.core.resources;bundle-version="3.13.700",
org.eclipse.core.runtime;bundle-version="3.17.100",
org.eclipse.swt;bundle-version="3.113.100"
com.google.gson,
org.apache.commons.io;bundle-version="2.6.0"
Automatic-Module-Name: org.eclipse.cdt.cmake.is.core

View file

@ -10,4 +10,10 @@
id="org.eclipse.cdt.cmake.is.core.detectorConsole">
</CBuildConsole>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.eclipse.cdt.cmake.is.core.internal.PreferenceInitializer">
</initializer>
</extension>
</plugin>

View file

@ -8,10 +8,9 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.cmake.is.core.ui.internal;
package org.eclipse.cdt.cmake.is.core.internal;
import org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin;
import org.eclipse.cdt.cmake.is.core.ui.PreferenceConstants;
import org.eclipse.cdt.cmake.is.core.language.settings.providers.PreferenceConstants;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
@ -19,9 +18,11 @@ import org.eclipse.jface.preference.IPreferenceStore;
* Class used to initialize default preference values.
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
@Override
public void initializeDefaultPreferences() {
IPreferenceStore store = CMakeISPlugin.getDefault().getPreferenceStore();
IPreferenceStore store = Plugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_WITH_CONSOLE, false);
store.setDefault(PreferenceConstants.P_PATTERN_ENABLED, false);
store.setDefault(PreferenceConstants.P_PATTERN, "-?\\d+(\\.\\d+)*");
store.setDefault(PreferenceConstants.P_PATTERN, "-?\\d+(\\.\\d+)*"); //$NON-NLS-1$
}
}

View file

@ -42,7 +42,6 @@ import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.build.CBuildConfiguration;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;

View file

@ -8,7 +8,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.cdt.cmake.is.core.ui;
package org.eclipse.cdt.cmake.is.core.language.settings.providers;
/**
* Constant definitions for plug-in preferences
@ -16,9 +16,9 @@ package org.eclipse.cdt.cmake.is.core.ui;
public class PreferenceConstants {
/** preferences key for version suffix regex pattern */
public static final String P_PATTERN = "vPattern";
public static final String P_PATTERN = "vPattern"; //$NON-NLS-1$
/** preferences key for version suffix regex pattern enabled */
public static final String P_PATTERN_ENABLED = "vPatternEnabled";
public static final String P_PATTERN_ENABLED = "vPatternEnabled"; //$NON-NLS-1$
/** preferences key for built-ins detection output showing a console */
public static final String P_WITH_CONSOLE = "console";
public static final String P_WITH_CONSOLE = "console"; //$NON-NLS-1$
}