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


Java IProjectDescription.newCommand方法代碼示例

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


在下文中一共展示了IProjectDescription.newCommand方法的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: 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

示例3: createProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
protected void createProject ( final IProgressMonitor monitor ) throws CoreException
{
    monitor.beginTask ( "Create project", 2 );

    final IProject project = this.info.getProject ();

    final IProjectDescription desc = project.getWorkspace ().newProjectDescription ( project.getName () );
    desc.setLocation ( this.info.getProjectLocation () );
    desc.setNatureIds ( new String[] { Constants.PROJECT_NATURE_CONFIGURATION, PROJECT_NATURE_JS } );

    final ICommand jsCmd = desc.newCommand ();
    jsCmd.setBuilderName ( BUILDER_JS_VALIDATOR );

    final ICommand localBuilder = desc.newCommand ();
    localBuilder.setBuilderName ( Constants.PROJECT_BUILDER );

    desc.setBuildSpec ( new ICommand[] { jsCmd, localBuilder } );

    if ( !project.exists () )
    {
        project.create ( desc, new SubProgressMonitor ( monitor, 1 ) );
        project.open ( new SubProgressMonitor ( monitor, 1 ) );
    }
    monitor.done ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:CreateProjectOperation.java

示例4: createFeatureProject

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
private void createFeatureProject ( final IProject project, final Map<String, String> properties, final IProgressMonitor monitor ) throws CoreException
{
    monitor.beginTask ( "Creating feature project", 6 );

    final String name = this.pluginId + ".feature"; //$NON-NLS-1$
    final IProjectDescription desc = project.getWorkspace ().newProjectDescription ( name );

    final ICommand featureBuilder = desc.newCommand ();
    featureBuilder.setBuilderName ( "org.eclipse.pde.FeatureBuilder" ); //$NON-NLS-1$

    desc.setNatureIds ( new String[] { "org.eclipse.pde.FeatureNature" } ); //$NON-NLS-1$
    desc.setBuildSpec ( new ICommand[] {
            featureBuilder
    } );

    final IProject newProject = project.getWorkspace ().getRoot ().getProject ( name );
    newProject.create ( desc, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    newProject.open ( new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1

    addFilteredResource ( newProject, "pom.xml", getResource ( "feature-pom.xml" ), "UTF-8", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "feature.xml", getResource ( "feature/feature.xml" ), "UTF-8", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "feature.properties", getResource ( "feature/feature.properties" ), "ISO-8859-1", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1
    addFilteredResource ( newProject, "build.properties", getResource ( "feature/build.properties" ), "ISO-8859-1", properties, new SubProgressMonitor ( monitor, 1 ) ); // COUNT:1

    monitor.done ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:27,代碼來源:ClientTemplate.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: addBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
public static void addBuilder(final IProject project) {
    try {
        // verify already registered builders
        if (hasBuilder(project)) {
            // already enabled
            return;
        }
        // add builder to project properties
        IProjectDescription description = project.getDescription();
        final ICommand buildCommand = description.newCommand();
        buildCommand.setBuilderName(BUILDER.ID);

        final List<ICommand> commands = new ArrayList<ICommand>();
        commands.addAll(Arrays.asList(description.getBuildSpec()));
        commands.add(buildCommand);

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

示例7: 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

示例8: 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

示例9: 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(ClassCleanerBuilder.BUILDER_ID)) {
			return;
		}
	}

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

示例10: 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

示例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(VirtualRootNewFilesToRealRootProjectBuilder.BUILDER_ID)) {
			return;
		}
	}

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

示例12: addAppEngineWebBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
/**
 * Add our {@code appengine-web.xml} builder that monitors for changes to the {@code <runtime>}
 * element.
 */
private void addAppEngineWebBuilder(IProject project) {
  try {
    IProjectDescription projectDescription = project.getDescription();
    ICommand[] commands = projectDescription.getBuildSpec();
    for (int i = 0; i < commands.length; i++) {
      if (AppEngineWebBuilder.BUILDER_ID.equals(commands[i].getBuilderName())) {
        return;
      }
    }
    ICommand[] newCommands = new ICommand[commands.length + 1];
    // Add it after other builders.
    System.arraycopy(commands, 0, newCommands, 0, commands.length);
    // add builder to project
    ICommand command = projectDescription.newCommand();
    command.setBuilderName(AppEngineWebBuilder.BUILDER_ID);
    newCommands[commands.length] = command;
    projectDescription.setBuildSpec(newCommands);
    project.setDescription(projectDescription, null);
    logger.finer(project + ": added AppEngineWebBuilder");
  } catch (CoreException ex) {
    logger.log(Level.SEVERE, "Unable to add builder for " + project, ex);
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:28,代碼來源:AppEngineStandardFacetChangeListener.java

示例13: addBuilder

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
/**
 * Add a builder to the project.
 * 
 * @param id id of the builder to add
 * @throws CoreException
 */
private void addBuilder(String id) throws CoreException {

    IProjectDescription desc = project.getDescription();
    ICommand[] commands = desc.getBuildSpec();

    if (!hasBuilder(commands, id)) {

        ICommand command = desc.newCommand();
        command.setBuilderName(id);
        ICommand[] newCommands = new ICommand[commands.length + 1];

        System.arraycopy(commands, 0, newCommands, 1, commands.length);
        newCommands[0] = command;
        desc.setBuildSpec(newCommands);

        project.setDescription(desc, null);
    }
}
 
開發者ID:eclipse,項目名稱:texlipse,代碼行數:25,代碼來源:TexlipseNature.java

示例14: configure

import org.eclipse.core.resources.IProjectDescription; //導入方法依賴的package包/類
@Override
public void configure() throws CoreException {
	// Setup the builder
	IProjectDescription desc = project.getDescription();
	ICommand[] builders = desc.getBuildSpec();
	ICommand[] newBuilders = new ICommand[builders.length + 1];
	System.arraycopy(builders, 0, newBuilders, 0, builders.length);

	ICommand androidBuilder = desc.newCommand();
	androidBuilder.setBuilderName(AndroidBuilder.ID);
	// We don't autobuild.
	androidBuilder.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
	newBuilders[builders.length] = androidBuilder;
	desc.setBuildSpec(newBuilders);

	project.setDescription(desc, 0, new NullProgressMonitor());
}
 
開發者ID:dschaefer,項目名稱:andmore2,代碼行數:18,代碼來源:AndroidNature.java

示例15: 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(StandardTsvBuilder.BUILDER_ID)) {
			return;
		}
	}

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


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