CCCreateAnswerPlaceholderPanel.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:educational-plugin 作者:
public CCCreateAnswerPlaceholderPanel(@Nullable String placeholderText, @NotNull List<String> hints) {
  if (hints.isEmpty()) {
    myHints.add(HINT_PLACEHOLDER);
  }
  else {
    myHints.addAll(hints);
  }

  myPlaceholderTextArea.setBorder(BorderFactory.createLineBorder(JBColor.border()));
  myPlaceholderTextArea.setText(placeholderText);
  myPlaceholderTextArea.addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(FocusEvent e) {
      myPlaceholderTextArea.selectAll();
    }
  });
  myPlaceholderTextArea.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
  myPlaceholderTextArea.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, null);

  myHintsPanel.setBorder(BorderFactory.createLineBorder(JBColor.border()));
  ((GridLayoutManager)myHintsPanel.getLayout()).setHGap(1);

  myHintTextArea.setFont(UIUtil.getLabelFont());
  myPlaceholderTextArea.setFont(UIUtil.getLabelFont());
  myHintTextArea.addFocusListener(createFocusListenerToSetDefaultHintText());

  actionsPanel.add(createHintToolbarComponent(), BorderLayout.WEST);
  showHint();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号