@Override protected ModifyDialog createModifyDialog(Shell shell, Profile profile, ProfileManager profileManager, ProfileStore profileStore, boolean newProfile) { // TODO pass custom formatter id for preview? return new FormatterModifyDialog(shell, profile, profileManager, profileStore, newProfile, DIALOGSTORE_LASTSAVELOADPATH); }
@Override protected void createPreferenceTree(Composite parent) { super.createPreferenceTree(parent); createIndentationTree(); createBracesTree(); createParanthesesTree(); createWhiteSpaceTree(); createBlankLinesTree(); createNewLinesTree(); createLineWrapTree(); createCommentsTree(); createOffOnTree(); }
protected void addPages(Map values) { addTabPage(FormatterMessages.ModifyDialog_tabpage_indentation_title, new IndentationTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_braces_title, new BracesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_whitespace_title, new WhiteSpaceTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_blank_lines_title, new BlankLinesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_new_lines_title, new NewLinesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_control_statements_title, new ControlStatementsTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_line_wrapping_title, new LineWrappingTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_comments_title, new CommentsTabPage(this, values)); }
createGridLayout(controlPane, 2, false); Composite buttonsPane= new Composite(controlPane, SWT.NONE); buttonsPane.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false)); createGridLayout(buttonsPane, 3, false); ((GridLayout) buttonsPane.getLayout()).makeColumnsEqualWidth= true; valuesModified();
String label = FormatterMessages.FormatterModifyDialog_indentation_pref_blank_lines_separating_independent_groups; checkbox.setText(label); GridData gd= createGridData(GRID_COLUMNS - 2, GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER, SWT.DEFAULT, 0); checkbox.setLayoutData(gd); checkbox.setFont(alignSection.fInnerComposite.getFont()); int groupingLines= value != null ? Integer.parseInt(value) : Integer.MAX_VALUE; if (value != null && groupingLines > blankLinesToPreserve && groupingLines != Integer.MAX_VALUE) { updateStatus(new Status(IStatus.INFO, JavaPlugin.getPluginId(), 0, Messages.format(FormatterMessages.FormatterModifyDialog_indentation_info_blank_lines_to_preserve, Integer.valueOf(blankLinesToPreserve)), null)); } else { updateStatus(null);
private void createIndentationTree() { final Section globalSection= fTree.addSection(null, FormatterMessages.FormatterModifyDialog_indentation_tree_indentation, "section-indentation"); //$NON-NLS-1$ createGeneralIndentationPrefs(globalSection); fTree.addGap(globalSection); fTree.builder(FormatterMessages.FormatterModifyDialog_indentation_tree_indented_elements, null, s -> CheckboxPreference.addModifyAll(s, fImages)) .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_declarations_within_class_body, DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER) .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_declarations_within_enum_decl, DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER) .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_declarations_within_enum_const, DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER) .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_declarations_within_annot_decl, DefaultCodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER) .gap() .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_statements_compare_to_body, DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY) .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_statements_compare_to_block, DefaultCodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK) .gap() .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_statements_within_switch_body, DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, pref -> { fTree.addCheckbox(pref, FormatterMessages.FormatterModifyDialog_indentation_pref_indent_statements_within_case_body, DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, CheckboxPreference.FALSE_TRUE); fTree.addCheckbox(pref, FormatterMessages.FormatterModifyDialog_indentation_pref_indent_break_statements, DefaultCodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES, CheckboxPreference.FALSE_TRUE); }) .gap() .pref(FormatterMessages.FormatterModifyDialog_indentation_pref_indent_empty_lines, DefaultCodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES) .build(globalSection, (parent, label, key) -> fTree.addCheckbox(parent, label, key, CheckboxPreference.FALSE_TRUE)); createAlignOnColumnPrefs(globalSection); }
@Override protected void addPages(Map<String, String> values) { addTabPage(FormatterMessages.ModifyDialog_tabpage_indentation_title, new IndentationTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_braces_title, new BracesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_parentheses_title, new ParenthesesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_whitespace_title, new WhiteSpaceTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_blank_lines_title, new BlankLinesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_new_lines_title, new NewLinesTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_control_statements_title, new ControlStatementsTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_line_wrapping_title, new LineWrappingTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_comments_title, new CommentsTabPage(this, values)); addTabPage(FormatterMessages.ModifyDialog_tabpage_OffOnTags_title, new OffOnTagsTabPage(this, values)); }
@Override protected ModifyDialog createModifyDialog(Shell shell, Profile profile, ProfileManager profileManager, ProfileStore profileStore, boolean newProfile) { return new FormatterModifyDialog(shell, profile, profileManager, profileStore, newProfile, FORMATTER_DIALOG_PREFERENCE_KEY, DIALOGSTORE_LASTSAVELOADPATH); }
protected ModifyDialog createModifyDialog(Shell shell, Profile profile, ProfileManager profileManager, ProfileStore profileStore, boolean newProfile) { return new FormatterModifyDialog(shell, profile, profileManager, profileStore, newProfile, FORMATTER_DIALOG_PREFERENCE_KEY, DIALOGSTORE_LASTSAVELOADPATH); } }