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

Java UserPreferences类代码示例

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

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



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

示例1: openProjectItemActionPerformed

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private void openProjectItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openProjectItemActionPerformed

		if (!closeProjectHook(getCurrentProject(), L10N.getLocalString("msg.openproject_txt", "Open Project")))
			return;

		JFileChooser chooser = createFileChooser();
		chooser.setFileFilter(projectFileFilter);
		int result = chooseFileToOpen(chooser);

		if (result == JFileChooser.CANCEL_OPTION)
			return;
		try {
			File file = chooser.getSelectedFile();
			Project project = new Project();
			project.read(file.getPath());
			setProject(project);
			UserPreferences.getUserPreferences().useProject(file.getPath());
			rebuildRecentProjectsMenu();

		} catch (IOException e) {
			logger.logMessage(ConsoleLogger.ERROR, MessageFormat.format( L10N.getLocalString("msg.couldnotopenproject_txt", "Could not open project: {0}"), new Object[]{e.getMessage()}));
		}
	}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:FindBugsFrame.java


示例2: openRecentProjectItemActionPerformed

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private void openRecentProjectItemActionPerformed(java.awt.event.ActionEvent evt) {
	if (!closeProjectHook(getCurrentProject(), L10N.getLocalString("msg.openproject_txt", "Open Project")))
		return;

	JMenuItem recentProjectItem = (JMenuItem) evt.getSource();
	File file = new File(recentProjectItem.getText());
	try {
		System.setProperty("user.dir", file.getParent());
		Project project = new Project();
		project.read(file.getPath());
		setProject(project);
		UserPreferences.getUserPreferences().useProject(file.getPath());
	} catch (IOException e) {
		UserPreferences.getUserPreferences().removeProject(file.getPath());
		logger.logMessage(ConsoleLogger.ERROR, MessageFormat.format(L10N.getLocalString("msg.couldnotopenproject_txt", "Could not open project: {0}"), new Object[]{e.getMessage()}));
	} finally {
		rebuildRecentProjectsMenu();
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:FindBugsFrame.java


示例3: doAnalysis

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
public edu.umd.cs.findbugs.BugCollection doAnalysis(Project p, FindBugsProgress progressCallback)
    throws IOException, InterruptedException {
  StringWriter stringWriter = new StringWriter();
  BugCollectionBugReporter pcb =
      new BugCollectionBugReporter(p, new PrintWriter(stringWriter, true));
  pcb.setPriorityThreshold(Priorities.LOW_PRIORITY);
  IFindBugsEngine fb = createEngine(p, pcb);
  fb.setUserPreferences(UserPreferences.createDefaultUserPreferences());
  fb.setProgressCallback(progressCallback);
  fb.setProjectName(p.getProjectName());
  fb.execute();
  String warnings = stringWriter.toString();
  if (warnings.length() > 0) {
    logger.warn("analysis warnings:", warnings);
  }

  return pcb.getBugCollection();
}
 
开发者ID:reflectoring,项目名称:coderadar,代码行数:19,代码来源:FindbugsAnalyzerPlugin.java


示例4: openProjectItemActionPerformed

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private void openProjectItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openProjectItemActionPerformed

        if (!closeProjectHook(getCurrentProject(), L10N.getLocalString("msg.openproject_txt", "Open Project")))
            return;

        JFileChooser chooser = createFileChooser();
        chooser.setFileFilter(projectFileFilter);
        int result = chooseFileToOpen(chooser);

        if (result == JFileChooser.CANCEL_OPTION)
            return;
        try {
            File file = chooser.getSelectedFile();
            Project project = new Project();
            project.read(file.getPath());
            setProject(project);
            UserPreferences.getUserPreferences().useProject(file.getPath());
            rebuildRecentProjectsMenu();

        } catch (IOException e) {
            logger.logMessage(Logger.ERROR, MessageFormat.format( L10N.getLocalString("msg.couldnotopenproject_txt", "Could not open project: {0}"), new Object[]{e.getMessage()}));
        }
    }
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:24,代码来源:FindBugsFrame.java


示例5: openRecentProjectItemActionPerformed

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private void openRecentProjectItemActionPerformed(java.awt.event.ActionEvent evt) {
    if (!closeProjectHook(getCurrentProject(), L10N.getLocalString("msg.openproject_txt", "Open Project")))
        return;

    JMenuItem recentProjectItem = (JMenuItem) evt.getSource();
    File file = new File(recentProjectItem.getText());
    try {
        System.setProperty("user.dir", file.getParent());
        Project project = new Project();
        project.read(file.getPath());
        setProject(project);
        UserPreferences.getUserPreferences().useProject(file.getPath());
    } catch (IOException e) {
        UserPreferences.getUserPreferences().removeProject(file.getPath());
        logger.logMessage(Logger.ERROR, MessageFormat.format(L10N.getLocalString("msg.couldnotopenproject_txt", "Could not open project: {0}"), new Object[]{e.getMessage()}));
    } finally {
        rebuildRecentProjectsMenu();
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:20,代码来源:FindBugsFrame.java


示例6: execute

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Run the analysis.
 * This should be done in a separate thread (not the GUI event thread).
 * The progress callback can be used to update the user interface to
 * reflect the progress of the analysis.  The GUI may cancel the analysis
 * by interrupting the analysis thread, in which case InterruptedException
 * will be thrown by this method.
 *
 * @param progressCallback the progress callback
 * @throws IOException          if an I/O error occurs during the analysis
 * @throws InterruptedException if the analysis thread is interrupted
 */
public void execute(FindBugsProgress progressCallback) throws IOException, InterruptedException {
    findBugs.setProgressCallback(progressCallback);

    // Honor current UserPreferences
    findBugs.setUserPreferences(UserPreferences.getUserPreferences());

    // Set analysis feature settings
    findBugs.setAnalysisFeatureSettings(frame.getSettingList());

    // Run the analysis!
    findBugs.execute();

    if (!SystemProperties.getBoolean("findbugs.noSummary")) {
        // Get the summary!
        createSummary(reporter.getProjectStats());
    }

}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:31,代码来源:AnalysisRun.java


示例7: populateTable

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * populates the Detector JTable model with all available detectors
 * Due to Netbeans form builder, populate table gets called before the tablesorter is installed,
 * so it is correct for the model retrieved from the table to be assumed to be the base DefaultTableModel.
 */
private void populateTable() {
    Iterator<DetectorFactory> i = DetectorFactoryCollection.instance().factoryIterator();
    while (i.hasNext()) {
        DetectorFactory factory = i.next();
        if (factory.isHidden())
            continue;
        DefaultTableModel model = (DefaultTableModel) detectorTable.getModel();
        model.addRow(new Object[]{
                factory.getShortName(),
                factory.getSpeed(),
                UserPreferences.getUserPreferences().isDetectorEnabled(factory)
                    ? Boolean.TRUE : Boolean.FALSE
                });
        factoryList.add(factory);
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:22,代码来源:ConfigureDetectorsDialog.java


示例8: run

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
public void run(IProgressMonitor monitor) throws CoreException {
    UserPreferences userPrefs = FindbugsPlugin.getUserPreferences(project);
    ProjectFilterSettings filterSettings = userPrefs.getFilterSettings();
    IPreferenceStore store = FindbugsPlugin.getPluginPreferences(project);
    for (MarkerParameter mp : mpList) {
        if (mp.markerType == null) {
            continue;
        }
        if (!MarkerUtil.shouldDisplayWarning(mp.bug, filterSettings)) {
            continue;
        }
        updateMarkerSeverity(store, mp);
        // This triggers resource update on IResourceChangeListener's (BugTreeView)
        addMarker(mp);
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:17,代码来源:MarkerReporter.java


示例9: refreshUI

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
void refreshUI(UserPreferences prefs) {
    IPreferenceStore store = propertyPage.getPreferenceStore();
    scariestRankCombo.setText(MarkerSeverity.get(store.getString(FindBugsConstants.RANK_SCARIEST_MARKER_SEVERITY)).name());
    scaryRankCombo.setText(MarkerSeverity.get(store.getString(FindBugsConstants.RANK_SCARY_MARKER_SEVERITY)).name());
    troublingRankCombo.setText(MarkerSeverity.get(store.getString(FindBugsConstants.RANK_TROUBLING_MARKER_SEVERITY)).name());
    ofConcernRankCombo.setText(MarkerSeverity.get(store.getString(FindBugsConstants.RANK_OFCONCERN_MARKER_SEVERITY)).name());

    ProjectFilterSettings filterSettings = prefs.getFilterSettings();
    minRankSlider.setSelection(filterSettings.getMinRank());
    updateRankValueLabel();
    minPriorityCombo.setText(filterSettings.getMinPriority());
    for (Button checkBox : chkEnableBugCategoryList) {
        checkBox.setSelection(filterSettings.containsCategory((String) checkBox.getData()));
    }
    syncSelectedCategories();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:17,代码来源:ReportConfigurationTab.java


示例10: createDefaultUserPreferences

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
public static UserPreferences createDefaultUserPreferences() {
    UserPreferences prefs = UserPreferences.createDefaultUserPreferences();
    IPreferenceStore store = FindbugsPlugin.getDefault().getPreferenceStore();
    String categoriesStr = store.getString(DISABLED_CATEGORIES);
    Set<String> ids = decodeIds(categoriesStr);
    for (String categoryId : ids) {
        prefs.getFilterSettings().removeCategory(categoryId);
    }
    prefs.setRunAtFullBuild(false);

    // Do not need, as per default the factory default is used if key is
    // missing
    // TODO later we can use custom workspace settings to disable detectors
    // here
    // Iterator<DetectorFactory> iterator =
    // DetectorFactoryCollection.instance().factoryIterator();
    // while (iterator.hasNext()) {
    // DetectorFactory factory = iterator.next();
    // prefs.enableDetector(factory, factory.isDefaultEnabled());
    // }
    return prefs;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:23,代码来源:FindBugsPreferenceInitializer.java


示例11: getProjectPreferences

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Get project own preferences set.
 *
 * @param project
 *            must be non null, exist and be opened
 * @param forceRead
 * @return current project preferences, independently if project preferences
 *         are enabled or disabled for given project.
 */
public static UserPreferences getProjectPreferences(IProject project, boolean forceRead) {
    try {
        UserPreferences prefs = (UserPreferences) project.getSessionProperty(SESSION_PROPERTY_USERPREFS);
        if (prefs == null || forceRead) {
            prefs = readUserPreferences(project);
            if (prefs == null) {
                prefs = getWorkspacePreferences().clone();
            }
            project.setSessionProperty(SESSION_PROPERTY_USERPREFS, prefs);
        }
        return prefs;
    } catch (CoreException e) {
        FindbugsPlugin.getDefault().logException(e, "Error getting FindBugs preferences for project");
        return getWorkspacePreferences().clone();
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:26,代码来源:FindbugsPlugin.java


示例12: getWorkspacePreferences

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private static UserPreferences getWorkspacePreferences() {
    // create initially default settings
    UserPreferences userPrefs = FindBugsPreferenceInitializer.createDefaultUserPreferences();
    File prefsFile = WORKSPACE_PREFS_PATH.toFile();
    if (!prefsFile.isFile()) {
        return userPrefs;
    }
    // load custom settings over defaults
    FileInputStream in;
    try {
        in = new FileInputStream(prefsFile);
        userPrefs.read(in);
    } catch (IOException e) {
        FindbugsPlugin.getDefault().logException(e, "Error reading custom FindBugs preferences for workspace");
    }
    return userPrefs;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:FindbugsPlugin.java


示例13: readUserPreferences

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Read UserPreferences for project from the file in the project directory.
 * Returns null if the preferences have not been saved to a file, or if
 * there is an error reading the preferences file.
 *
 * @param project
 *            the project to get the UserPreferences for
 * @return the UserPreferences, or null if the UserPreferences file could
 *         not be read
 * @throws CoreException
 */
private static UserPreferences readUserPreferences(IProject project) throws CoreException {
    IFile userPrefsFile = getUserPreferencesFile(project);
    if (!userPrefsFile.exists()) {
        return null;
    }
    try {
        // force is preventing us for out-of-sync exception if file was
        // changed externally
        InputStream in = userPrefsFile.getContents(true);
        UserPreferences userPrefs = FindBugsPreferenceInitializer.createDefaultUserPreferences();
        userPrefs.read(in);
        return userPrefs;
    } catch (IOException e) {
        FindbugsPlugin.getDefault().logException(e, "Could not read user preferences for project");
        return null;
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:29,代码来源:FindbugsPlugin.java


示例14: loadFilesThatNeedFixing

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
public static void loadFilesThatNeedFixing() throws CoreException, IOException {
    makeJavaProject();

    TestingUtils.copyBrokenFiles(testIProject.getFolder(SRC_FOLDER_NAME), new File("classesToFix/"), new File("mockLibraries/"));

    // Compiles the code
    testIProject.refreshLocal(IResource.DEPTH_INFINITE, null);
    testIProject.build(IncrementalProjectBuilder.FULL_BUILD, null);

    FindbugsPlugin.setProjectSettingsEnabled(testIProject, null, true);
    UserPreferences userPrefs = FindbugsPlugin.getUserPreferences(testIProject);
    // enables categories like Security, which are disabled by default
    userPrefs.getFilterSettings().clearAllCategories();

    checkFBContribInstalled();
    checkFindSecurityBugsInstalled();

    TestingUtils.waitForUiEvents(100);
}
 
开发者ID:kjlubick,项目名称:fb-contrib-eclipse-quick-fixes,代码行数:20,代码来源:TestHarness.java


示例15: FindBugsFrame

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Creates new form FindBugsFrame.
 */
public FindBugsFrame() {
	String dirProp = System.getProperty("user.dir");
	
	if (dirProp != null) {
		currentDirectory = new File(dirProp);
	}
	
	UserPreferences prefs = UserPreferences.getUserPreferences();
	prefs.read();
	prefs.loadUserDetectorPreferences();
	
	initComponents();
	postInitComponents();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:FindBugsFrame.java


示例16: rebuildRecentProjectsMenu

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private void rebuildRecentProjectsMenu() {
	UserPreferences prefs = UserPreferences.getUserPreferences();
	final List<String> recentProjects = prefs.getRecentProjects();
	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			recentProjectsMenu.removeAll();
			java.awt.Font ft = new java.awt.Font("Dialog", 0, 12);
			if (recentProjects.size() == 0) {
				JMenuItem emptyItem = new JMenuItem(L10N.getLocalString("menu.empty_item", "Empty"));
				emptyItem.setFont(ft);
				emptyItem.setEnabled(false);
				recentProjectsMenu.add(emptyItem);
			} else {
				for (int i = 0; i < recentProjects.size(); i++) {
					JMenuItem projectItem = new JMenuItem(recentProjects.get(i));
					projectItem.setFont(ft);
					projectItem.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent evt) {
							openRecentProjectItemActionPerformed(evt);
						}
					});
					recentProjectsMenu.add(projectItem);
				}
			}
		}
	});
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:FindBugsFrame.java


示例17: exitFindBugs

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Exit the application.
 */
void exitFindBugs() {
	// TODO: offer to save work, etc.
	UserPreferences.getUserPreferences().storeUserDetectorPreferences();
	UserPreferences.getUserPreferences().write();
	System.exit(0);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:FindBugsFrame.java


示例18: createFindBugs

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
private FindBugs2 createFindBugs(Project project, BugCollectionBugReporter bugReporter) {
    final FindBugs2 findBugs = new FindBugs2();
    findBugs.setProject(project);
    findBugs.setBugReporter(bugReporter);
    findBugs.setDetectorFactoryCollection(DetectorFactoryCollection.instance());
    findBugs.setUserPreferences(UserPreferences.createDefaultUserPreferences());
    return findBugs;
}
 
开发者ID:nidi3,项目名称:code-assert,代码行数:9,代码来源:FindBugsAnalyzer.java


示例19: Project

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
/**
 * Create an anonymous project.
 */
public Project() {
    enabledPlugins = new HashMap<String,Boolean>();
    configuration = UserPreferences.createDefaultUserPreferences();
    analysisTargets = new LinkedList<String>();
    srcDirList = new LinkedList<String>();
    auxClasspathEntryList = new LinkedList<String>();
    isModified = false;
    currentWorkingDirectoryList = new ArrayList<File>();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:13,代码来源:Project.java


示例20: setUserPreferences

import edu.umd.cs.findbugs.config.UserPreferences; //导入依赖的package包/类
public void setUserPreferences(UserPreferences userPreferences) {
    this.analysisOptions.userPreferences = userPreferences;
    // TODO should set it here too, but gui2 seems to have issues with it
    // setAnalysisFeatureSettings(userPreferences.getAnalysisFeatureSettings());

    configureFilters(userPreferences);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:8,代码来源:FindBugs2.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java OnAddGeofencesResultListener类代码示例发布时间:2022-05-22
下一篇:
Java FileSystem类代码示例发布时间: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