當前位置: 首頁>>代碼示例>>Java>>正文


Java IProjectDescription.getBuildSpec方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IProjectDescription.getBuildSpec方法的典型用法代碼示例。如果您正苦於以下問題:Java IProjectDescription.getBuildSpec方法的具體用法?Java IProjectDescription.getBuildSpec怎麽用?Java IProjectDescription.getBuildSpec使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IProjectDescription的用法示例。


在下文中一共展示了IProjectDescription.getBuildSpec方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(MinifyBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(MinifyBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
開發者ID:mnlipp,項目名稱:EclipseMinifyBuilder,代碼行數:20,代碼來源:MinifyNature.java

示例2: deconfigure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void deconfigure() throws CoreException {
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(MinifyBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			return;
		}
	}
}
 
開發者ID:mnlipp,項目名稱:EclipseMinifyBuilder,代碼行數:17,代碼來源:MinifyNature.java

示例3: configure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GemocSequentialLanguageBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(GemocSequentialLanguageBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:19,代碼來源:GemocSequentialLanguageNature.java

示例4: removeBuilderFromProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
public static void removeBuilderFromProject(IProjectDescription description)
{
	// Look for builder.
	int index = -1;
	ICommand[] cmds = description.getBuildSpec();
	for( int j = 0; j < cmds.length; j++ )
	{
		if( cmds[j].getBuilderName().equals(BUILDER_ID) )
		{
			index = j;
			break;
		}
	}
	if( index == -1 )
		return;

	// Remove builder from project.
	List<ICommand> newCmds = new ArrayList<ICommand>();
	newCmds.addAll(Arrays.asList(cmds));
	newCmds.remove(index);
	description.setBuildSpec(newCmds.toArray(new ICommand[newCmds.size()]));
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:23,代碼來源:JPFManifestBuilder.java

示例5: setBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
/**
 * Set the GW4E builder
 * 
 * @param project
 * @param monitor
 * @throws CoreException
 */
public static void setBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(GW4EBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:26,代碼來源:ClasspathManager.java

示例6: unsetBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
/**
 * Remove the GW4E builder
 * 
 * @param project
 * @param monitor
 * @throws CoreException
 */
public static void unsetBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
	IProjectDescription description = project.getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			GW4EBuilder.removeProjectProblemMarker(project, monitor);
			return;
		}
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:23,代碼來源:ClasspathManager.java

示例7: testUnsetBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Test
public void testUnsetBuilder() throws Exception {
	IJavaProject p = ProjectHelper.getProject(PROJECT_NAME);
	ClasspathManager.setBuilder(p.getProject(), null);
	IProjectDescription desc = p.getProject().getDescription();
	ICommand[] commands = desc.getBuildSpec();
	boolean found = false;
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			found=true;
		}
	}
	assertTrue(found);
	ClasspathManager.unsetBuilder(p.getProject(), null);
	desc = p.getProject().getDescription();
	commands = desc.getBuildSpec();
	found = false;
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(GW4EBuilder.BUILDER_ID)) {
			found=true;
		}
	}
	assertFalse(found);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:25,代碼來源:ClasspathManagerTest.java

示例8: removeBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
public static void removeBuilder(final IProject project) {
    try {
        final IProjectDescription description = project
                .getDescription();
        final List<ICommand> commands = new ArrayList<ICommand>();
        commands.addAll(Arrays.asList(description.getBuildSpec()));

        for (final ICommand buildSpec : description.getBuildSpec()) {
            if (BUILDER.ID.equals(buildSpec.getBuilderName())) {
                // remove builder
                commands.remove(buildSpec);
            }
        }

        description.setBuildSpec(commands.toArray(new ICommand[commands.size()]));
        project.setDescription(description, null);
    } catch (final CoreException e) {
        Log.log(Log.LOG_ERROR, "Cannot remove builder", e); //$NON-NLS-1$
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:21,代碼來源:RemoveBuilder.java

示例9: addBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
protected void addBuilder(String builderId) throws CoreException 
{
	IProjectDescription desc = _project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(builderId)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(builderId);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	_project.setDescription(desc, null);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:20,代碼來源:AbstractProjectNature.java

示例10: removeBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
protected void removeBuilder(String builderId) throws CoreException
{
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(builderId)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			_project.setDescription(description, null);			
			return;
		}
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:17,代碼來源:AbstractProjectNature.java

示例11: configure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(JimpleBuilder.BUILDER_ID)) {
			return;
		}
	}

	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 0, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(JimpleBuilder.BUILDER_ID);
	newCommands[newCommands.length - 1] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:20,代碼來源:VisuFlowNature.java

示例12: deconfigure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void deconfigure() throws CoreException {
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(JimpleBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			return;
		}
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:17,代碼來源:VisuFlowNature.java

示例13: deconfigure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void deconfigure() throws CoreException {
	IProjectDescription description = getProject().getDescription();
	ICommand[] commands = description.getBuildSpec();
	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(ClassCleanerBuilder.BUILDER_ID)) {
			ICommand[] newCommands = new ICommand[commands.length - 1];
			System.arraycopy(commands, 0, newCommands, 0, i);
			System.arraycopy(commands, i + 1, newCommands, i,
					commands.length - i - 1);
			description.setBuildSpec(newCommands);
			project.setDescription(description, null);
			return;
		}
	}
}
 
開發者ID:CenterDevice,項目名稱:ClassCleaner,代碼行數:17,代碼來源:ClassCleanerNature.java

示例14: configure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override 
public void configure() throws CoreException {
	IProjectDescription desc = project.getDescription();
	ICommand[] commands = desc.getBuildSpec();

	for (int i = 0; i < commands.length; ++i) {
		if (commands[i].getBuilderName().equals(JasonBuilder.BUILDER_ID)) {
			return;
		}
	}
	
	ICommand[] newCommands = new ICommand[commands.length + 1];
	System.arraycopy(commands, 0, newCommands, 1, commands.length);
	ICommand command = desc.newCommand();
	command.setBuilderName(JasonBuilder.BUILDER_ID);
	newCommands[0] = command;
	desc.setBuildSpec(newCommands);
	project.setDescription(desc, null);
}
 
開發者ID:jason-lang,項目名稱:jason-eclipse-plugin,代碼行數:20,代碼來源:JasonNature.java

示例15: execute

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
	final IProject project = AddBuilder.getProject(event);
	if (project != null) {
		try {
			final IProjectDescription description = project.getDescription();
			final List<ICommand> commands = new ArrayList<ICommand>();
			commands.addAll(Arrays.asList(description.getBuildSpec()));

			for (final ICommand buildSpec : description.getBuildSpec()) {
				if (SolidityBuilder.BUILDER_ID.equals(buildSpec.getBuilderName())) {
					// remove builder
					commands.remove(buildSpec);
				}
			}

			description.setBuildSpec(commands.toArray(new ICommand[commands.size()]));
			project.setDescription(description, null);
		} catch (final CoreException e) {
			Activator.logError("Error removing solc builder.", e);
		}
	}

	return null;
}
 
開發者ID:UrsZeidler,項目名稱:uml2solidity,代碼行數:26,代碼來源:RemoveBuilder.java


注:本文中的org.eclipse.core.resources.IProjectDescription.getBuildSpec方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。