本文整理汇总了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;
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: getProjectPreferences
import org.eclipse.core.resources.ProjectScope; //导入方法依赖的package包/类
public IEclipsePreferences getProjectPreferences(IProject project) {
ProjectScope ps = new ProjectScope(project);
return ps.getNode(PLUGIN_ID);
}
示例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;
}
示例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);
}