本文整理匯總了Java中org.eclipse.core.resources.IWorkspace.getDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java IWorkspace.getDescription方法的具體用法?Java IWorkspace.getDescription怎麽用?Java IWorkspace.getDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IWorkspace
的用法示例。
在下文中一共展示了IWorkspace.getDescription方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAutobuild
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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;
}
}
示例2: toggleAutobuild
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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);
}
}
示例3: setAutobuild
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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 + ".");
}
}
示例4: setAutoBuilding
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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);
}
}
示例5: isAutoBuilding
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的package包/類
/**
* @return
*/
public static boolean isAutoBuilding() {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription desc = workspace.getDescription();
return desc.isAutoBuilding();
}
示例6: configWorkspace
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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());
}
}
示例7: turnOffAutoBuildIfOn
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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;
}
}
示例8: turnOnAutoBuild
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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);
}
}
示例9: setAutoBuilding
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的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;
}
示例10: setWorkspaceAutoBuild
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的package包/類
public static void setWorkspaceAutoBuild(boolean flag) throws CoreException {
IWorkspace workspace = getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(flag);
workspace.setDescription(description);
}
示例11: isWorkspaceAutoBuildEnabled
import org.eclipse.core.resources.IWorkspace; //導入方法依賴的package包/類
public static boolean isWorkspaceAutoBuildEnabled() throws CoreException {
IWorkspace workspace = getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
return description.isAutoBuilding();
}