• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SdkImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: BaseSdkEditor

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public BaseSdkEditor(@Nonnull SdkModel sdkModel, @Nonnull SdkImpl sdk) {
  mySdkModel = sdkModel;
  mySdk = sdk;
  createMainPanel();
  initSdk(sdk);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:BaseSdkEditor.java


示例17: setName

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void setName(String name) {
  ((SdkImpl)mySdk).setName(name);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:BaseSdkEditor.java


示例18: createSdkEditor

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
protected BaseSdkEditor createSdkEditor(ProjectSdksModel sdksModel, History history, SdkImpl projectJdk) {
  return new SdkEditor(sdksModel, history, projectJdk);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:SdkConfigurable.java


示例19: createBundles

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
@Override
public void createBundles(@NotNull Consumer<SdkImpl> consumer)
{
	PluginClassLoader classLoader = (PluginClassLoader) getClass().getClassLoader();
	IdeaPluginDescriptor plugin = PluginManager.getPlugin(classLoader.getPluginId());
	assert plugin != null;
	File path = plugin.getPath();

	File sdkDir = new File(path, "sdk");
	if(!sdkDir.exists())
	{
		return;
	}

	for(File file : sdkDir.listFiles())
	{
		String name = ourMapping.get(file.getName());
		if(name == null)
		{
			continue;
		}

		VirtualFile fileByIoFile = LocalFileSystem.getInstance().findFileByIoFile(file);
		if(fileByIoFile == null)
		{
			continue;
		}
		SdkImpl sdk = createSdkWithName(ClientJavaScriptSdkType.getInstance(), name);
		sdk.setHomePath(fileByIoFile.getPath());
		sdk.setVersionString("1");

		SdkModificator sdkModificator = sdk.getSdkModificator();
		for(VirtualFile child : fileByIoFile.getChildren())
		{
			sdkModificator.addRoot(child, BinariesOrderRootType.getInstance());
			sdkModificator.addRoot(child, SourcesOrderRootType.getInstance());
		}
		sdkModificator.commitChanges();
		consumer.consume(sdk);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:42,代码来源:ClientJavaScriptPredefinedBundlesProvider.java


示例20: createBundles

import com.intellij.openapi.projectRoots.impl.SdkImpl; //导入依赖的package包/类
public abstract void createBundles(@Nonnull Consumer<SdkImpl> consumer); 
开发者ID:consulo,项目名称:consulo,代码行数:2,代码来源:PredefinedBundlesProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NTE类代码示例发布时间:2022-05-22
下一篇:
Java SeleniumProtocol类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap