private String createBlameMessage() { Object[] args= { getName(), getId() }; String disable= Messages.format(JavaTextMessages.ProposalSorterHandle_blame, args); return disable; }
public void select(ProposalSorterHandle handle) { Assert.isTrue(handle != null); String id= handle.getId(); fPreferenceStore.setValue(fKey, id); } }
public void select(ProposalSorterHandle handle) { Assert.isTrue(handle != null); String id= handle.getId(); fPreferenceStore.setValue(fKey, id); } }
private String createBlameMessage() { Object[] args= { getName(), getId() }; String disable= Messages.format(JavaTextMessages.ProposalSorterHandle_blame, args); return disable; }
private String createBlameMessage() { Object[] args= { getName(), getId() }; String disable= Messages.format(JavaTextMessages.ProposalSorterHandle_blame, args); return disable; }
public void select(ProposalSorterHandle handle) { Assert.isTrue(handle != null); String id= handle.getId(); fPreferenceStore.setValue(fKey, id); } }
final String id= handle.getId(); sorters.put(id, handle); if (DEFAULT_ID.equals(id))
/** * Checks that the given attribute value is not <code>null</code>. * * @param value the value to check if not null * @param attribute the attribute * @throws InvalidRegistryObjectException if the registry element is no longer valid * @throws CoreException if <code>value</code> is <code>null</code> */ private void checkNotNull(Object value, String attribute) throws InvalidRegistryObjectException, CoreException { if (value == null) { Object[] args= { getId(), fElement.getContributor().getName(), attribute }; String message= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message, args); IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null); throw new CoreException(status); } }
/** * Checks that the given attribute value is not <code>null</code>. * * @param value the value to check if not null * @param attribute the attribute * @throws InvalidRegistryObjectException if the registry element is no longer valid * @throws CoreException if <code>value</code> is <code>null</code> */ private void checkNotNull(Object value, String attribute) throws InvalidRegistryObjectException, CoreException { if (value == null) { Object[] args= { getId(), fElement.getContributor().getName(), attribute }; String message= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message, args); IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null); throw new CoreException(status); } }
private synchronized void ensureSortersRead() { if (fSorters != null) return; Map<String, ProposalSorterHandle> sorters= new LinkedHashMap<>(); IExtensionRegistry registry= Platform.getExtensionRegistry(); List<IConfigurationElement> elements= new ArrayList<>(Arrays.asList(registry.getConfigurationElementsFor(JavaPlugin.getPluginId(), EXTENSION_POINT))); for (Iterator<IConfigurationElement> iter= elements.iterator(); iter.hasNext();) { IConfigurationElement element= iter.next(); try { ProposalSorterHandle handle= new ProposalSorterHandle(element); final String id= handle.getId(); sorters.put(id, handle); if (DEFAULT_ID.equals(id)) fDefaultSorter= handle; } catch (InvalidRegistryObjectException x) { /* * Element is not valid any longer as the contributing plug-in was unloaded or for * some other reason. Do not include the extension in the list and inform the user * about it. */ Object[] args= { element.toString() }; String message= Messages.format(JavaTextMessages.CompletionProposalComputerRegistry_invalid_message, args); IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, x); informUser(status); } catch (CoreException x) { informUser(x.getStatus()); } } fSorters= sorters; }
private synchronized void ensureSortersRead() { if (fSorters != null) return; Map<String, ProposalSorterHandle> sorters= new LinkedHashMap<>(); IExtensionRegistry registry= Platform.getExtensionRegistry(); List<IConfigurationElement> elements= new ArrayList<>(Arrays.asList(registry.getConfigurationElementsFor(JavaPlugin.getPluginId(), EXTENSION_POINT))); for (Iterator<IConfigurationElement> iter= elements.iterator(); iter.hasNext();) { IConfigurationElement element= iter.next(); try { ProposalSorterHandle handle= new ProposalSorterHandle(element); final String id= handle.getId(); sorters.put(id, handle); if (DEFAULT_ID.equals(id)) fDefaultSorter= handle; } catch (InvalidRegistryObjectException x) { /* * Element is not valid any longer as the contributing plug-in was unloaded or for * some other reason. Do not include the extension in the list and inform the user * about it. */ Object[] args= { element.toString() }; String message= Messages.format(JavaTextMessages.CompletionProposalComputerRegistry_invalid_message, args); IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, x); informUser(status); } catch (CoreException x) { informUser(x.getStatus()); } } fSorters= sorters; }
/** * Checks an element that must be defined according to the extension * point schema. Throws an * <code>InvalidRegistryObjectException</code> if <code>obj</code> * is <code>null</code>. */ private void checkNotNull(Object obj, String attribute) throws InvalidRegistryObjectException { if (obj == null) { Object[] args= { getId(), fElement.getContributor().getName(), attribute }; String message= Messages.format(JavaTextMessages.CompletionProposalComputerDescriptor_illegal_attribute_message, args); IStatus status= new Status(IStatus.WARNING, JavaPlugin.getPluginId(), IStatus.OK, message, null); JavaPlugin.log(status); throw new InvalidRegistryObjectException(); } }
ProposalSorterHandle handle= sorters[i]; labels[i]= handle.getName(); values[i]= handle.getId();
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 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); }