• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CodeStylePreferences类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.modules.editor.indent.spi.CodeStylePreferences的典型用法代码示例。如果您正苦于以下问题:Java CodeStylePreferences类的具体用法?Java CodeStylePreferences怎么用?Java CodeStylePreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CodeStylePreferences类属于org.netbeans.modules.editor.indent.spi包,在下文中一共展示了CodeStylePreferences类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTabInsertString

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
/** @deprecated
 * @see Formatter.insertTabString()
 */
public static String getTabInsertString(BaseDocument doc, int offset)
throws BadLocationException {
    int col = getVisualColumn(doc, offset);
    Preferences prefs = CodeStylePreferences.get(doc).getPreferences();
    boolean expandTabs = prefs.getBoolean(SimpleValueNames.EXPAND_TABS, EditorPreferencesDefaults.defaultExpandTabs);
    if (expandTabs) {
        int spacesPerTab = prefs.getInt(SimpleValueNames.SPACES_PER_TAB, EditorPreferencesDefaults.defaultSpacesPerTab);
        if (spacesPerTab <= 0) {
            return ""; //NOI18N
        }
        int len = (col + spacesPerTab) / spacesPerTab * spacesPerTab - col;
        return new String(Analyzer.getSpacesBuffer(len), 0, len);
    } else { // insert pure tab
        return "\t"; // NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:Utilities.java


示例2: checkSetIndentation

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
private void checkSetIndentation(String before, int indent, String after, boolean indentWithTabs) throws Exception {
    int offset = before.indexOf('^');
    // Must indicate caret pos!
    assertTrue(offset != -1);
    before = before.substring(0, offset) + before.substring(offset + 1);

    BaseDocument doc = getDocument(before);

    if (indentWithTabs) {
        CodeStylePreferences.get(doc).getPreferences().putBoolean(SimpleValueNames.EXPAND_TABS, false);
        CodeStylePreferences.get(doc).getPreferences().putInt(SimpleValueNames.TAB_SIZE, 8);
    }

    GsfUtilities.setLineIndentation(doc, offset, indent);
    assertEquals(after, doc.getText(0, doc.getLength()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:GsfUtilitiesTest.java


示例3: testFieldLocation233440

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testFieldLocation233440() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMemberInsertionPoint", InsertionPoint.CARET_LOCATION.name());
    IntroduceHint.INSERT_CLASS_MEMBER = new InsertClassMember();
    performFixTest("package test;\n" +
                   "public class Test {\n" +
                   "    String s = \"text\";\n" +
                   "    public void method() {\n" +
                   "        String local = |\"text\"|;\n" +
                   "    }\n" +
                   "}\n",
                   "package test; public class Test { private String text = \"text\"; String s = text; public void method() { String local = text; } } ",
                   new DialogDisplayerImpl2(null, IntroduceFieldPanel.INIT_FIELD, true, EnumSet
            .<Modifier>of(Modifier.PRIVATE), false, true),
                   5, 2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:IntroduceHintTest.java


示例4: testConstantFix208072a

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testConstantFix208072a() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
    performFixTest("package test;\n" +
                   "import java.util.logging.Level;\n" +
                   "import java.util.logging.Logger;\n" +
                   "public class Test {\n" +
                   "     private static final int II = |1 + 2 * 3|;\n" +
                   "}\n",
                   ("package test;\n" +
                    "import java.util.logging.Level;\n" +
                    "import java.util.logging.Logger;\n" +
                    "public class Test {\n" +
                   "     private static final int ZZ = 1 + 2 * 3;\n" +
                   "     private static final int II = ZZ;\n" +
                    "}\n").replaceAll("[ \t\n]+", " "),
                   new DialogDisplayerImpl("ZZ", true, true, true, EnumSet.of(Modifier.PRIVATE)),
                   1, 0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:IntroduceHintTest.java


示例5: testConstantFix208072b

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testConstantFix208072b() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMembersOrder", "STATIC_INIT;STATIC METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
    prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
    performFixTest("package test;\n" +
                   "import java.util.logging.Level;\n" +
                   "import java.util.logging.Logger;\n" +
                   "public class Test {\n" +
                   "     static {\n" +
                   "         II = |1 + 2 * 3|;\n" +
                   "     }\n" +
                   "     private static final int II;\n" +
                   "}\n",
                   ("package test;\n" +
                    "import java.util.logging.Level;\n" +
                    "import java.util.logging.Logger;\n" +
                    "public class Test {\n" +
                   "     private static final int ZZ = 1 + 2 * 3;\n" +
                   "     static {\n" +
                   "         II = ZZ;\n" +
                   "     }\n" +
                   "     private static final int II;\n" +
                    "}\n").replaceAll("[ \t\n]+", " "),
                   new DialogDisplayerImpl("ZZ", true, true, true, EnumSet.of(Modifier.PRIVATE)),
                   5, 1);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:IntroduceHintTest.java


示例6: testConstantFix208072c

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testConstantFix208072c() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMembersOrder", "STATIC_INIT;STATIC METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
    prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
    performFixTest("package test;\n" +
                   "import java.util.logging.Level;\n" +
                   "import java.util.logging.Logger;\n" +
                   "public class Test {\n" +
                   "     {\n" +
                   "         int ii = |1 + 2 * 3|;\n" +
                   "     }\n" +
                   "     private static final int II = 0;\n" +
                   "}\n",
                   ("package test;\n" +
                    "import java.util.logging.Level;\n" +
                    "import java.util.logging.Logger;\n" +
                    "public class Test {\n" +
                   "     {\n" +
                   "         int ii = ZZ;\n" +
                   "     }\n" +
                   "     private static final int II = 0;\n" +
                   "     private static final int ZZ = 1 + 2 * 3;\n" +
                    "}\n").replaceAll("[ \t\n]+", " "),
                   new DialogDisplayerImpl("ZZ", true, true, true, EnumSet.of(Modifier.PRIVATE)),
                   5, 1);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:IntroduceHintTest.java


示例7: testConstantFix219771c

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testConstantFix219771c() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMembersOrder", "STATIC_INIT;FIELD;STATIC METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD");
    prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
    performFixTest("package test;\n" +
                   "public class Test {\n" +
                   "    public void method() {\n" +
                   "        System.out.println(\"C0 = \" + |C1 * 5|);\n" +
                   "    }\n" +
                   "    public static final int C1 = 100;\n" +
                   "}\n",
                   ("package test;\n" +
                    "public class Test {\n" +
                    "    public final int C0 = C1 * 5;\n" +
                    "    public void method() {\n" +
                    "        System.out.println(\"C0 = \" + C0);\n" +
                    "    }\n" +
                    "    public static final int C1 = 100;\n" +
                    "}\n").replaceAll("[ \t\n]+", " "),
                   new DialogDisplayerImpl2("C0", IntroduceFieldPanel.INIT_FIELD, true, EnumSet.of(Modifier.PUBLIC), true, true),
                   5, 2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:IntroduceHintTest.java


示例8: testFieldFix208072d

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public void testFieldFix208072d() throws Exception {
    Preferences prefs = CodeStylePreferences.get((FileObject) null, JavacParser.MIME_TYPE).getPreferences();
    prefs.put("classMembersOrder", "STATIC_INIT;STATIC METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
    prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
    performFixTest("package test;\n" +
                   "import java.util.logging.Level;\n" +
                   "import java.util.logging.Logger;\n" +
                   "public class Test {\n" +
                   "     static {\n" +
                   "         int ii = |1 + 2 * 3|;\n" +
                   "     }\n" +
                   "     private static final int II = 0;\n" +
                   "}\n",
                   ("package test;\n" +
                    "import java.util.logging.Level;\n" +
                    "import java.util.logging.Logger;\n" +
                    "public class Test {\n" +
                   "     private static int ZZ = 1 + 2 * 3;\n" +
                   "     static {\n" +
                   "         int ii = ZZ;\n" +
                   "     }\n" +
                   "     private static final int II = 0;\n" +
                    "}\n").replaceAll("[ \t\n]+", " "),
                   new DialogDisplayerImpl2("ZZ", IntroduceFieldPanel.INIT_FIELD, false, EnumSet.<Modifier>of(Modifier.PRIVATE), false, true),
                   5, 2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:IntroduceHintTest.java


示例9: PlainTextEditor

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public PlainTextEditor (final String text) {
  initComponents();

  final JEditorPane editor = UI_COMPO_FACTORY.makeEditorPane();
  editor.setEditorKit(getEditorKit());
  this.document = Utilities.getDocument(editor);

  setText(text);

  final Preferences docPreferences = CodeStylePreferences.get(this.document).getPreferences();
  this.oldWrapping = Wrapping.findFor(docPreferences.get(SimpleValueNames.TEXT_LINE_WRAP, "none"));
  this.wrapping = oldWrapping;

  this.lastComponent = makeEditorForText(this.document);
  this.lastComponent.setPreferredSize(new Dimension(620, 440));
  this.add(this.lastComponent, BorderLayout.CENTER);

  this.labelWrapMode.setMinimumSize(new Dimension(55, this.labelWrapMode.getMinimumSize().height));

  updateBottomPanel();
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:22,代码来源:PlainTextEditor.java


示例10: operate

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
protected boolean operate(String simpleValueName, String value) {
  boolean codeStyleChangeNeeded = false;

  Preferences codeStyle = CodeStylePreferences.get(file, file.getMIMEType()).getPreferences();
  String currentValue = codeStyle.get(simpleValueName, "");

  LOG.log(Level.INFO, "\u00ac Current value: {0}", currentValue);
  LOG.log(Level.INFO, "\u00ac New value: {0}", value);

  if (currentValue.equals(value)) {
    LOG.log(Level.INFO, "\u00ac No change needed");
  } else {
    codeStyle.put(simpleValueName, value);
    codeStyleChangeNeeded = true;
    LOG.log(Level.INFO, "\u00ac Changing value from \"{0}\" to \"{1}\"",
            new Object[]{currentValue, value});
  }

  return codeStyleChangeNeeded;
}
 
开发者ID:welovecoding,项目名称:editorconfig-netbeans,代码行数:21,代码来源:CodeStyleOperation.java


示例11: insertTabString

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
/** Modify the line to move the text starting at dotPos one tab
 * column to the right.  Whitespace preceeding dotPos may be
 * replaced by a TAB character if tabs expanding is on.
 * @param doc document to operate on
 * @param dotPos insertion point
 */
static void insertTabString (final BaseDocument doc, final int dotPos) throws BadLocationException {
    final BadLocationException[] badLocationExceptions = new BadLocationException [1];
    doc.runAtomic (new Runnable () {
        public void run () {
            try {
                // Determine first white char before dotPos
                int rsPos = Utilities.getRowStart(doc, dotPos);
                int startPos = Utilities.getFirstNonWhiteBwd(doc, dotPos, rsPos);
                startPos = (startPos >= 0) ? (startPos + 1) : rsPos;

                int startCol = Utilities.getVisualColumn(doc, startPos);
                int endCol = Utilities.getNextTabColumn(doc, dotPos);
                Preferences prefs = CodeStylePreferences.get(doc).getPreferences();
                String tabStr = Analyzer.getWhitespaceString(
                        startCol, endCol,
                        prefs.getBoolean(SimpleValueNames.EXPAND_TABS, EditorPreferencesDefaults.defaultExpandTabs),
                        prefs.getInt(SimpleValueNames.TAB_SIZE, EditorPreferencesDefaults.defaultTabSize));

                // Search for the first non-common char
                char[] removeChars = doc.getChars(startPos, dotPos - startPos);
                int ind = 0;
                while (ind < removeChars.length && removeChars[ind] == tabStr.charAt(ind)) {
                    ind++;
                }

                startPos += ind;
                doc.remove(startPos, dotPos - startPos);
                doc.insertString(startPos, tabStr.substring(ind), null);
            } catch (BadLocationException ex) {
                badLocationExceptions [0] = ex;
            }
        }
    });
    if (badLocationExceptions[0] != null)
        throw badLocationExceptions [0];
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:BaseKit.java


示例12: getNextTabColumn

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
/** Get the visual column corresponding to the position after pressing
 * the TAB key.
 * @param doc document to work with
 * @param offset position at which the TAB was pressed
 */
public static int getNextTabColumn(BaseDocument doc, int offset)
throws BadLocationException {
    // FIXME -- this should be delegated to LineDocumentUtils.
    int col = getVisualColumn(doc, offset);
    Preferences prefs = CodeStylePreferences.get(doc).getPreferences();
    int tabSize = prefs.getInt(SimpleValueNames.SPACES_PER_TAB, EditorPreferencesDefaults.defaultSpacesPerTab);
    return tabSize <= 0 ? col : (col + tabSize) / tabSize * tabSize;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:Utilities.java


示例13: performUnaryVsBinaryTest187556

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
private void performUnaryVsBinaryTest187556(final Kind first, final Kind second, String goldenSnippet) throws Exception {
    String test = "public class Test { void m(int x) { int y = (|2 + 1); } }";
    String golden = "public class Test { void m(int x) { int y = " + goldenSnippet + "(2 + 1); } }";
    testFile = new File(getWorkDir(), "Test.java");
    final int index = test.indexOf("|");
    assertTrue(index != -1);
    TestUtilities.copyStringToFile(testFile, test.replace("|", ""));

    Preferences prefs = CodeStylePreferences.get(FileUtil.toFileObject(testFile), JavacParser.MIME_TYPE).getPreferences();
    boolean orig = prefs.getBoolean(FmtOptions.spaceAroundBinaryOps, FmtOptions.getDefaultAsBoolean(FmtOptions.spaceAroundBinaryOps));

    prefs.putBoolean(FmtOptions.spaceAroundBinaryOps, false);

    JavaSource src = getJavaSource(testFile);
    Task<WorkingCopy> task = new Task<WorkingCopy>() {

        public void run(WorkingCopy copy) throws Exception {
            if (copy.toPhase(Phase.RESOLVED).compareTo(Phase.RESOLVED) < 0) {
                return;
            }
            Tree node = copy.getTreeUtilities().pathFor(index).getLeaf();
            assertEquals(Kind.PARENTHESIZED, node.getKind());
            System.out.println("node: " + node);
            TreeMaker make = copy.getTreeMaker();
            Tree modified = make.Binary(first, make.Literal(0), make.Unary(second, (ExpressionTree) node));
            System.out.println("modified: " + modified);
            copy.rewrite(node, modified);
        }
    };
    src.runModificationTask(task).commit();
    String res = TestUtilities.copyFileToString(testFile);

    prefs.putBoolean(FmtOptions.spaceAroundBinaryOps, orig);
    
    assertEquals(golden, res);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:OperatorsTest.java


示例14: setCodePreferences

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public static Map<String, String> setCodePreferences(Map<String, String> values) {
    Preferences preferences = CodeStylePreferences.get(new PlainDocument(), JavacParser.MIME_TYPE).getPreferences();
    Map<String, String> origValues = new HashMap<String, String>();
    for (String key : values.keySet()) {
        origValues.put(key, preferences.get(key, null));
    }
    setValues(preferences, values);

    return origValues;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:Utils.java


示例15: textLimitWidth

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
@Override
protected int textLimitWidth() {
    Document doc = getDocument();
    if (doc != null) {
        int textLimit = CodeStylePreferences.get(doc).getPreferences().
                getInt(SimpleValueNames.TEXT_LIMIT_WIDTH, 80);
        if (textLimit > 0) {
            return textLimit;
        }
    }
    return super.textLimitWidth();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:NbEditorUI.java


示例16: loadPreferences

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
@Override
public void loadPreferences(Document document) {
    Preferences preferences = CodeStylePreferences.get(document).getPreferences();
    String membersSortOrderPreferences = formatOptions.getOptionValue(preferences, PreferencesFormatOptions.MEMBERS_SORT_ORDER.name());
    String[] members = membersSortOrderPreferences.split(COMMA_SEPARATOR);
    membersSortOrder = new ClassMemberType[members.length];

    for (int index = 0; index < members.length; index++) {
        membersSortOrder[index] = ClassMemberType.getEnum(members[index]);
    }

    String orderAlphabeticallyPreferences = formatOptions.getOptionValue(preferences, PreferencesFormatOptions.CHECK_SORT_MEMBERS_IN_GROUPS_ALPHABETICALLY.name());
    orderAlphabetically = Boolean.parseBoolean(orderAlphabeticallyPreferences);

    String sortByVisibilityPreferences = formatOptions.getOptionValue(preferences, PreferencesFormatOptions.SORT_MEMBERS_BY_VISIBILITY.name());
    sortByVisibility = Boolean.parseBoolean(sortByVisibilityPreferences);

    if (sortByVisibility) {
        String sortMembersByVisibilityPreferences = formatOptions.getOptionValue(preferences, PreferencesFormatOptions.MEMBERS_VISIBILITY.name());
        String[] accessModifiers = sortMembersByVisibilityPreferences.split(COMMA_SEPARATOR);
        sortMembersByVisibility = new AccessModifier[accessModifiers.length];
        for (int index = 0; index < accessModifiers.length; index++) {
            sortMembersByVisibility[index] = AccessModifier.getEnum(accessModifiers[index]);
        }
    } else {
        sortMembersByVisibility = new AccessModifier[]{AccessModifier.DEFAULT};
    }

    ArrayUtils.reverse(membersSortOrder);
    ArrayUtils.reverse(sortMembersByVisibility);
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:32,代码来源:OrderPreferencesLoader.java


示例17: DocumentFormatter

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param context the current Apex file.
 * @param parserResult contains the tokens sequence of the Apex file
 */
public DocumentFormatter(Context context, ParserResult parserResult) {
    this.context = context;
    Document document = context.document();
    this.parserResult = (ApexParserResult) parserResult;
    contextIndent = new ContextIndent(context);
    Preferences preferences = CodeStylePreferences.get(document).getPreferences();
    bracesFormatter = new BracesFormatter(document, preferences, FormatOptions.getInstance());
    newLineFormatter = new NewLineFormatter(document);
    reformatTreeVisitor = new ReformatTreeVisitor(document,context.startOffset(), context.endOffset());
    optionsToReformat = new ArrayList<>();
    visitParserResult();
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:19,代码来源:DocumentFormatter.java


示例18: writeWrappingCode

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
private void writeWrappingCode (final Wrapping code) {
  final Preferences docPreferences = CodeStylePreferences.get(this.document).getPreferences();
  docPreferences.put(SimpleValueNames.TEXT_LINE_WRAP, code.getValue());
  try {
    docPreferences.flush();
  }
  catch (BackingStoreException ex) {
    LOGGER.error("Can't write wrapping code", ex);
  }
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:11,代码来源:PlainTextEditor.java


示例19: flushStyles

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
private void flushStyles(FileInfo info) {
  try {
    Preferences codeStyle = CodeStylePreferences.get(info.getFileObject(), info.getFileObject().getMIMEType()).getPreferences();
    codeStyle.flush();
    if (info.isOpenedInEditor()) {
      updateChangesInEditorWindow(info);
    }
  } catch (BackingStoreException ex) {
    LOG.log(Level.SEVERE, "Error flushing code styles: {0}", ex.getMessage());
  }
}
 
开发者ID:welovecoding,项目名称:editorconfig-netbeans,代码行数:12,代码来源:EditorConfigProcessor.java


示例20: getIndentSize

import org.netbeans.modules.editor.indent.spi.CodeStylePreferences; //导入依赖的package包/类
public static int getIndentSize(Document doc) {
    Preferences prefs = CodeStylePreferences.get(doc).getPreferences();
    return prefs.getInt(SimpleValueNames.SPACES_PER_TAB, 2);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:IndentUtils.java



注:本文中的org.netbeans.modules.editor.indent.spi.CodeStylePreferences类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TupleReceiver类代码示例发布时间:2022-05-22
下一篇:
Java MetricsThriftServerSourceFactoryImpl类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap