@Override public void actionPerformed(ActionEvent e) { final Resource[] resources = appContext.getResources(); checkState(resources != null && resources.length == 1); final Resource project = resources[0].getProject(); checkState(project != null); if (project.getResourceType() == PROJECT) { final MutableProjectConfig config = new MutableProjectConfig((Project) project); projectWizard.show(config); } }
/** Creates and returns 'default' project wizard with pre-defined pages only. */ private ImportWizard createDefaultWizard() { final MutableProjectConfig dataObject = new MutableProjectConfig(); final ImportWizard importWizard = importWizardFactory.newWizard(dataObject); importWizard.setUpdateDelegate(this); // add pre-defined first page importWizard.addPage(mainPage); return importWizard; }
/** Open the project wizard with given mode. */ public void show(Path parent) { resetState(); this.wizardMode = CREATE; MutableProjectConfig config = new MutableProjectConfig(); config.setPath(parent.toString()); showDialog(config); }
/** Updates the specified {@code project} with the given {@code commands}. */ private Promise<Void> updateProject(Project project, List<CommandImpl> commands) { MutableProjectConfig config = new MutableProjectConfig(project); Map<String, List<String>> attributes = config.getAttributes(); List<String> attrValue = new ArrayList<>(attributes.size()); for (CommandImpl command : commands) { CommandDto commandDto = dtoFactory .createDto(CommandDto.class) .withName(command.getName()) .withType(command.getType()) .withCommandLine(command.getCommandLine()) .withAttributes(command.getAttributes()); attrValue.add(dtoFactory.toJson(commandDto)); } attributes.put(COMMANDS_ATTRIBUTE_NAME, attrValue); return project.update().withBody(config).send().then((Function<Project, Void>) arg -> null); }
@Override public void actionPerformed(ActionEvent event) { Resource folder = getSelectedItem(); if (folder == null) { return; } Path location = folder.getLocation(); if (location == null) { return; } MutableProjectConfig mutableProjectConfig = new MutableProjectConfig(); mutableProjectConfig.setPath(location.toString()); mutableProjectConfig.setName(folder.getName()); projectConfigWizard.show(mutableProjectConfig); } }
MutableProjectConfig importConfig = new MutableProjectConfig(); importConfig.setPath(pathToProject.toString()); importConfig.setSource(sourceStorage);
String startPoint = parameters.get("startPoint"); MutableProjectConfig importConfig = new MutableProjectConfig(); importConfig.setPath(pathToProject.toString()); importConfig.setSource(sourceStorage);
subscriber.subscribe(path.lastSegment()); MutableProjectConfig importConfig = new MutableProjectConfig(); importConfig.setPath(path.toString()); importConfig.setSource(sourceStorage);