private void addInsertionSection(Composite composite) { addCompletionRadioButtons(composite); String label; label= PreferencesMessages.JavaEditorPreferencePage_insertSingleProposalsAutomatically; addCheckBox(composite, label, PREF_CODEASSIST_AUTOINSERT, trueFalse, 0); label= PreferencesMessages.JavaEditorPreferencePage_completePrefixes; addCheckBox(composite, label, PREF_CODEASSIST_PREFIX_COMPLETION, trueFalse, 0); label= PreferencesMessages.JavaEditorPreferencePage_automaticallyAddImportInsteadOfQualifiedName; Button master= addCheckBox(composite, label, PREF_CODEASSIST_ADDIMPORT, trueFalse, 0); label= PreferencesMessages.JavaEditorPreferencePage_suggestStaticImports; Button slave= addCheckBox(composite, label, PREF_CODEASSIST_SUGGEST_STATIC_IMPORTS, enabledDisabled, 20); createSelectionDependency(master, slave); label= PreferencesMessages.JavaEditorPreferencePage_fillArgumentNamesOnMethodCompletion; master= addCheckBox(composite, label, PREF_CODEASSIST_FILL_ARGUMENT_NAMES, trueFalse, 0); label= PreferencesMessages.JavaEditorPreferencePage_guessArgumentNamesOnMethodCompletion; slave= addCheckBox(composite, label, PREF_CODEASSIST_GUESS_METHOD_ARGUMENTS, trueFalse, 20); createSelectionDependency(master, slave); }
private void addAutoActivationSection(Composite composite) { String label; label= PreferencesMessages.JavaEditorPreferencePage_enableAutoActivation; final Button autoactivation= addCheckBox(composite, label, PREF_CODEASSIST_AUTOACTIVATION, trueFalse, 0); autoactivation.addSelectionListener(new SelectionAdapter(){ @Override public void widgetSelected(SelectionEvent e) { updateAutoactivationControls(); } }); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationDelay; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_DELAY, 4, 20); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJava; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, 100, 4, 20); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJavaDoc; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, 100, 4, 20); }
@Override protected Control createPreferenceContent(Composite composite) { return fConfigurationBlock.createContents(composite); }
@Override protected Control createContents(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control= new Composite(scrolled, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; control.setLayout(layout); Composite composite; composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_insertionSection_title); addInsertionSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_sortingSection_title); addSortingSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_autoactivationSection_title); addAutoActivationSection(composite); initialize(); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
private void addSortingSection(Composite composite) { String label; label= PreferencesMessages.CodeAssistConfigurationBlock_typeFilters_link; createPreferencePageLink(composite, label, null); new Label(composite, SWT.NONE); label= PreferencesMessages.JavaEditorPreferencePage_presentProposalsInAlphabeticalOrder; ProposalSorterHandle[] sorters= ProposalSorterRegistry.getDefault().getSorters(); String[] labels= new String[sorters.length]; String[] values= new String[sorters.length]; for (int i= 0; i < sorters.length; i++) { ProposalSorterHandle handle= sorters[i]; labels[i]= handle.getName(); values[i]= handle.getId(); } addComboBox(composite, label, PREF_CODEASSIST_SORTER, values, labels, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_matchCamelCase_label; addCheckBox(composite, label, PREF_CODEASSIST_CAMEL_CASE_MATCH, enabledDisabled, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_matchSubstring_label; addCheckBox(composite, label, PREF_CODEASSIST_SUBSTRING_MATCH, enabledDisabled, 0); label= PreferencesMessages.JavaEditorPreferencePage_showOnlyProposalsVisibleInTheInvocationContext; addCheckBox(composite, label, PREF_CODEASSIST_SHOW_VISIBLE_PROPOSALS, trueFalse, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_hideDeprecated_label; addCheckBox(composite, label, PREF_CODEASSIST_DEPRECATION_CHECK, enabledDisabled, 0); }
private void addInsertionSection(Composite composite) { addCompletionRadioButtons(composite); addCheckBox(composite, label, PREF_CODEASSIST_AUTOINSERT, trueFalse, 0); addCheckBox(composite, label, PREF_CODEASSIST_PREFIX_COMPLETION, trueFalse, 0); addCheckBox(composite, PreferencesMessages.JavaEditorPreferencePage_disableCompletionProposalTriggerChars, PREF_CODEASSIST_DISABLE_COMPLETION_PROPOSAL_TRIGGER_CHARS, trueFalse, 0); Button master= addCheckBox(composite, label, PREF_CODEASSIST_ADDIMPORT, trueFalse, 0); Button slave= addCheckBoxWithLink(composite, label, PREF_CODEASSIST_SUGGEST_STATIC_IMPORTS, enabledDisabled, 20, SWT.DEFAULT, new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { createSelectionDependency(master, slave.getParent()); master= addCheckBox(composite, label, PREF_CODEASSIST_FILL_ARGUMENT_NAMES, trueFalse, 0); fInsertBestGuessRadioButton.addSelectionListener(completionSelectionListener); createSelectionDependency(master, fInsertParameterNamesRadioButton); createSelectionDependency(master, fInsertBestGuessRadioButton);
public void createControl(Composite parent) { IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); fConfigurationBlock= new CodeAssistConfigurationBlock(getNewStatusChangedListener(), container); super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); }
protected Text addLabelledTextField(Composite parent, String label, Key key, int textlimit, int indent) { return addLabelledTextField(parent, label, key, textlimit, textlimit, indent); }
protected Control createContents(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control= new Composite(scrolled, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; control.setLayout(layout); Composite composite; composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_insertionSection_title); addInsertionSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_sortingSection_title); addSortingSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_autoactivationSection_title); addAutoActivationSection(composite); initialize(); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
private void addSortingSection(Composite composite) { String label; label= PreferencesMessages.CodeAssistConfigurationBlock_typeFilters_link; createPreferencePageLink(composite, label, null); new Label(composite, SWT.NONE); label= PreferencesMessages.JavaEditorPreferencePage_presentProposalsInAlphabeticalOrder; ProposalSorterHandle[] sorters= ProposalSorterRegistry.getDefault().getSorters(); String[] labels= new String[sorters.length]; String[] values= new String[sorters.length]; for (int i= 0; i < sorters.length; i++) { ProposalSorterHandle handle= sorters[i]; labels[i]= handle.getName(); values[i]= handle.getId(); } addComboBox(composite, label, PREF_CODEASSIST_SORTER, values, labels, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_matchCamelCase_label; addCheckBox(composite, label, PREF_CODEASSIST_CAMEL_CASE_MATCH, enabledDisabled, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_matchSubstring_label; addCheckBox(composite, label, PREF_CODEASSIST_SUBSTRING_MATCH, enabledDisabled, 0); label= PreferencesMessages.JavaEditorPreferencePage_showOnlyProposalsVisibleInTheInvocationContext; addCheckBox(composite, label, PREF_CODEASSIST_SHOW_VISIBLE_PROPOSALS, trueFalse, 0); label= PreferencesMessages.CodeAssistConfigurationBlock_hideDeprecated_label; addCheckBox(composite, label, PREF_CODEASSIST_DEPRECATION_CHECK, enabledDisabled, 0); }
private void addInsertionSection(Composite composite) { addCompletionRadioButtons(composite); addCheckBox(composite, label, PREF_CODEASSIST_AUTOINSERT, trueFalse, 0); addCheckBox(composite, label, PREF_CODEASSIST_PREFIX_COMPLETION, trueFalse, 0); Button master= addCheckBox(composite, label, PREF_CODEASSIST_ADDIMPORT, trueFalse, 0); Button slave= addCheckBoxWithLink(composite, label, PREF_CODEASSIST_SUGGEST_STATIC_IMPORTS, enabledDisabled, 20, SWT.DEFAULT, new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { createSelectionDependency(master, slave.getParent()); master= addCheckBox(composite, label, PREF_CODEASSIST_FILL_ARGUMENT_NAMES, trueFalse, 0); fInsertBestGuessRadioButton.addSelectionListener(completionSelectionListener); createSelectionDependency(master, fInsertParameterNamesRadioButton); createSelectionDependency(master, fInsertBestGuessRadioButton);
@Override public void createControl(Composite parent) { IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); fConfigurationBlock= new CodeAssistConfigurationBlock(getNewStatusChangedListener(), container); super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); }
protected Text addLabelledTextField(Composite parent, String label, Key key, int textlimit, int indent) { return addLabelledTextField(parent, label, key, textlimit, textlimit, indent); }
@Override protected Control createContents(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control= new Composite(scrolled, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; control.setLayout(layout); Composite composite; composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_insertionSection_title); addInsertionSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_sortingSection_title); addSortingSection(composite); composite= createSubsection(control, PreferencesMessages.CodeAssistConfigurationBlock_autoactivationSection_title); addAutoActivationSection(composite); initialize(); scrolled.setContent(control); final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
addComboBox(composite, label, PREF_CODEASSIST_SORTER, values, labels, 0); addCheckBox(composite, label, PREF_CODEASSIST_SHOW_VISIBLE_PROPOSALS, trueFalse, 0); addCheckBox(composite, label, PREF_CODEASSIST_CAMEL_CASE_MATCH, enabledDisabled, 0); targetInfo.put(ProblemSeveritiesPreferencePage.DATA_SELECT_OPTION_KEY, JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE); targetInfo.put(ProblemSeveritiesPreferencePage.DATA_SELECT_OPTION_QUALIFIER, JavaCore.PLUGIN_ID); createPreferencePageLink(composite, label, targetInfo); addCheckBox(composite, label, PREF_CODEASSIST_FORBIDDEN_REFERENCE_CHECK, enabledDisabled, 0); addCheckBox(composite, label, PREF_CODEASSIST_DISCOURAGED_REFERENCE_CHECK, enabledDisabled, 0); addCheckBox(composite, label, PREF_CODEASSIST_DEPRECATION_CHECK, enabledDisabled, 0);
private void addAutoActivationSection(Composite composite) { String label; label= PreferencesMessages.JavaEditorPreferencePage_enableAutoActivation; final Button autoactivation= addCheckBox(composite, label, PREF_CODEASSIST_AUTOACTIVATION, trueFalse, 0); autoactivation.addSelectionListener(new SelectionAdapter(){ @Override public void widgetSelected(SelectionEvent e) { updateAutoactivationControls(); } }); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationDelay; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_DELAY, 4, 20); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJava; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, 100, 4, 20); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJavaDoc; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, 100, 4, 20); }
@Override public void createControl(Composite parent) { IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer(); fConfigurationBlock= new CodeAssistConfigurationBlock(getNewStatusChangedListener(), container); super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE); }
@Override protected Control createPreferenceContent(Composite composite) { return fConfigurationBlock.createContents(composite); }
private void addAutoActivationSection(Composite composite) { String label; label= PreferencesMessages.JavaEditorPreferencePage_enableAutoActivation; final Button autoactivation= addCheckBox(composite, label, PREF_CODEASSIST_AUTOACTIVATION, trueFalse, 0); autoactivation.addSelectionListener(new SelectionAdapter(){ public void widgetSelected(SelectionEvent e) { updateAutoactivationControls(); } }); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationDelay; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_DELAY, 4, 0, true); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJava; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA, 4, 0, false); label= PreferencesMessages.JavaEditorPreferencePage_autoActivationTriggersForJavaDoc; addLabelledTextField(composite, label, PREF_CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC, 4, 0, false); }
protected Control createPreferenceContent(Composite composite) { return fConfigurationBlock.createContents(composite); }