本文整理汇总了Java中org.eclipse.core.resources.IWorkspaceDescription.setAutoBuilding方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkspaceDescription.setAutoBuilding方法的具体用法?Java IWorkspaceDescription.setAutoBuilding怎么用?Java IWorkspaceDescription.setAutoBuilding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IWorkspaceDescription
的用法示例。
在下文中一共展示了IWorkspaceDescription.setAutoBuilding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
}
}
示例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;
}
}
示例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();
}
}
}
示例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();
}
示例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);
}
}
示例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 + ".");
}
}
示例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);
}
}
示例8: 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());
}
}
示例9: 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;
}
}
示例10: 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);
}
}
示例11: 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);
}
}
示例12: 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);
}
}
示例13: 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;
}
示例14: 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);
}
}
示例15: 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);
}
}