public void enableProjectSpecificSettings(boolean useProjectSpecificSettings) { if (useProjectSpecificSettings) { if (fDefaultFormatterId != null) { fPrefs.put(JavaCore.JAVA_FORMATTER, fDefaultFormatterId); } } else { initDefault(); } }
public void enableProjectSpecificSettings(boolean useProjectSpecificSettings) { if (useProjectSpecificSettings) { if (fDefaultFormatterId != null) { fPrefs.put(JavaCore.JAVA_FORMATTER, fDefaultFormatterId); } } else { initDefault(); } }
public void createContents(Composite parent, int numColumns) { if (fFormatters.length <= 1) { return; // No selector is needed since there is only one formatter. } Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().margins(0, 10).numColumns(2).create()); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= numColumns; composite.setLayoutData(gd); composite.setFont(parent.getFont()); Label label= new Label(composite, SWT.NONE); label.setText(FormatterMessages.CustomCodeFormatterBlock_formatter_name); fFormatterCombo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fFormatterCombo.setFont(composite.getFont()); fFormatterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleFormatterChanged(); } }); for (FormatterContribution formatter : fFormatters) { fFormatterCombo.add(formatter.fName); } initDefault(); }
public void createContents(Composite parent, int numColumns) { if (fFormatters.length <= 1) { return; // No selector is needed since there is only one formatter. } Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().margins(0, 10).numColumns(2).create()); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= numColumns; composite.setLayoutData(gd); composite.setFont(parent.getFont()); Label label= new Label(composite, SWT.NONE); label.setText(FormatterMessages.CustomCodeFormatterBlock_formatter_name); fFormatterCombo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); fFormatterCombo.setFont(composite.getFont()); fFormatterCombo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleFormatterChanged(); } }); for (FormatterContribution formatter : fFormatters) { fFormatterCombo.add(formatter.fName); } initDefault(); }