本文整理汇总了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);
}
}
示例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));
}
}
示例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");
}
示例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");
}
示例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;
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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;
}
示例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");
}
示例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");
}
示例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();
}