当前位置: 首页>>代码示例>>Java>>正文


Java PreferenceConstants类代码示例

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


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

示例1: forceStaticImports

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
private void forceStaticImports() {
	try {
		IPreferenceStore s = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.jdt.ui");
		String favorites = s.getString(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS);
		for (String f : defaultFavorites) {
			if (!favorites.contains(f)) {
				if (!favorites.isEmpty()) {
					favorites += ";";
				}
				favorites += f;
			}
		}
		Log.info("forcing favorite static members: " + favorites);
		s.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, favorites);
	} catch (Exception e) {
		Log.error(e);
	}
}
 
开发者ID:cincheo,项目名称:jsweet-eclipse-plugin,代码行数:19,代码来源:JSweetBuilder.java

示例2: setOrganizeImportSettings

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
protected void setOrganizeImportSettings(
    String[] order, int threshold, int staticThreshold, IJavaProject project) {
  IEclipsePreferences scope =
      new ProjectScope(project.getProject()).getNode("org.eclipse.jdt.ui");
  if (order == null) {
    scope.remove(PreferenceConstants.ORGIMPORTS_IMPORTORDER);
    scope.remove(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD);
  } else {
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < order.length; i++) {
      buf.append(order[i]);
      buf.append(';');
    }
    scope.put(PreferenceConstants.ORGIMPORTS_IMPORTORDER, buf.toString());
    scope.put(PreferenceConstants.ORGIMPORTS_ONDEMANDTHRESHOLD, String.valueOf(threshold));
    scope.put(
        PreferenceConstants.ORGIMPORTS_STATIC_ONDEMANDTHRESHOLD, String.valueOf(staticThreshold));
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:ImportOrganizeTest.java

示例3: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1");
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = ProjectTestSetup.getProject();

  String newFileTemplate = "${package_declaration}\n\n${type_declaration}";
  StubUtility.setCodeTemplate(CodeTemplateContextType.NEWTYPE_ID, newFileTemplate, null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.TYPECOMMENT_ID, "", null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "", null);

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:UnresolvedTypesQuickFixTest.java

示例4: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);
  store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, false);

  StubUtility.setCodeTemplate(
      CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

  fJProject1 = Java18ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:AdvancedQuickAssistTest18.java

示例5: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
  fConvertLoopProposal = null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:ConvertForLoopQuickFixTest.java

示例6: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  options.put(
      DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE,
      JavaCore.DO_NOT_INSERT);

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = Java17ProjectTestSetup.getProject();

  StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "", null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORSTUB_ID, "", null);

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:ModifierCorrectionsQuickFixTest17.java

示例7: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  options.put(
      DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE,
      String.valueOf(99));
  options.put(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER, JavaCore.ERROR);
  options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  StubUtility.setCodeTemplate(CodeTemplateContextType.CATCHBLOCK_ID, "", null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORSTUB_ID, "", null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "", null);

  fJProject1 = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:TypeMismatchQuickFixTests.java

示例8: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  options.put(
      DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE,
      JavaCore.DO_NOT_INSERT);
  options.put(JavaCore.COMPILER_PB_STATIC_ACCESS_RECEIVER, JavaCore.ERROR);
  options.put(JavaCore.COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD, JavaCore.ERROR);

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = ProjectTestSetup.getProject();

  StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "", null);
  StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORSTUB_ID, "", null);

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:ModifierCorrectionsQuickFixTest.java

示例9: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  StubUtility.setCodeTemplate(
      CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

  fJProject1 = Java18ProjectTestSetup.getProject();
  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:AssistQuickFixTest18.java

示例10: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:ReturnTypeQuickFixTest.java

示例11: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  options.put(JavaCore.COMPILER_PB_UNUSED_IMPORT, JavaCore.ERROR);
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fJProject1 = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:ReorgQuickFixTest.java

示例12: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);

  fProject = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fProject, "src");
  fConvertLoopProposal = null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:ConvertIterableLoopQuickFixTest.java

示例13: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);
  store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, false);

  StubUtility.setCodeTemplate(
      CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

  //		Preferences corePrefs = JavaPlugin.getJavaCorePluginPreferences();
  //		corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

  fJProject1 = ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:AdvancedQuickAssistTest.java

示例14: setUp

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  super.setUp();
  Hashtable options = TestOptions.getDefaultOptions();
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
  options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");

  JavaCore.setOptions(options);

  IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();
  store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);
  store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, false);

  StubUtility.setCodeTemplate(
      CodeTemplateContextType.METHODSTUB_ID, "//TODO\n${body_statement}", null);

  //		Preferences corePrefs = JavaPlugin.getJavaCorePluginPreferences();
  //		corePrefs.setValue(JavaCore.CODEASSIST_FIELD_PREFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
  //		corePrefs.setValue(JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");

  fJProject1 = Java17ProjectTestSetup.getProject();

  fSourceFolder = JavaProjectHelper.addSourceContainer(fJProject1, "src");
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:AdvancedQuickAssistTest17.java

示例15: start

import org.eclipse.jdt.ui.PreferenceConstants; //导入依赖的package包/类
@PostConstruct
public void start() {
  //        WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
  //            @Override
  //            public IBuffer createBuffer(ICompilationUnit workingCopy) {
  //                ICompilationUnit original = workingCopy.getPrimary();
  //                IResource resource = original.getResource();
  //                if (resource instanceof IFile)
  //                    return new DocumentAdapter(workingCopy, (IFile)resource);
  //                return DocumentAdapter.NULL;
  //            }
  //        });
  new JavaCore();
  fMembersOrderPreferenceCache = new MembersOrderPreferenceCache();
  PreferenceConstants.initializeDefaultValues(PreferenceConstants.getPreferenceStore());
  new JavaCorePreferenceInitializer().initializeDefaultPreferences();
  new CheCodeFormatterInitializer().initializeDefaultPreferences();
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:JavaPlugin.java


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