Package cfml.formatting.preferences

Examples of cfml.formatting.preferences.FormatterPreferences


    boolean condenseTags = prefs.condenseTags();
    boolean useSpacesInsteadOfTabs = prefs.useSpacesInsteadOfTabs();
    String ignoredTags = prefs.getIgnoredTags();
    int maxLineWidth = prefs.getMaximumLineWidth();

    FormatterPreferences formatprefs = new FormatterPreferences();
    formatprefs.setEnforceMaximumLineWidth(enforceMaxLineWidth);
    formatprefs.tidyTags(tidyTags);
    formatprefs.collapseWhiteSpace(collapseWhitespace);
    formatprefs.indentAllElements(indentAllElements);
    formatprefs.changeTagCase(changeTagCase);
    formatprefs.changeTagCaseUpper(changeTagCaseUpper);
    formatprefs.changeTagCaseLower(changeTagCaseLower);
    formatprefs.setMaximumLineWidth(maxLineWidth);
    formatprefs.setInitialIndent(currentIndent);
    formatprefs.setCloseTags(prefs.getCloseTags());
    formatprefs.condenseTags(condenseTags);
    formatprefs.inCFScript(inCFScript);
    formatprefs.useSpacesInsteadOfTabs(useSpacesInsteadOfTabs);
    if (useSpacesInsteadOfTabs) {
      formatprefs.setTabWidth(prefs.getTabWidth());
    } else {
      formatprefs.setTabWidth(1);
    }
    formatprefs.formatCFScript(prefs.formatCFScript());
    formatprefs.formatJavaScript(prefs.formatJavaScript());
    formatprefs.braces_on_own_line(prefs.braces_on_own_line());
    formatprefs.formatCSS(prefs.formatCSS());
    formatprefs.setFormatSQL(prefs.formatSQL());
    formatprefs.setIgnoredTags(ignoredTags);
    formatprefs.setCloseTagsList(prefs.getCloseTagsList());
    CFMLPropertyManager props = new CFMLPropertyManager();
    formatprefs.setDictionaryDir(props.getDictionaryDir());
    formatprefs.setCFDictionary("ColdFusion9");

    fFormatter = new Formatter(formatprefs);
    String formatted = fFormatter.format(contents);
    return formatted;
View Full Code Here


   * <li>P_NAVIGATION_SMART_HOME_END - false</li>
   * </ul>
   *
   */
  public static void setDefaults(IPreferenceStore store) {
    FormatterPreferences fPrefs = new FormatterPreferences();

    store.setDefault(P_INSIGHT_DELAY,500);
    store.setDefault(P_INSERT_SPACES_FOR_TABS,false);
    store.setDefault(P_TAB_WIDTH,4);
    store.setDefault(P_BRACKET_MATCHING_COLOR,"255,0,0");
    store.setDefault(P_BRACKET_MATCHING_ENABLED,true);
    store.setDefault(P_TAB_INDENTS_CURRENT_LINE,true);
    store.setDefault(P_RTRIM_ON_SAVE,true);
    store.setDefault(P_LINE_NUMBER_COLOR,"0,0,0");
    store.setDefault(P_CURRENT_LINE_COLOR,"232,242,254");
    store.setDefault(P_SHOW_PRINT_MARGIN,false);
    store.setDefault(P_PRINT_MARGIN_SIZE,80);
    store.setDefault(P_PRINT_MARGIN_COLOR,"176,180,185");
    store.setDefault(P_SELECTION_FOREGROUND_COLOR,"255,255,255");
    store.setDefault(P_SELECTION_BACKGROUND_COLOR,"10,36,106");
    store.setDefault(P_COLOR_BACKGROUND,"255,255,255");
    store.setDefault(P_SHOW_OVERVIEW_RULER,true);
    store.setDefault(P_HIGHLIGHT_CURRENT_LINE,true);
    store.setDefault(P_ENABLE_CUSTOM_CARETS,true);
    store.setDefault(P_USE_WIDE_CARET,true);
    store.setDefault(P_SELECTION_FOREGROUND_SYSTEM_DEFAULT,false);
    store.setDefault(P_SELECTION_BACKGROUND_SYSTEM_DEFAULT,false);
    store.setDefault(P_WARN_READ_ONLY_FILES,true);
    store.setDefault(P_BRACKET_MATCHING_STYLE,BRACKET_MATCHING_BOLD);
    store.setDefault(P_SHOW_EDITOR_TOOLBAR, false);
    store.setDefault(P_NAVIGATION_SMART_HOME_END, false);

    store.setDefault(FORMATTER_ALIGN, false);
    store.setDefault(FORMATTER_MAX_LINE_LENGTH, 80);
    store.setDefault(FORMATTER_WRAP_LONG, false);
    store.setDefault(FORMATTER_CLOSE_TAGS, true);
    store.setDefault(FORMATTER_IGNORED_TAGS, fPrefs.getIgnoredTags());
    store.setDefault(FORMATTER_CLOSE_TAGS_LIST, fPrefs.getCloseTagsList());
    store.setDefault(FORMATTER_CONDENSE_TAGS, true);
   
    store.setDefault(TEMPLATES_USE_CODEFORMATTER, true);
    store.setDefault(FORMATTER_FORMAT_SQL, false);
    store.setDefault(FORMATTER_FORMAT_JS, false);
View Full Code Here

TOP

Related Classes of cfml.formatting.preferences.FormatterPreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.