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


Java ProjectScope.getNode方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.ProjectScope.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectScope.getNode方法的具体用法?Java ProjectScope.getNode怎么用?Java ProjectScope.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.ProjectScope的用法示例。


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

示例1: build

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
@Override
protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map args,
		IProgressMonitor monitor) throws CoreException {
	ProjectScope projectScope = new ProjectScope(getProject());
	IEclipsePreferences prefs = projectScope.getNode(BUILDER_ID);
	if (kind == FULL_BUILD) {
		fullBuild(prefs, monitor);
	} else {
		IResourceDelta delta = getDelta(getProject());
		if (delta == null) {
			fullBuild(prefs, monitor);
		} else {
			incrementalBuild(delta, prefs, monitor);
		}
	}
	return null;
}
 
开发者ID:mnlipp,项目名称:EclipseMinifyBuilder,代码行数:18,代码来源:MinifyBuilder.java

示例2: getActiveUserAgentIDs

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
/**
 * Given a project, return the list of active user agent IDs. The current implementation processes only the first
 * (primary) nature ID of the given project. Secondary natures may be taken into consideration at a later point in
 * time
 * 
 * @param project
 *            An {@link IProject}.
 * @return Returns an array of user agent IDs for the main mature of the given project. In case the given project is
 *         null, an empty string array is returned.
 */
public String[] getActiveUserAgentIDs(IProject project)
{
	if (project == null)
	{
		return ArrayUtil.NO_STRINGS;
	}
	// Extract the natures from the given project
	String[] natureIDs = getProjectNatures(project);

	// Look at the project-scope preferences for the active agents.
	ProjectScope scope = new ProjectScope(project);
	IEclipsePreferences node = scope.getNode(CommonEditorPlugin.PLUGIN_ID);
	if (node != null)
	{
		String agents = node.get(IPreferenceConstants.USER_AGENT_PREFERENCE, null);
		if (agents != null)
		{
			Map<String, String[]> userAgents = extractUserAgents(agents);
			return getActiveUserAgentIDs(userAgents, natureIDs);
		}
	}
	// In case we did not find any project-specific settings, use the project's nature IDs to grab the agents that
	// were set in the workspace settings.
	return getActiveUserAgentIDs(natureIDs);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:36,代码来源:UserAgentManager.java

示例3: hasChanged

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
/**
 * @return
 * @throws BackingStoreException 
 */
public boolean hasChanged(boolean resetModifiedTimestamp) throws BackingStoreException  {

	ProjectScope ps = new ProjectScope(project);
	IEclipsePreferences prefs = ps.getNode( Activator.getId() );
	
	String key = this.filename;
	Long value = prefs.getLong(key, 0);
	
	Long current_ts = getFileModTime();
	
	if(resetModifiedTimestamp) {
		prefs.putLong(key, current_ts);
		prefs.flush();
	}
	
	if(value.longValue() == current_ts.longValue()) {
		return false;
	}
	else {
		return true;
	}
}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:27,代码来源:CompileCmdsHandler.java

示例4: addNature

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public void addNature(IProgressMonitor progressMonitor, IProject project) throws CoreException {
    ProjectScope scope = new ProjectScope(project);
    try {
        IEclipsePreferences prefs = scope.getNode(TeaVMEclipsePlugin.ID);
        prefs.flush();
        settingsMap.put(project, new PreferencesBasedTeaVMProjectSettings(project, prefs));
    } catch (BackingStoreException e) {
        throw new RuntimeException("Error creating preferences", e);
    }
    IProjectDescription projectDescription = project.getDescription();
    String[] natureIds = projectDescription.getNatureIds();
    natureIds = Arrays.copyOf(natureIds, natureIds.length + 1);
    natureIds[natureIds.length - 1] = TeaVMEclipsePlugin.NATURE_ID;
    projectDescription.setNatureIds(natureIds);
    project.setDescription(projectDescription, progressMonitor);
}
 
开发者ID:konsoletyper,项目名称:teavm,代码行数:17,代码来源:TeaVMEclipsePlugin.java

示例5: getProjectPreferences

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
/**
    * Retrieves project preference node
    * @param project 
    * @return
    */
private static IEclipsePreferences getProjectPreferences(IProject project)
   {
       if (project == null ) 
       {
           return null;
       }
       ProjectScope scope = new ProjectScope(project);
       
       
       //store.get
       
       IEclipsePreferences projectNode = scope.getNode(Activator.PLUGIN_ID);
       return projectNode;
   }
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:20,代码来源:PreferenceStoreHelper.java

示例6: save

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public boolean save(IProject project, List<IResource> items) {
	ProjectScope projectScope = getPreferenceScope(project);
	IEclipsePreferences node = projectScope.getNode(SCT_RESOURCE_NODE);

	String blacklist = getBlacklistValue(items);
	node.put(SCT_BLACKLIST_KEY, blacklist);
	try {
		node.flush();
	} catch (BackingStoreException e) {
		e.printStackTrace();
		return false;
	}
	return true;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:15,代码来源:DefaultResourceBlacklist.java

示例7: hasProjectSpecificOptions

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
@Override
protected boolean hasProjectSpecificOptions(IProject project)
{
	ProjectScope scope = new ProjectScope(project);
	IEclipsePreferences node = scope.getNode(CommonEditorPlugin.PLUGIN_ID);
	if (node != null)
	{
		return node.get(com.aptana.editor.common.contentassist.IPreferenceConstants.USER_AGENT_PREFERENCE, null) != null;
	}
	return false;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:12,代码来源:ContentAssistPreferencePage.java

示例8: getSettingEntries

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {

		//		PerProjectSettings projSettings = null;
		if(cfgDescription == null || rc == null) {
			return null;
		}
		
		IProject proj = rc.getProject();
		CMakeSettings cms = Activator.getDefault().getSettings();
		if(proj != null) {
			CompileCmdsHandler cmdHdl = cms.getCompileCmds(proj, cfgDescription.getName());
			if(cmdHdl != null) {
				try {
					ProjectScope ps = new ProjectScope(proj);
					IEclipsePreferences prefs = ps.getNode( Activator.getId() );
					
					String key = "LangSetProv/" + cmdHdl.getFilename();
					Long value = prefs.getLong(key, 0);

					Long current_ts = cmdHdl.getFileModTime();

					
					if( value.longValue() != current_ts.longValue() ) {
						parseCompileComands(proj, cfgDescription, cmdHdl );

						prefs.putLong(key, current_ts);
						prefs.flush();
					}
				} catch (org.osgi.service.prefs.BackingStoreException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

	
		List<ICLanguageSettingEntry> entries = null;
		entries = m_commandParser.getSettingEntries(cfgDescription, rc, languageId);
		return entries;
	}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:41,代码来源:CMakeLangSetProvider.java

示例9: getPreferences

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public static IEclipsePreferences getPreferences(IProject project) {
	if (project == null) {
		return null;
	}
	ProjectScope projectScope = new ProjectScope(project);
	IEclipsePreferences node = projectScope
			.getNode(Constants.PLUGIN_PREFIX);
	return node;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:10,代码来源:Utils.java

示例10: getProjectPreferences

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public IEclipsePreferences getProjectPreferences(IProject project) {
	ProjectScope ps = new ProjectScope(project);
	return ps.getNode(PLUGIN_ID);
}
 
开发者ID:gossi,项目名称:eclipse-transpiler-plugin,代码行数:5,代码来源:TranspilerPlugin.java

示例11: getPreferences

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
protected IEclipsePreferences getPreferences(IProject project) {
    ProjectScope projectScope = new ProjectScope(project);
    IEclipsePreferences node = projectScope.getNode(ForceIdeCorePlugin.getPluginId());
    return node;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:6,代码来源:ProjectService.java

示例12: preferences

import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
/**
 * Returns the plugin's project scoped preferences using the given 
 * resource to identify the project.
 * 
 * @param resource a resource from the project
 * @return the preferences
 */
public static Preferences preferences(IResource resource) {
	ProjectScope projectScope = new ProjectScope(resource.getProject());
	return projectScope.getNode(MinifyBuilder.BUILDER_ID);
}
 
开发者ID:mnlipp,项目名称:EclipseMinifyBuilder,代码行数:12,代码来源:PrefsAccess.java


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