mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Added default world files to examples.
This saves a step and prevents one of the biggest user errors with the pacgoat example. Change-Id: Icdceb1da37c4b456f1a34daa815f3bbe2a47e18e
This commit is contained in:
@@ -166,6 +166,7 @@
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
<package>src/$package-dir/commands</package>
|
||||
@@ -198,6 +199,7 @@
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
</tags>
|
||||
<world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
<package>src/$package-dir/commands</package>
|
||||
|
||||
@@ -7,16 +7,17 @@ import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.java.wizards.newproject.JavaProjectType;
|
||||
|
||||
public class ExampleJavaProject extends JavaProjectType implements IExampleProject {
|
||||
private String name, description;
|
||||
private String name, description, world;
|
||||
private List<String> tags;
|
||||
private List<String> packages;
|
||||
private List<ExportFile> files;
|
||||
|
||||
public ExampleJavaProject(String name, String description, List<String> tags,
|
||||
List<String> packages, List<ExportFile> files) {
|
||||
String world, List<String> packages, List<ExportFile> files) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.tags = tags;
|
||||
this.world = world;
|
||||
this.packages = packages;
|
||||
this.files = files;
|
||||
}
|
||||
@@ -32,6 +33,10 @@ public class ExampleJavaProject extends JavaProjectType implements IExampleProje
|
||||
public List<String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public String getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFolders(String packageName) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.eclipse.jface.wizard.IWizardPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.IExampleProject.ExportFile;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
@@ -40,9 +41,9 @@ public class ExampleJavaWizard extends ExampleWizard {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IWizardPage getDetailsPage() {
|
||||
protected IWizardPage getDetailsPage(INewProjectInfo info) {
|
||||
if (detailsPage != null) return detailsPage;
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage());
|
||||
detailsPage = new NewProjectMainPage(selection, getTeamNumberPage(), info);
|
||||
detailsPage.setTitle("Create Example Robot Java Project");
|
||||
detailsPage.setDescription("This wizard creates a new example project based on your selection.");
|
||||
return detailsPage;
|
||||
@@ -50,8 +51,8 @@ public class ExampleJavaWizard extends ExampleWizard {
|
||||
|
||||
@Override
|
||||
public IExampleProject makeExampleProject(String name, String description,
|
||||
List<String> tags, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleJavaProject(name, description, tags, folders, files);
|
||||
List<String> tags, String world, List<String> folders, List<ExportFile> files) {
|
||||
return new ExampleJavaProject(name, description, tags, world, folders, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchWizard;
|
||||
|
||||
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.INewProjectInfo;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.NewProjectMainPage;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectCreationUtils;
|
||||
import edu.wpi.first.wpilib.plugins.core.wizards.ProjectType;
|
||||
@@ -56,7 +57,7 @@ public class NewJavaWizard extends Wizard implements INewWizard {
|
||||
teamNumberPage = new TeamNumberPage(selection);
|
||||
addPage(teamNumberPage);
|
||||
}
|
||||
page = new NewProjectMainPage(selection, teamNumberPage);
|
||||
page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null);
|
||||
page.setProjectTypes(JavaProjectType.TYPES);
|
||||
page.setTitle("Create New Robot Java Project");
|
||||
page.setDescription("This wizard creates a new Robot Java Project configured to use WPILib for programming FRC robots.");
|
||||
|
||||
Reference in New Issue
Block a user