Tabnine Logo
DefaultCodeFormatterConstants.getEclipseDefaultSettings
Code IndexAdd Tabnine to your IDE (free)

How to use
getEclipseDefaultSettings
method
in
org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants

Best Java code snippets using org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants.getEclipseDefaultSettings (Showing top 20 results out of 315)

origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * @return Returns the settings for the new eclipse profile.
 */
public static Map<String, String> getEclipseSettings() {
  return DefaultCodeFormatterConstants.getEclipseDefaultSettings();
}
origin: ma.glasnost.orika/orika-eclipse-tools

/**
 * Return the options to be passed when creating {@link CodeFormatter}
 * instance.
 * 
 * @return
 */
private Map<String, String> getFormattingOptions() {
  @SuppressWarnings("unchecked")
  Map<String, String> options = DefaultCodeFormatterConstants
      .getEclipseDefaultSettings();
  options.put(JavaCore.COMPILER_SOURCE, JAVA_COMPILER_SOURCE_VERSION);
  options.put(JavaCore.COMPILER_COMPLIANCE,
      JAVA_COMPILER_COMPLIANCE_VERSION);
  options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM,
      JAVA_COMPILER_CODEGEN_TARGET_PLATFORM_VERSION);
  return options;
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 * @return Returns the settings for the new eclipse profile.
 */	
public static Map getEclipseSettings() {
  final Map options= DefaultCodeFormatterConstants.getEclipseDefaultSettings();
  ProfileVersioner.setLatestCompliance(options);
  return options;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * @return Returns the settings for the new eclipse profile.
 */
public static Map<String, String> getEclipseSettings() {
  final Map<String, String> options= DefaultCodeFormatterConstants.getEclipseDefaultSettings();
  ProfileVersioner.setLatestCompliance(options);
  return options;
}
origin: com.jaxio.celerio/celerio-engine

@SuppressWarnings({"unchecked", "deprecation"})
public void setFormatterSettings(List<Setting> settings) {
  // // change the option to wrap each enum constant on a new line
  // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
  // DefaultCodeFormatterConstants.createAlignmentValue(true,
  // DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
  // DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
  //
  if (settings != null) {
    options = newHashMap();
    for (Setting s : settings) {
      options.put(s.getId(), s.getValue());
    }
  } else {
    options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
    options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
    options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
    options.put(JavaCore.FORMATTER_LINE_SPLIT, "160");
    options.put(JavaCore.FORMATTER_TAB_CHAR, JavaCore.SPACE);
    options.put(JavaCore.FORMATTER_TAB_SIZE, "4");
  }
  // instanciate the default code formatter with the given options
  codeFormatter = ToolFactory.createCodeFormatter(options);
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: org.eclipse.tycho/org.eclipse.jdt.core

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: jaxio/celerio

@SuppressWarnings({"unchecked", "deprecation"})
public void setFormatterSettings(List<Setting> settings) {
  // // change the option to wrap each enum constant on a new line
  // options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS,
  // DefaultCodeFormatterConstants.createAlignmentValue(true,
  // DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE,
  // DefaultCodeFormatterConstants.INDENT_ON_COLUMN));
  //
  if (settings != null) {
    options = newHashMap();
    for (Setting s : settings) {
      options.put(s.getId(), s.getValue());
    }
  } else {
    options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
    options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
    options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
    options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
    options.put(JavaCore.FORMATTER_LINE_SPLIT, "160");
    options.put(JavaCore.FORMATTER_TAB_CHAR, JavaCore.SPACE);
    options.put(JavaCore.FORMATTER_TAB_SIZE, "4");
  }
  // instanciate the default code formatter with the given options
  codeFormatter = ToolFactory.createCodeFormatter(options);
}
origin: trylimits/Eclipse-Postfix-Code-Completion

defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
origin: org.eclipse.tycho/org.eclipse.jdt.core

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: trylimits/Eclipse-Postfix-Code-Completion

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: org.eclipse.jdt/org.eclipse.jdt.core

Map codeFormatterOptionsMap = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
for (Iterator iter = codeFormatterOptionsMap.entrySet().iterator(); iter.hasNext();) {
  Map.Entry entry = (Map.Entry) iter.next();
origin: org.onehippo.cms7.essentials.sdk/implementation

/**
 * Format java code for given input
 *
 * @param source source to format
 * @return formatted source code or original on error
 */
@SuppressWarnings({RAWTYPES, UNCHECKED})
public static String formatCode(final String source) {
  final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
  options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7);
  options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_7);
  options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7);
  final String alignmentValue = DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN);
  options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS, alignmentValue);
  final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
  final TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, source, 0, source.length(), 0, System.getProperty("line.separator"));
  final ASTParser parser = ASTParser.newParser(AST.JLS3);
  final IDocument document = new Document(source);
  parser.setSource(document.get().toCharArray());
  try {
    edit.apply(document);
    return document.get();
  } catch (BadLocationException e) {
    log.error("Error formatting java code", e);
  }
  return source;
}
origin: org.onehippo.cms7.essentials/hippo-essentials-plugin-api-implementation

/**
 * Format java code for given input
 *
 * @param source source to format
 * @return formatted source code or original on error
 */
@SuppressWarnings({RAWTYPES, UNCHECKED})
public static String formatCode(final String source) {
  final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
  options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7);
  options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_7);
  options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7);
  final String alignmentValue = DefaultCodeFormatterConstants.createAlignmentValue(true, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_ON_COLUMN);
  options.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS, alignmentValue);
  final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
  final TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, source, 0, source.length(), 0, System.getProperty("line.separator"));
  final ASTParser parser = ASTParser.newParser(AST.JLS3);
  final IDocument document = new Document(source);
  parser.setSource(document.get().toCharArray());
  try {
    edit.apply(document);
    return document.get();
  } catch (BadLocationException e) {
    log.error("Error formatting java code", e);
  }
  return source;
}
org.eclipse.jdt.core.formatterDefaultCodeFormatterConstantsgetEclipseDefaultSettings

Javadoc

Returns the default Eclipse formatter settings

Popular methods of DefaultCodeFormatterConstants

  • createAlignmentValue
    Create a new alignment value according to the given values. This must be used to set up the alignmen
  • getEclipse21Settings
    Returns the formatter settings that most closely approximate the default formatter settings of Eclip
  • getJavaConventionsSettings
    Returns the settings according to the Java conventions.
  • getForceWrapping
    Return the force value of the given alignment value. The given alignment value should be created usi
  • getIndentStyle
    Return the indentation style of the given alignment value. The given alignment value should be creat
  • getWrappingStyle
    Return the wrapping style of the given alignment value. The given alignment value should be created
  • setForceWrapping
    Set the force value of the given alignment value and return the new value. The given alignment value
  • setIndentStyle
    Set the indentation style of the given alignment value and return the new value. The given value sho
  • setWrappingStyle
    Set the wrapping style of the given alignment value and return the new value. The given value should

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now