本文整理汇总了Java中org.eclipse.core.resources.IWorkspaceDescription.isAutoBuilding方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkspaceDescription.isAutoBuilding方法的具体用法?Java IWorkspaceDescription.isAutoBuilding怎么用?Java IWorkspaceDescription.isAutoBuilding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IWorkspaceDescription
的用法示例。
在下文中一共展示了IWorkspaceDescription.isAutoBuilding方法的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: 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();
}
示例4: isAutoBuilding
import org.eclipse.core.resources.IWorkspaceDescription; //导入方法依赖的package包/类
/**
* @return
*/
public static boolean isAutoBuilding() {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription desc = workspace.getDescription();
return desc.isAutoBuilding();
}
示例5: 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;
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: 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;
}
示例9: 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);
}
}
示例10: 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);
}
}
示例11: 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;
}
示例12: run
import org.eclipse.core.resources.IWorkspaceDescription; //导入方法依赖的package包/类
@Override
public void run(final IAction action) {
if (selection == null || selection.isEmpty()) {
return;
}
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
if (!description.isAutoBuilding() && getClass().equals(FindBugsAction.class)) {
boolean confirm = MessageDialog.openConfirm(null, "Project -> 'Build Automatically' disabled",
"You are going to run FindBugs analysis on a not compiled or partially compiled project.\n\n"
+ "To get reliable analysis results, you should make sure that project is compiled first.\n\n"
+ "Continue with FindBugs analysis?");
if (!confirm) {
return;
}
}
if (selection instanceof IStructuredSelection) {
IStructuredSelection sSelection = (IStructuredSelection) selection;
dialogAlreadyShown = false;
Map<IProject, List<WorkItem>> projectMap = ResourceUtils.getResourcesPerProject(sSelection);
for (Map.Entry<IProject, List<WorkItem>> e : projectMap.entrySet()) {
work(targetPart, e.getKey(), e.getValue());
}
targetPart = null;
selection = null;
}
}
示例13: 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;
}
示例14: setUpSuite
import org.eclipse.core.resources.IWorkspaceDescription; //导入方法依赖的package包/类
public void setUpSuite() throws Exception {
super.setUpSuite();
// ensure autobuilding is turned off
IWorkspaceDescription description = getWorkspace().getDescription();
if (description.isAutoBuilding()) {
description.setAutoBuilding(false);
getWorkspace().setDescription(description);
}
}
示例15: isWorkspaceAutoBuildEnabled
import org.eclipse.core.resources.IWorkspaceDescription; //导入方法依赖的package包/类
public static boolean isWorkspaceAutoBuildEnabled() throws CoreException {
IWorkspace workspace = getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
return description.isAutoBuilding();
}