当前位置: 首页>>代码示例>>Java>>正文


Java IWorkspaceDescription类代码示例

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


IWorkspaceDescription类属于org.eclipse.core.resources包,在下文中一共展示了IWorkspaceDescription类的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);
				}
			}
		}

	}
}
 
开发者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


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