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

Java IWorkspaceDescription类代码示例

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

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



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

示例1: toggleAutobuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
private void toggleAutobuild(final boolean enable) {
	if (isWorkbenchRunning()) {
		final IWorkspaceDescription workspaceDescription = getWorkspace().getDescription();
		if (null != workspaceDescription) {
			if (workspaceDescription.isAutoBuilding() != enable) {
				workspaceDescription.setAutoBuilding(enable);
				try {
					getWorkspace().setDescription(workspaceDescription);
				} catch (final CoreException e) {
					throw new IllegalStateException("Error while trying to turn workspace autobuild "
							+ (enable ? "on" : "off") + ".", e);
				}
			}
		}

	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:AbstractBuilderTest.java


示例2: setAutobuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean setAutobuild(final boolean autoBuildStatus) {
  synchronized (autoBuildMutex) {
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceDescription description = workspace.getDescription();
    boolean oldAutoBuildStatus = description.isAutoBuilding();
    if (oldAutoBuildStatus != autoBuildStatus) {
      description.setAutoBuilding(autoBuildStatus);
      try {
        workspace.setDescription(description);
      } catch (CoreException e) {
        throw new WrappedException("Failed to set workspace description", e);
      }
    }
    return oldAutoBuildStatus;
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:19,代码来源:XtextTestProjectManager.java


示例3: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * Sets the value of the workspace auto-build to the module auto-build 
 */
private void setAutoBuilding()
{
    boolean autoBuildModule = getPreferenceStore().getBoolean(IPreferenceConstants.I_PARSE_MODULE_ON_MODIFY);

    // set the workspace auto-build flag
    IWorkspaceDescription description = ResourcesPlugin.getWorkspace().getDescription();
    if (autoBuildModule != ResourcesPlugin.getWorkspace().isAutoBuilding())
    {
        try
        {
            description.setAutoBuilding(autoBuildModule);
            ResourcesPlugin.getWorkspace().setDescription(description);
        } catch (CoreException e)
        {
            // TODO
            e.printStackTrace();
        }
    }
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:23,代码来源:ParserPreferencePage.java


示例4: setUpSuite

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
@Override
public void setUpSuite() throws Exception {
	// ensure auto-building is turned off
       IWorkspaceDescription descr = getWorkspace().getDescription();
       if (descr.isAutoBuilding()) {
           descr.setAutoBuilding(false);
           getWorkspace().setDescription(descr);
       }
       try {
       	if (testProjects != null) {
       		for (String curPrj : testProjects) {
       			setUpJavaProject(curPrj);
			}
       	}
	}
       catch (NullPointerException ex) {
		throw new IllegalStateException("Test project has not been set properly!");
	}

	super.setUpSuite();
}
 
开发者ID:jwloka,项目名称:reflectify,代码行数:22,代码来源:FileBasedTest.java


示例5: toggleAutobuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
private static void toggleAutobuild(final boolean enabled) {
	final IWorkspace workspace = getWorkspace();
	final IWorkspaceDescription description = workspace.getDescription();
	description.setAutoBuilding(enabled);
	try {
		LOGGER.info("Turning auto-build " + (enabled ? "on" : "off") + "...");
		workspace.setDescription(description);
		LOGGER.info("Auto-build was successfully turned " + (enabled ? "on" : "off") + ".");
	} catch (final CoreException e) {
		throw new RuntimeException("Error while toggling auto-build", e);
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:AbstractIDEBUG_Test.java


示例6: setAutobuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/** Sets workspace auto-build according to the provided flag. Thrown exceptions are handled by logging. */
private static void setAutobuild(boolean on) {
	try {
		final IWorkspace workspace = getWorkspace();
		final IWorkspaceDescription description = workspace.getDescription();
		description.setAutoBuilding(on);
		workspace.setDescription(description);
	} catch (CoreException e) {
		LOGGER.debug("Organize imports cannot set auto build to " + on + ".");
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:N4JSOrganizeImportsHandler.java


示例7: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * @param value
 */
public static void setAutoBuilding(boolean value) {
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	if (workspace.isAutoBuilding() == value)
		return;
	IWorkspaceDescription desc = workspace.getDescription();
	desc.setAutoBuilding(value);
	try {
		workspace.setDescription(desc);
	} catch (CoreException e) {
		ResourceManager.logException(e);
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:ResourceManager.java


示例8: isAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * @return
 */
public static boolean isAutoBuilding() {
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	IWorkspaceDescription desc = workspace.getDescription();
	return desc.isAutoBuilding();

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:ResourceManager.java


示例9: configWorkspace

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
private void configWorkspace(IWorkspace workspace) {
	IWorkspaceDescription workspaceDesc = workspace.getDescription();
	workspaceDesc.setAutoBuilding(false); // we do not want the workspace to rebuild the project every time a new resource is added
	try {
		workspace.setDescription(workspaceDesc);
	} catch (CoreException exc) {
		Activator.log(IStatus.ERROR, "Error trying to set workspace description: " + exc.getMessage());
	}

}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:11,代码来源:VerveineCParser.java


示例10: turnOffAutoBuildIfOn

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * Turns off the automatic build feature of the workbench if it is currently switched on and
 * returns {@code true} when this was the case.
 * 
 * @return whether autobuild was on
 * @throws CoreException
 *             if the feature could not be set
 */
public static boolean turnOffAutoBuildIfOn() throws CoreException {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    final IWorkspaceDescription description = workspace.getDescription();
    if (description.isAutoBuilding()) {
        description.setAutoBuilding(false);
        workspace.setDescription(description);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:vitruv-tools,项目名称:Vitruv,代码行数:20,代码来源:EclipseBridge.java


示例11: turnOnAutoBuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * Turns on the automatic build feature of the workbench.
 * 
 * @throws CoreException
 *             if the feature could not be set
 */
public static void turnOnAutoBuild() throws CoreException {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    final IWorkspaceDescription description = workspace.getDescription();
    if (!description.isAutoBuilding()) {
        description.setAutoBuilding(true);
        workspace.setDescription(description);
    }
}
 
开发者ID:vitruv-tools,项目名称:Vitruv,代码行数:15,代码来源:EclipseBridge.java


示例12: disableAutoBuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
private void disableAutoBuild() throws CoreException {
	IWorkspaceDescription desc = workspace.getDescription();
	if (desc.isAutoBuilding()) {
		isAutoBuildActivated = true;
		desc.setAutoBuilding(false);
		workspace.setDescription(desc);
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:9,代码来源:OrccCodeAnalysisCli.java


示例13: restoreAutoBuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
private void restoreAutoBuild() throws CoreException {
	if (isAutoBuildActivated) {
		IWorkspaceDescription desc = workspace.getDescription();
		desc.setAutoBuilding(true);
		workspace.setDescription(desc);
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:8,代码来源:OrccCodeAnalysisCli.java


示例14: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
public boolean setAutoBuilding(boolean enable) throws CoreException {
	IWorkspace workspace = ResourcesPlugin.getWorkspace();
	IWorkspaceDescription description = workspace.getDescription();
	boolean changed = description.isAutoBuilding() != enable;
	if (changed) {
		description.setAutoBuilding(enable);
		workspace.setDescription(description);
	}
	return changed;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:11,代码来源:ProjectsManager.java


示例15: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
public static void setAutoBuilding(boolean enabled) throws CoreException {
	IWorkspaceDescription wsd = getWorkspace().getDescription();
	if (!wsd.isAutoBuilding() == enabled) {
		wsd.setAutoBuilding(enabled);
		getWorkspace().setDescription(wsd);
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:8,代码来源:StsTestUtil.java


示例16: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
 * Enables or disables automatic building of projects.
 */
public static void setAutoBuilding(boolean enable) throws CoreException {
  IWorkspaceDescription desc = ResourcesPlugin.getWorkspace().getDescription();
  if (desc.isAutoBuilding() != enable) {
    desc.setAutoBuilding(enable);
    ResourcesPlugin.getWorkspace().setDescription(desc);
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:11,代码来源:ProjectTestUtil.java


示例17: setUp

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Before
public void setUp() throws Exception {
	workspace = ResourcesPlugin.getWorkspace();

	// Turn off auto building
	IWorkspaceDescription description = workspace.getDescription();
	description.setAutoBuilding(false);
	workspace.setDescription(description);

	// Turn off index updating
	IEclipsePreferences store = new DefaultScope().getNode(IMavenConstants.PLUGIN_ID);
	store.putBoolean(MavenPreferenceConstants.P_UPDATE_INDEXES, false);

	mavenConfiguration = MavenPlugin.getMavenConfiguration();

	if (settingsFile != null) {
		oldUserSettingsFile = mavenConfiguration.getUserSettingsFile();
		File settings = new File(settingsFile).getCanonicalFile();
		if (settings.canRead()) {
			String userSettingsFile = settings.getAbsolutePath();
			System.out.println("Setting user settings file: " + userSettingsFile);
			mavenConfiguration.setUserSettingsFile(userSettingsFile);
		} else {
			fail("User settings file cannot be read: " + settings);
		}
	}

	cleanWorkspace();
	waitForJobs();

}
 
开发者ID:maven-nar,项目名称:m2e-nar,代码行数:33,代码来源:AbstractTestBuild.java


示例18: setAutoBuilding

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
/**
* Sets whether building automatically is enabled in the workspace or not and returns the old
* value.
* 
* @param state <code>true</code> if automatically building is enabled, <code>false</code>
*            otherwise
* @return the old state
* @throws CoreException thrown if the operation failed
*/
  public static boolean setAutoBuilding(boolean state) throws CoreException {
      IWorkspace workspace= ResourcesPlugin.getWorkspace();
      IWorkspaceDescription desc= workspace.getDescription();
      boolean isAutoBuilding= desc.isAutoBuilding();
      if (isAutoBuilding != state) {
          desc.setAutoBuilding(state);
          workspace.setDescription(desc);
      }
      return isAutoBuilding;
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:CoreUtility.java


示例19: enableAutobuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
public static void enableAutobuild(boolean enable) throws CoreException {
	// disable auto build
	IWorkspace workspace= CTestPlugin.getWorkspace();
	IWorkspaceDescription desc= workspace.getDescription();
	desc.setAutoBuilding(enable);
	workspace.setDescription(desc);
}
 
开发者ID:magicsky,项目名称:sya,代码行数:8,代码来源:CTestPlugin.java


示例20: switchAutoBuild

import org.eclipse.core.resources.IWorkspaceDescription; //导入依赖的package包/类
protected void switchAutoBuild(boolean bool) {
    IWorkspace ws = ResourcesPlugin.getWorkspace();
    IWorkspaceDescription desc = ws.getDescription();
    desc.setAutoBuilding(bool);
    try {
        ws.setDescription(desc);
    } catch (CoreException e) {
        System.err.println("Unable to disable auto building: " + e.getMessage());
        e.printStackTrace();
    }
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:12,代码来源:SimpleTestCase.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SpringBus类代码示例发布时间:2022-05-21
下一篇:
Java JobParametersInvalidException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap