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

Java MutableModuleExtension类代码示例

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

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



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

示例1: compute

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@Nonnull
@Override
protected ModuleExtensionProviderEP[] compute() {
  ModuleExtensionProviderEP[] extensions = EP_NAME.getExtensions();
  for (ModuleExtensionProviderEP extension : extensions) {
    Class<ModuleExtension> immutableClass = extension.getImmutableClass();
    if (immutableClass != null) {
      ModuleExtensionIndexCache.put(immutableClass, extension.getInternalIndex());
    }

    Class<MutableModuleExtension> mutableClass = extension.getMutableClass();
    if (mutableClass != null) {
      ModuleExtensionIndexCache.put(mutableClass, extension.getInternalIndex());
    }
  }
  return extensions;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ModuleExtensionProviders.java


示例2: insertModuleItems

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@RequiredReadAction
@SuppressWarnings("unchecked")
public <T extends MutableModuleExtension<?>> void insertModuleItems(@Nonnull T moduleExtension,
                                                                    @Nonnull NullableFunction<T, MutableModuleInheritableNamedPointer<Sdk>> sdkPointerFunction) {

  for (Module module : ModuleManager.getInstance(moduleExtension.getModule().getProject()).getModules()) {
    // dont add self module
    if (module == moduleExtension.getModule()) {
      continue;
    }

    ModuleExtension extension = ModuleUtilCore.getExtension(module, moduleExtension.getId());
    if (extension == null) {
      continue;
    }
    MutableModuleInheritableNamedPointer<Sdk> sdkPointer = sdkPointerFunction.fun((T)extension);
    if (sdkPointer != null) {
      // recursive depend
      if (sdkPointer.getModule() == moduleExtension.getModule()) {
        continue;
      }
      addItem(new ModuleExtensionSdkComboBoxItem(extension, sdkPointer));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:SdkComboBox.java


示例3: createConfigurationPanel

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@Nullable
@RequiredDispatchThread
private JComponent createConfigurationPanel(final @Nonnull MutableModuleExtension extension) {
  myConfigurablePanelExtension = extension;
  final Runnable updateOnCheck = new Runnable() {
    @Override
    @RequiredDispatchThread
    public void run() {
      extensionChanged(extension);
    }
  };

  JComponent configurablePanel = null;

  final consulo.ui.Component component = extension.createConfigurationComponent(updateOnCheck);

  if (component != null) {
    // we can call UIAccess.get() due we inside ui thread
    // we need this ugly cast for now
    configurablePanel = (JComponent)component;
  }
  else {
    configurablePanel = extension.createConfigurablePanel(updateOnCheck);
  }

  if (configurablePanel instanceof Disposable) {
    registerDisposable((Disposable)configurablePanel);
  }
  return configurablePanel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:ExtensionEditor.java


示例4: updateSecondComponent

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@RequiredDispatchThread
private void updateSecondComponent(@Nullable MutableModuleExtension extension) {
  if (extension == null || !extension.isEnabled()) {
    mySplitter.setSecondComponent(null);
  }
  else {
    mySplitter.setSecondComponent(createConfigurationPanel(extension));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:ExtensionEditor.java


示例5: create

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@Nonnull
public static <T extends MutableModuleExtension<?>> ModuleExtensionSdkBoxBuilder<T> create(@Nonnull T extension, @Nullable Runnable updater) {
  return new ModuleExtensionSdkBoxBuilder<>(extension).laterUpdater(updater);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:ModuleExtensionSdkBoxBuilder.java


示例6: createComponentImpl

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@Nonnull
@Override
protected JComponent createComponentImpl() {
  JPanel rootPane = new JPanel(new BorderLayout());

  mySplitter = new OnePixelSplitter();

  myTree = new CheckboxTreeNoPolicy(new ExtensionTreeCellRenderer(), new ExtensionCheckedTreeNode(null, myState, this)) {
    @Override
    protected void adjustParentsAndChildren(CheckedTreeNode node, boolean checked) {
      if (!checked) {
        changeNodeState(node, false);
        checkOrUncheckChildren(node, false);
      }
      else {
        // we need collect parents, and enable it in right order
        // A
        // - B
        // -- C
        // when we enable C, ill be calls like A -> B -> C
        List<CheckedTreeNode> parents = new ArrayList<CheckedTreeNode>();
        TreeNode parent = node.getParent();
        while (parent != null) {
          if (parent instanceof CheckedTreeNode) {
            parents.add((CheckedTreeNode)parent);
          }
          parent = parent.getParent();
        }

        Collections.reverse(parents);
        for (CheckedTreeNode checkedTreeNode : parents) {
          checkNode(checkedTreeNode, true);
        }
        changeNodeState(node, true);
      }
      repaint();
    }
  };

  myTree.setRootVisible(false);
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myTree.addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    @RequiredDispatchThread
    public void valueChanged(final TreeSelectionEvent e) {
      final List<MutableModuleExtension> selected = TreeUtil.collectSelectedObjectsOfType(myTree, MutableModuleExtension.class);
      updateSecondComponent(ContainerUtil.<MutableModuleExtension>getFirstItem(selected));
    }
  });
  TreeUtil.expandAll(myTree);

  mySplitter.setFirstComponent(myTree);

  rootPane.add(new JBScrollPane(mySplitter), BorderLayout.CENTER);

  return rootPane;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:58,代码来源:ExtensionEditor.java


示例7: extensionChanged

import consulo.module.extension.MutableModuleExtension; //导入依赖的package包/类
@RequiredDispatchThread
public void extensionChanged(MutableModuleExtension extension) {
  final JComponent secondComponent = myConfigurablePanelExtension != extension ? null : mySplitter.getSecondComponent();
  if (secondComponent == null && extension.isEnabled() || secondComponent != null && !extension.isEnabled()) {
    updateSecondComponent(!extension.isEnabled() ? null : extension);
  }

  if (extension instanceof ModuleExtensionWithSdk) {
    // we using module layer, dont use modifiable model - it ill proxy, and methods 'addModuleExtensionSdkEntry' && 'removeOrderEntry'
    // ill call this method again
    ModifiableModuleRootLayer moduleRootLayer = extension.getModuleRootLayer();

    final ModuleExtensionWithSdkOrderEntry sdkOrderEntry = moduleRootLayer.findModuleExtensionSdkEntry(extension);
    if (!extension.isEnabled() && sdkOrderEntry != null) {
      moduleRootLayer.removeOrderEntry(sdkOrderEntry);
    }

    if (extension.isEnabled()) {
      final ModuleExtensionWithSdk sdkExtension = (ModuleExtensionWithSdk)extension;
      if (!sdkExtension.getInheritableSdk().isNull()) {
        if (sdkOrderEntry == null) {
          moduleRootLayer.addModuleExtensionSdkEntry(sdkExtension);
        }
        else {
          final ModuleExtensionWithSdk<?> moduleExtension = sdkOrderEntry.getModuleExtension();
          if (moduleExtension != null && !Comparing.equal(sdkExtension.getInheritableSdk(), moduleExtension.getInheritableSdk())) {
            moduleRootLayer.addModuleExtensionSdkEntry(sdkExtension);
          }
        }
      }
      else if (sdkOrderEntry != null) {
        moduleRootLayer.removeOrderEntry(sdkOrderEntry);
      }
    }
  }

  for (PsiPackageSupportProvider supportProvider : PsiPackageSupportProvider.EP_NAME.getExtensions()) {
    final Module module = extension.getModule();
    if (supportProvider.isSupported(extension)) {
      PsiPackageManager.getInstance(module.getProject()).dropCache(extension.getClass());
    }
  }

  myClasspathEditor.moduleStateChanged();
  myContentEntriesEditor.moduleStateChanged();
  myOutputEditor.moduleStateChanged();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:48,代码来源:ExtensionEditor.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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