当前位置: 首页>>代码示例>>Java>>正文


Java MutableProjectConfig.setPath方法代码示例

本文整理汇总了Java中org.eclipse.che.ide.api.project.MutableProjectConfig.setPath方法的典型用法代码示例。如果您正苦于以下问题:Java MutableProjectConfig.setPath方法的具体用法?Java MutableProjectConfig.setPath怎么用?Java MutableProjectConfig.setPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.che.ide.api.project.MutableProjectConfig的用法示例。


在下文中一共展示了MutableProjectConfig.setPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import org.eclipse.che.ide.api.project.MutableProjectConfig; //导入方法依赖的package包/类
@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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:ConvertFolderToProjectAction.java

示例2: show

import org.eclipse.che.ide.api.project.MutableProjectConfig; //导入方法依赖的package包/类
/** 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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:ProjectWizardPresenter.java

示例3: onProjectTypeSelected

import org.eclipse.che.ide.api.project.MutableProjectConfig; //导入方法依赖的package包/类
@Override
public void onProjectTypeSelected(ProjectTypeDto projectType) {
  final MutableProjectConfig prevData = wizard.getDataObject();
  wizard = getWizardForProjectType(projectType, prevData);
  wizard.navigateToFirst();
  final MutableProjectConfig newProject = wizard.getDataObject();

  // some values should be shared between wizards for different project types
  newProject.setPath(prevData.getPath());
  newProject.setName(prevData.getName());
  newProject.setDescription(prevData.getDescription());
  newProject.setMixins(prevData.getMixins());
  if (wizardMode == UPDATE) {
    newProject.setAttributes(prevData.getAttributes());
  } else {
    final MutableProjectConfig.MutableSourceStorage sourceStorage = prevData.getSource();
    if (sourceStorage
        != null) { // some values should be cleared when user switch between categories
      sourceStorage.setLocation("");
      sourceStorage.setType("");
      sourceStorage.getParameters().clear();
    }
    prevData.getProjects().clear();

    final List<AttributeDto> attributes = projectType.getAttributes();
    Map<String, List<String>> prevDataAttributes = prevData.getAttributes();
    Map<String, List<String>> newAttributes = new HashMap<>();
    for (AttributeDto attribute : attributes) {
      if (prevDataAttributes.containsKey(attribute.getName())) {
        newAttributes.put(attribute.getName(), prevDataAttributes.get(attribute.getName()));
      }
    }
    newProject.setAttributes(newAttributes);
  }

  // set dataObject's values from projectType
  newProject.setType(projectType.getId());
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:ProjectWizardPresenter.java

示例4: doImport

import org.eclipse.che.ide.api.project.MutableProjectConfig; //导入方法依赖的package包/类
private Promise<Project> doImport(final Path path, final SourceStorage sourceStorage) {
  final ProjectNotificationSubscriber subscriber = subscriberFactory.createSubscriber();
  subscriber.subscribe(path.lastSegment());

  MutableProjectConfig importConfig = new MutableProjectConfig();
  importConfig.setPath(path.toString());
  importConfig.setSource(sourceStorage);

  return appContext
      .getWorkspaceRoot()
      .importProject()
      .withBody(importConfig)
      .send()
      .thenPromise(
          project -> {
            subscriber.onSuccess();
            return projectResolver.resolve(project);
          })
      .catchErrorPromise(
          new Function<PromiseError, Promise<Project>>() {
            @Override
            public Promise<Project> apply(PromiseError exception) throws FunctionException {
              subscriber.onFailure(exception.getCause().getMessage());

              switch (getErrorCode(exception.getCause())) {
                case UNABLE_GET_PRIVATE_SSH_KEY:
                  throw new IllegalStateException(
                      localizationConstant.importProjectMessageUnableGetSshKey());
                case UNAUTHORIZED_SVN_OPERATION:
                  return recallImportWithCredentials(sourceStorage, path);
                case UNAUTHORIZED_GIT_OPERATION:
                  final Map<String, String> attributes =
                      ExceptionUtils.getAttributes(exception.getCause());
                  final String providerName = attributes.get(PROVIDER_NAME);
                  final String authenticateUrl = attributes.get(AUTHENTICATE_URL);
                  if (!Strings.isNullOrEmpty(providerName)
                      && !Strings.isNullOrEmpty(authenticateUrl)) {
                    return authUserAndRecallImport(
                        providerName, authenticateUrl, path, sourceStorage, subscriber);
                  } else {
                    throw new IllegalStateException(
                        localizationConstant.oauthFailedToGetAuthenticatorText());
                  }
                default:
                  throw new IllegalStateException(exception.getCause());
              }
            }
          });
}
 
开发者ID:eclipse,项目名称:che,代码行数:50,代码来源:ProjectImporter.java


注:本文中的org.eclipse.che.ide.api.project.MutableProjectConfig.setPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。