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


Java IdeBorderFactory.createEmptyBorder方法代码示例

本文整理汇总了Java中com.intellij.ui.IdeBorderFactory.createEmptyBorder方法的典型用法代码示例。如果您正苦于以下问题:Java IdeBorderFactory.createEmptyBorder方法的具体用法?Java IdeBorderFactory.createEmptyBorder怎么用?Java IdeBorderFactory.createEmptyBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.IdeBorderFactory的用法示例。


在下文中一共展示了IdeBorderFactory.createEmptyBorder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VcsCommitInfoBalloon

import com.intellij.ui.IdeBorderFactory; //导入方法依赖的package包/类
public VcsCommitInfoBalloon(@NotNull JTree tree) {
  myTree = tree;
  myEditorPane = new JEditorPane(UIUtil.HTML_MIME, "");
  myEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
  myEditorPane.setEditable(false);
  myEditorPane.setBackground(HintUtil.INFORMATION_COLOR);
  myEditorPane.setFont(UIUtil.getToolTipFont());
  myEditorPane.setBorder(HintUtil.createHintBorder());
  Border margin = IdeBorderFactory.createEmptyBorder(3, 3, 3, 3);
  myEditorPane.setBorder(new CompoundBorder(myEditorPane.getBorder(), margin));
  myEditorPane.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      BrowserUtil.browse(e.getURL());
    }
  });
  myWrapper = new Wrapper(myEditorPane);
  myPopupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(myWrapper, null);
  myPopupBuilder.setCancelOnClickOutside(true).setResizable(true).setMovable(true).setRequestFocus(false)
    .setMinSize(new Dimension(80, 30));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:VcsCommitInfoBalloon.java

示例2: createContentPaneBorder

import com.intellij.ui.IdeBorderFactory; //导入方法依赖的package包/类
@Nullable
@Override
protected Border createContentPaneBorder() {
  return IdeBorderFactory.createEmptyBorder(0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:IdeSettingsDialog.java

示例3: SearchFieldAction

import com.intellij.ui.IdeBorderFactory; //导入方法依赖的package包/类
public SearchFieldAction(String text) {
  super("Find: ");
  myField = new SearchTextField(true) {
    @Override
    protected boolean preprocessEventForTextField(KeyEvent e) {
      if ((KeyEvent.VK_ENTER == e.getKeyCode()) || ('\n' == e.getKeyChar())) {
        e.consume();
        addCurrentTextToHistory();
        actionPerformed(null);
      }
      return super.preprocessEventForTextField(e);
    }

    @Override
    protected void onFocusLost() {
      myField.addCurrentTextToHistory();
      actionPerformed(null);
    }

    @Override
    protected void onFieldCleared() {
      actionPerformed(null);
    }
  };
  Border border = myField.getBorder();
  Border emptyBorder = IdeBorderFactory.createEmptyBorder(3, 0, 2, 0);
  if (border instanceof CompoundBorder) {
    if (!UIUtil.isUnderDarcula()) {
      myField.setBorder(new CompoundBorder(emptyBorder, ((CompoundBorder)border).getInsideBorder()));
    }
  }
  else {
    myField.setBorder(emptyBorder);
  }

  myField.setSearchIcon(AllIcons.Actions.Filter_small);
  myComponent = new JPanel();
  final BoxLayout layout = new BoxLayout(myComponent, BoxLayout.X_AXIS);
  myComponent.setLayout(layout);
  if (text.length() > 0) {
    final JLabel label = new JLabel(text);
    //label.setFont(label.getFont().deriveFont(Font.ITALIC));
    label.setForeground(UIUtil.isUnderDarcula() ? UIUtil.getLabelForeground() : UIUtil.getInactiveTextColor());
    label.setBorder(BorderFactory.createEmptyBorder(0,3,0,0));
    myComponent.add(label);
  }
  myComponent.add(myField);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:SearchFieldAction.java


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