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


Java SdkImpl类代码示例

本文整理汇总了Java中com.intellij.openapi.projectRoots.impl.SdkImpl的典型用法代码示例。如果您正苦于以下问题:Java SdkImpl类的具体用法?Java SdkImpl怎么用?Java SdkImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SdkImpl类属于com.intellij.openapi.projectRoots.impl包,在下文中一共展示了SdkImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSdk

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
protected Sdk createSdk(VirtualFile virtualFile)
{
	SdkImpl sdk = new SdkImpl("Mono IKVM.NET", IkvmBundleType.getInstance());
	VirtualFile mainMonoPath = virtualFile.getParent().getParent().getParent();
	sdk.setHomePath(mainMonoPath.getPath());
	sdk.setPredefined(true);
	sdk.setVersionString(IkvmBundleType.getInstance().getVersionString(sdk));

	SdkModificator sdkModificator = sdk.getSdkModificator();
	for(String library : IkvmBundleType.ourLibraries)
	{
		VirtualFile libraryFile = mainMonoPath.findFileByRelativePath("lib/mono/ikvm/" + library);
		if(libraryFile != null)
		{
			VirtualFile archiveLibraryFile = ArchiveVfsUtil.getArchiveRootForLocalFile(libraryFile);
			if(archiveLibraryFile != null)
			{
				sdkModificator.addRoot(archiveLibraryFile, BinariesOrderRootType.getInstance());
			}
		}
	}

	sdkModificator.commitChanges();
	return sdk;
}
 
开发者ID:consulo,项目名称:consulo-ikvm,代码行数:27,代码来源:MonoIkvmModuleExtension.java

示例2: createBundles

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void createBundles(@NotNull Consumer<SdkImpl> consumer)
{
	Map<String, LuaSdkType> map = new HashMap<String, LuaSdkType>();
	map.put("Kahlua", KahluaSdkType.getInstance());
	map.put("LuaJ", LuaJSdkType.getInstance());

	for(Map.Entry<String, LuaSdkType> entry : map.entrySet())
	{
		LuaSdkType luaSdkType = entry.getValue();
		SdkImpl sdkWithName = createSdkWithName(luaSdkType, entry.getKey());

		sdkWithName.setHomePath(luaSdkType.getStdLibraryFile().getPath());

		luaSdkType.setupSdkPaths(sdkWithName);

		consumer.consume(sdkWithName);
	}
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:20,代码来源:LuaPredefinedBundlesProvider.java

示例3: initComponent

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void initComponent() {
  if (SystemProperties.is("consulo.disable.predefined.bundles")) {
    return;
  }

  Consumer<SdkImpl> consumer = new Consumer<SdkImpl>() {
    @Override
    @RequiredDispatchThread
    public void consume(final SdkImpl sdk) {
      ApplicationManager.getApplication().runWriteAction(() -> {
        sdk.setPredefined(true);
        SdkTable.getInstance().addSdk(sdk);
      });
    }
  };

  for (PredefinedBundlesProvider predefinedBundlesProvider : PredefinedBundlesProvider.EP_NAME.getExtensions()) {
    try {
      predefinedBundlesProvider.createBundles(consumer);
    }
    catch (Throwable e) {
      LOGGER.error(e);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:PredefinedBundlesLoader.java

示例4: doAdd

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public void doAdd(JComponent parent, final SdkType type, final Consumer<Sdk> callback) {
  myModified = true;
  if (type.supportsCustomCreateUI()) {
    type.showCustomCreateUI(this, parent, new Consumer<Sdk>() {
      @Override
      public void consume(Sdk sdk) {
        setupSdk(sdk, callback);
      }
    });
  }
  else {
    SdkConfigurationUtil.selectSdkHome(type, new Consumer<String>() {
      @Override
      public void consume(final String home) {
        String newSdkName = SdkConfigurationUtil.createUniqueSdkName(type, home, getSdks());
        final SdkImpl newSdk = new SdkImpl(newSdkName, type);
        newSdk.setHomePath(home);
        setupSdk(newSdk, callback);
      }
    });
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ProjectSdksModel.java

示例5: addSdkNode

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public boolean addSdkNode(final Sdk sdk, final boolean selectInTree) {
  if (!myUiDisposed) {
    myContext.getDaemonAnalyzer().queueUpdate(new SdkProjectStructureElement(myContext, sdk));

    MyNode newSdkNode = new MyNode(new SdkConfigurable((SdkImpl)sdk, mySdksTreeModel, TREE_UPDATER, myHistory, myProject));

    final MyNode groupNode = MasterDetailsComponent.findNodeByObject(myRoot, sdk.getSdkType());
    if (groupNode != null) {
      addNode(newSdkNode, groupNode);
    }
    else {
      final MyNode sdkGroupNode = createSdkGroupNode((SdkType)sdk.getSdkType());

      addNode(sdkGroupNode, myRoot);
      addNode(newSdkNode, sdkGroupNode);
    }

    if (selectInTree) {
      selectNodeInTree(newSdkNode);
    }
    return true;
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:SdkListConfigurable.java

示例6: reset

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void reset() {
  super.reset();

  myProjectSdksModel.reset(myProject);

  myRoot.removeAllChildren();
  final Map<Sdk, Sdk> sdks = myProjectSdksModel.getProjectSdks();
  for (Sdk sdk : sdks.keySet()) {
    final SdkConfigurable configurable = new SdkConfigurable((SdkImpl)sdks.get(sdk), myProjectSdksModel, TREE_UPDATER, myHistory, myProject);
    addNode(new MyNode(configurable), myRoot);
  }

  final String value = PropertiesComponent.getInstance().getValue(SPLITTER_PROPORTION);
  if (value != null) {
    try {
      final Splitter splitter = extractSplitter();
      if (splitter != null) {
        (splitter).setProportion(Float.parseFloat(value));
      }
    }
    catch (NumberFormatException e) {
      //do not set proportion
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:SdksConfigurable.java

示例7: createActions

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
@Nullable
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
  final ArrayList<AnAction> actions = new ArrayList<AnAction>();
  DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("add.action.name"), true);
  group.getTemplatePresentation().setIcon(IconUtil.getAddIcon());
  myProjectSdksModel.createAddActions(group, myTree, new Consumer<Sdk>() {
    @Override
    public void consume(final Sdk projectJdk) {
      addNode(new MyNode(new SdkConfigurable(((SdkImpl)projectJdk), myProjectSdksModel, TREE_UPDATER, myHistory, myProject), false), myRoot);
      selectNodeInTree(findNodeByObject(myRoot, projectJdk));
    }
  }, SdkListConfigurable.ADD_SDK_FILTER);
  actions.add(new MyActionGroupWrapper(group));
  actions.add(new MyDeleteAction(forAll(Conditions.alwaysTrue())));
  return actions;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:SdksConfigurable.java

示例8: createBundles

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void createBundles(@NotNull Consumer<SdkImpl> consumer)
{
	MicrosoftDotNetSdkType sdkType = MicrosoftDotNetSdkType.getInstance();

	Collection<MicrosoftDotNetFramework> microsoftDotNetFrameworks = buildPaths(sdkType);
	for(MicrosoftDotNetFramework netFramework : microsoftDotNetFrameworks)
	{
		SdkImpl sdk = createSdkWithName(sdkType, sdkType.getPresentableName() + " " + netFramework.toString());
		sdk.setHomePath(netFramework.getPath());
		sdk.setVersionString(netFramework.getVersion().getPresentableName());

		consumer.consume(sdk);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:16,代码来源:MicrosoftDotNetPredefinedBundlesProvider.java

示例9: createBundles

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void createBundles(@Nonnull Consumer<SdkImpl> consumer) {
  for (SdkType sdkType : SdkType.EP_NAME.getExtensions()) {
    if(sdkType.canCreatePredefinedSdks()) {
      Collection<String> paths = sdkType.suggestHomePaths();

      for (String path : paths) {
        path = sdkType.adjustSelectedSdkHome(path);

        if(sdkType.isValidSdkHome(path)) {
          VirtualFile dirPath = LocalFileSystem.getInstance().findFileByPath(path);
          if(dirPath == null) {
            continue;
          }

          String sdkPath = sdkType.sdkPath(dirPath);

          SdkImpl sdk = createSdk(sdkType, sdkPath);
          sdk.setHomePath(sdkPath);
          sdk.setVersionString(sdkType.getVersionString(sdk));
          sdkType.setupSdkPaths(sdk);

          consumer.consume(sdk);
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:DefaultPredefinedBundlesProvider.java

示例10: doSetHomePath

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
private void doSetHomePath(final String homePath, final SdkType sdkType) {
  if (homePath == null) {
    return;
  }
  setHomePathValue(homePath.replace('/', File.separatorChar));

  final String newSdkName = suggestSdkName(homePath);
  ((SdkImpl)mySdk).setName(newSdkName);

  try {
    final Sdk dummySdk = (Sdk)mySdk.clone();
    SdkModificator sdkModificator = dummySdk.getSdkModificator();
    sdkModificator.setHomePath(homePath);
    sdkModificator.removeAllRoots();
    sdkModificator.commitChanges();

    sdkType.setupSdkPaths(dummySdk);

    clearAllPaths();
    myVersionString = dummySdk.getVersionString();
    if (myVersionString == null) {
      Messages
        .showMessageDialog(ProjectBundle.message("sdk.java.corrupt.error", homePath), ProjectBundle.message("sdk.java.corrupt.title"),
                           Messages.getErrorIcon());
    }
    sdkModificator = dummySdk.getSdkModificator();
    for (OrderRootType type : myPathEditors.keySet()) {
      myPathEditors.get(type).addPaths(sdkModificator.getRoots(type));
    }
    mySdkModel.getMulticaster().sdkHomeSelected(dummySdk, homePath);
  }
  catch (CloneNotSupportedException e) {
    BaseSdkEditor.LOGGER.error(e); // should not happen in normal program
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:36,代码来源:BaseSdkEditor.java

示例11: SdkConfigurable

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public SdkConfigurable(@Nonnull final SdkImpl sdk,
                       final ProjectSdksModel sdksModel,
                       final Runnable updateTree,
                       @Nonnull History history,
                       Project project) {
  super(!sdk.isPredefined(), updateTree);
  mySdk = sdk;
  mySdkEditor = createSdkEditor(sdksModel, history, mySdk);
  final StructureConfigurableContext context = ModuleStructureConfigurable.getInstance(project).getContext();
  myProjectStructureElement = new SdkProjectStructureElement(context, mySdk);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:SdkConfigurable.java

示例12: update

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void update(final AnActionEvent e) {
  if (myTree.getSelectionPaths() == null || myTree.getSelectionPaths().length != 1) {
    e.getPresentation().setEnabled(false);
  }
  else {
    Object selectedObject = getSelectedObject();
    e.getPresentation().setEnabled(selectedObject instanceof SdkImpl && !(((SdkImpl)selectedObject).getSdkType() instanceof UnknownSdkType));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:SdkListConfigurable.java

示例13: createSdkWithName

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Nonnull
public SdkImpl createSdkWithName(@Nonnull SdkType sdkType, @Nonnull String suggestName) {
  String uniqueSdkName = SdkConfigurationUtil.createUniqueSdkName(suggestName + SdkConfigurationUtil.PREDEFINED_PREFIX, SdkTable.getInstance().getAllSdks());

  return new SdkImpl(uniqueSdkName, sdkType);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:PredefinedBundlesProvider.java

示例14: createSdk

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Nonnull
public SdkImpl createSdk(@Nonnull SdkType sdkType, @Nonnull String sdkHome) {
  return createSdkWithName(sdkType, sdkType.suggestSdkName(null, sdkHome));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:PredefinedBundlesProvider.java

示例15: SdkEditor

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public SdkEditor(@Nonnull SdkModel sdkModel, @Nonnull History history, @Nonnull SdkImpl sdk) {
  super(sdkModel, sdk);
  myHistory = history;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:SdkEditor.java


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