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

Java CustomizationUtil类代码示例

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

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



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

示例1: addTreeMouseListeners

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
private void addTreeMouseListeners() {
    EditSourceOnDoubleClickHandler.install(getTree(), new Runnable() {
        @Override
        public void run() {
            TreePath path = getTree().getSelectionPath();
            if (path == null)
                return;
            DefaultMutableTreeNode selectedElement = (DefaultMutableTreeNode)path.getLastPathComponent();
            if (selectedElement == null)
                return;
            GlobalConfigsTreeStructure.GlobalConfigNode configNode = (GlobalConfigsTreeStructure.GlobalConfigNode)selectedElement.getUserObject();
            if (configNode == null)
                return;
            PsiElement element = configNode.getXmlTag();
            if (element == null)
                return;
            OpenSourceUtil.navigate((Navigatable)element);
        }
    });

    CustomizationUtil.installPopupHandler(getTree(), IdeActions.GROUP_STRUCTURE_VIEW_POPUP, ActionPlaces.STRUCTURE_VIEW_POPUP);
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:23,代码来源:GlobalConfigsToolWindowPanel.java


示例2: hideActions

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
private static void hideActions(@NotNull CustomActionsSchema schema, @NotNull DefaultMutableTreeNode root,
                                @NotNull final TreeNode actionGroup, Set<String> items) {
  for(int i = 0; i < actionGroup.getChildCount(); i++){
    final DefaultMutableTreeNode child = (DefaultMutableTreeNode)actionGroup.getChildAt(i);
    final int childCount = child.getChildCount();
    final String childId = getItemId(child);
    if (childId != null && items.contains(childId)){
      final TreePath treePath = TreeUtil.getPath(root, child);
      final ActionUrl url = CustomizationUtil.getActionUrl(treePath, ActionUrl.DELETED);
      schema.addAction(url);
    }
    else if (childCount > 0) {
      hideActions(schema, child, child, items);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyCharmEduInitialConfigurator.java


示例3: ArrangementRuleAliasesPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ArrangementRuleAliasesPanel(@NotNull ArrangementStandardSettingsManager settingsManager,
                                   @NotNull ArrangementColorsProvider colorsProvider) {
  super(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@NotNull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
    myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
    ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
    ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
    ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
    myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ArrangementRuleAliasesPanel.java


示例4: NavBarPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public NavBarPanel(@NotNull Project project, boolean docked) {
  super(new FlowLayout(FlowLayout.LEFT, 0 , 0));
  myProject = project;
  myModel = createModel();
  myIdeView = new NavBarIdeView(this);
  myPresentation = new NavBarPresentation(myProject);
  myUpdateQueue = new NavBarUpdateQueue(this);

  CustomizationUtil.installPopupHandler(this, IdeActions.GROUP_NAVBAR_POPUP, ActionPlaces.NAVIGATION_BAR_POPUP);
  setOpaque(false);
  if (!docked && UIUtil.isUnderDarcula()) {
    setBorder(new LineBorder(Gray._120, 1));
  }
  myCopyPasteDelegator = new CopyPasteDelegator(myProject, NavBarPanel.this) {
    @Override
    @NotNull
    protected PsiElement[] getSelectedElements() {
      final PsiElement element = getSelectedElement(PsiElement.class);
      return element == null ? PsiElement.EMPTY_ARRAY : new PsiElement[]{element};
    }
  };

  myUpdateQueue.queueModelUpdateFromFocus();
  myUpdateQueue.queueRebuildUi();
  if (!docked) {
    final ActionCallback typeAheadDone = new ActionCallback();
    IdeFocusManager.getInstance(project).typeAheadUntil(typeAheadDone);
    myUpdateQueue.queueTypeAheadDone(typeAheadDone);
  }

  Disposer.register(project, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:NavBarPanel.java


示例5: createComponent

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
@Override
public JComponent createComponent() {
  if (myViewPanel == null) {
    myViewPanel = new ScopeTreeViewPanel(myProject);
    Disposer.register(this, myViewPanel);
    myViewPanel.initListeners();
    myTree = myViewPanel.getTree();
    CustomizationUtil.installPopupHandler(myTree, IdeActions.GROUP_SCOPE_VIEW_POPUP, ActionPlaces.SCOPE_VIEW_POPUP);
    enableDnD();
  }

  myViewPanel.selectScope(NamedScopesHolder.getScope(myProject, getSubId()));
  return myViewPanel.getPanel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ScopeViewPane.java


示例6: ToolWindowServiceImpl

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ToolWindowServiceImpl() {
  pasteBinService = ServiceManager.getService(PasteBinService.class);
  pasteBinConfigurationService = ServiceManager.getService(PasteBinConfigurationService.class);

  DefaultMutableTreeNode root = new DefaultMutableTreeNode();
  this.userNode = new DefaultMutableTreeNode(new UserNode(null));
  this.trendsNode = new DefaultMutableTreeNode(new TrendPasteNode());

  // This nodes always will be present
  root.add(userNode);
  root.add(trendsNode);

  // Initialize the tree
  this.tree = new Tree(new ListTreeTableModel(root, null));

  // Disable root node
  // and show the root children
  this.tree.setRootVisible(false);
  this.tree.setShowsRootHandles(true);

  // Enable speed search for tree of paste notes
  new TreeSpeedSearch(tree);

  // Tree render for putting icons
  this.tree.setCellRenderer(new PasteTreeRenderer());

  // Sets the right click context menu
  CustomizationUtil.installPopupHandler(tree, "ultimatepastebin.ToolwindowPopupMenu", ActionPlaces.TFS_TREE_POPUP);
}
 
开发者ID:kennedyoliveira,项目名称:ultimate-pastebin-intellij-plugin,代码行数:30,代码来源:ToolWindowServiceImpl.java


示例7: initTree

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
private void initTree() {
  myTree.setCellRenderer(new MyTreeCellRenderer());
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(myTree);
  TreeUtil.installActions(myTree);
  EditSourceOnDoubleClickHandler.install(myTree);
  new TreeSpeedSearch(myTree);
  myCopyPasteDelegator = new CopyPasteDelegator(myProject, this) {
    @Override
    @NotNull
    protected PsiElement[] getSelectedElements() {
      return getSelectedPsiElements();
    }
  };
  myTreeExpansionMonitor = PackageTreeExpansionMonitor.install(myTree, myProject);
  final ScopeTreeStructureExpander[] extensions = Extensions.getExtensions(ScopeTreeStructureExpander.EP_NAME, myProject);
  for (ScopeTreeStructureExpander expander : extensions) {
    myTree.addTreeWillExpandListener(expander);
  }
  if (extensions.length == 0) {
    myTree.addTreeWillExpandListener(new SortingExpandListener());
  }
  myTree.addKeyListener(new KeyAdapter() {
    @Override
    public void keyPressed(KeyEvent e) {
      if (KeyEvent.VK_ENTER == e.getKeyCode()) {
        final Object component = myTree.getLastSelectedPathComponent();
        if (component instanceof DefaultMutableTreeNode) {
          final DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)component;
          if (selectedNode.isLeaf()) {
            OpenSourceUtil.openSourcesFrom(DataManager.getInstance().getDataContext(myTree), false);
          }
        }
      }
    }
  });
  CustomizationUtil.installPopupHandler(myTree, IdeActions.GROUP_PROJECT_VIEW_POPUP, ActionPlaces.PROJECT_VIEW_POPUP);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:40,代码来源:ScopeTreeViewPanel.java


示例8: ArrangementRuleAliasesPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ArrangementRuleAliasesPanel(@Nonnull ArrangementStandardSettingsManager settingsManager,
                                   @Nonnull ArrangementColorsProvider colorsProvider) {
  super(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@Nonnull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
          myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
          ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
          ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
          ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
          myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:41,代码来源:ArrangementRuleAliasesPanel.java


示例9: initTree

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
private void initTree() {
  myTree.setCellRenderer(new MyTreeCellRenderer());
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(true);
  UIUtil.setLineStyleAngled(myTree);
  TreeUtil.installActions(myTree);
  EditSourceOnDoubleClickHandler.install(myTree);
  new TreeSpeedSearch(myTree);
  myCopyPasteDelegator = new CopyPasteDelegator(myProject, this) {
    @Override
    @Nonnull
    protected PsiElement[] getSelectedElements() {
      return getSelectedPsiElements();
    }
  };
  myTreeExpansionMonitor = PackageTreeExpansionMonitor.install(myTree, myProject);
  final ScopeTreeStructureExpander[] extensions = Extensions.getExtensions(ScopeTreeStructureExpander.EP_NAME, myProject);
  for (ScopeTreeStructureExpander expander : extensions) {
    myTree.addTreeWillExpandListener(expander);
  }
  if (extensions.length == 0) {
    myTree.addTreeWillExpandListener(new SortingExpandListener());
  }
  myTree.addKeyListener(new KeyAdapter() {
    @Override
    public void keyPressed(KeyEvent e) {
      if (KeyEvent.VK_ENTER == e.getKeyCode()) {
        final Object component = myTree.getLastSelectedPathComponent();
        if (component instanceof DefaultMutableTreeNode) {
          final DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)component;
          if (selectedNode.isLeaf()) {
            OpenSourceUtil.openSourcesFrom(DataManager.getInstance().getDataContext(myTree), false);
          }
        }
      }
    }
  });
  CustomizationUtil.installPopupHandler(myTree, IdeActions.GROUP_PROJECT_VIEW_POPUP, ActionPlaces.PROJECT_VIEW_POPUP);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:ScopeTreeViewPanel.java


示例10: ArrangementMatchingRulesPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ArrangementMatchingRulesPanel(@NotNull Language language,
                                     @NotNull ArrangementStandardSettingsManager settingsManager,
                                     @NotNull ArrangementColorsProvider colorsProvider)
{
  super(new GridBagLayout());
  
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementSectionRulesControl.RepresentationCallback callback = new ArrangementSectionRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@NotNull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = createRulesControl(language, settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
    myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
    ApplicationBundle.message("arrangement.settings.section.match"),
    ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTROL_TOOLBAR,
    ArrangementConstants.MATCHING_RULES_CONTROL_TOOLBAR_PLACE,
    myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:ArrangementMatchingRulesPanel.java


示例11: addTreeMouseListeners

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
private void addTreeMouseListeners() {
  EditSourceOnDoubleClickHandler.install(getTree());
  CustomizationUtil.installPopupHandler(getTree(), IdeActions.GROUP_STRUCTURE_VIEW_POPUP, ActionPlaces.STRUCTURE_VIEW_POPUP);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:StructureViewComponent.java


示例12: ArrangementMatchingRulesPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ArrangementMatchingRulesPanel(@NotNull ArrangementStandardSettingsManager settingsManager,
                                     @NotNull ArrangementColorsProvider colorsProvider)
{
  super(new GridBagLayout());
  
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@NotNull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = new ArrangementMatchingRulesControl(settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
    myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
    ApplicationBundle.message("arrangement.settings.section.match"),
    ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTROL_TOOLBAR,
    ArrangementConstants.MATCHING_RULES_CONTROL_TOOLBAR_PLACE,
    myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:42,代码来源:ArrangementMatchingRulesPanel.java


示例13: DoctypeTree

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public DoctypeTree()
{
    CustomizationUtil.installPopupHandler(this, "com.monday.cmidea.DoctypeBrowserContextMenu", ActionPlaces.UNKNOWN);
}
 
开发者ID:monday-consulting,项目名称:idea-coremedia-plugin,代码行数:5,代码来源:DoctypeTree.java


示例14: ArrangementMatchingRulesPanel

import com.intellij.ide.ui.customization.CustomizationUtil; //导入依赖的package包/类
public ArrangementMatchingRulesPanel(@Nonnull Language language,
                                     @Nonnull ArrangementStandardSettingsManager settingsManager,
                                     @Nonnull ArrangementColorsProvider colorsProvider)
{
  super(new GridBagLayout());

  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementSectionRulesControl.RepresentationCallback callback = new ArrangementSectionRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@Nonnull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = createRulesControl(language, settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
          myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
          ApplicationBundle.message("arrangement.settings.section.match"),
          ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTROL_TOOLBAR,
          ArrangementConstants.MATCHING_RULES_CONTROL_TOOLBAR_PLACE,
          myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:43,代码来源:ArrangementMatchingRulesPanel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java HumanNameDt类代码示例发布时间:2022-05-23
下一篇:
Java JStatement类代码示例发布时间: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