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


Java ModifiableRootModel.getProject方法代碼示例

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


在下文中一共展示了ModifiableRootModel.getProject方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupRootModel

import com.intellij.openapi.roots.ModifiableRootModel; //導入方法依賴的package包/類
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
    super.setupRootModel(rootModel);

    addListener(new ModuleBuilderListener() {
        @Override
        public void moduleCreated(@NotNull Module module) {
            setMuleFramework(module);
        }
    });

    setMuleFacet(rootModel.getModule());

    final Project project = rootModel.getProject();
    final VirtualFile root = createAndGetContentEntry();
    rootModel.addContentEntry(root);

    //Check if this is a module and has parent
    final MavenId parentId = (this.getParentProject() != null ? this.getParentProject().getMavenId() : null);

    MavenUtil.runWhenInitialized(project, (DumbAwareRunnable) () -> {
        new MuleMavenProjectBuilderHelper().configure(project, getProjectId(), muleVersion, root, parentId);
    });
}
 
開發者ID:machaval,項目名稱:mule-intellij-plugins,代碼行數:25,代碼來源:MuleMavenModuleBuilder.java

示例2: setupRootModel

import com.intellij.openapi.roots.ModifiableRootModel; //導入方法依賴的package包/類
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
  final Project project = rootModel.getProject();

  final VirtualFile root = createAndGetContentEntry();
  rootModel.addContentEntry(root);

  // todo this should be moved to generic ModuleBuilder
  if (myJdk != null){
    rootModel.setSdk(myJdk);
  } else {
    rootModel.inheritSdk();
  }

  MavenUtil.runWhenInitialized(project, new DumbAwareRunnable() {
    public void run() {
      if (myEnvironmentForm != null) {
        myEnvironmentForm.setData(MavenProjectsManager.getInstance(project).getGeneralSettings());
      }

      new MavenModuleBuilderHelper(myProjectId, myAggregatorProject, myParentProject, myInheritGroupId,
                                   myInheritVersion, myArchetype, myPropertiesToCreateByArtifact, "Create new Maven module").configure(project, root, false);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:MavenModuleBuilder.java

示例3: setupRootModel

import com.intellij.openapi.roots.ModifiableRootModel; //導入方法依賴的package包/類
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
    super.setupRootModel(rootModel);

    setMuleFacet(rootModel.getModule());

    final Project project = rootModel.getProject();
    final VirtualFile root = createAndGetContentEntry();
    rootModel.addContentEntry(root);
    MavenUtil.runWhenInitialized(project, (DumbAwareRunnable) () -> new MuleDomainMavenProjectBuilderHelper().configure(project, getProjectId(), muleVersion, root));
}
 
開發者ID:machaval,項目名稱:mule-intellij-plugins,代碼行數:12,代碼來源:MuleDomainMavenModuleBuilder.java

示例4: setupRootModel

import com.intellij.openapi.roots.ModifiableRootModel; //導入方法依賴的package包/類
@Override
public void setupRootModel(final @NotNull ModifiableRootModel rootModel) throws ConfigurationException {
  final Project project = rootModel.getProject();

  // in IntelliJ wizard user is able to choose SDK (i.e. for "java library" module), so set it
  if (myJdk != null){
    rootModel.setSdk(myJdk);
  } else {
    rootModel.inheritSdk();
  }
  if (myProject == null) {
    project.putUserData(ExternalSystemDataKeys.NEWLY_IMPORTED_PROJECT, Boolean.TRUE);
  }
  StartupManager.getInstance(project).runWhenProjectIsInitialized(new DumbAwareRunnable() {
      @Override
      public void run() {
        DumbService.getInstance(project).smartInvokeLater(new Runnable() {
          @Override
          public void run() {
            ApplicationManager.getApplication().runWriteAction(new Runnable() {
              @Override
              public void run() {
                if (myProject == null) {
                  myWizardState.putSdkDependentParams();
                  myWizardState.put(ATTR_PROJECT_LOCATION, project.getBasePath());
                  AssetStudioAssetGenerator assetGenerator = new AssetStudioAssetGenerator(myWizardState);
                  NewProjectWizard.createProject(myWizardState, project, assetGenerator);
                }
                else {
                  myWizardState.put(ATTR_MODULE_NAME, getName());
                  createModule();
                }
              }
            });
          }
        });
      }
    });
  }
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:40,代碼來源:ImportWizardModuleBuilder.java


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