Example #1
0
	delete(sample) {
		let url = mergeURI(model.samplesDirectory, sample.name + "/");
		sample.close();
		sample.descriptionVisible = true;
		sample.title = sample.name;
		sample.url = null;
		shell.distribute("onSampleDeleted", sample);
		model.deleteDirectory(url);
	}
Example #2
0
	constructor(feature, data) {
		super(feature, data.template);
		this.data = data;
		this.base = mergeURI(model.projectsDirectory, data.id + "/");
		Files.ensureDirectory(this.base);
		let projects = model.filesFeature.projects.items;
		let project = this.project = new Project(null);
		project.title = data.title;
		project.name = data.id;
		projects.push(project);
		projects.sort((a, b) => a.title.compare(b.title));
		model.doSelectFeature(shell, model.filesFeature);
		shell.distribute("onProjectsChanged", project);
	}