Пример #1
0
  public final void setEditor(final ComboBoxEditor editor) {
    ComboBoxEditor _editor = editor;
    if (SystemInfo.isMac && (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderIntelliJLaF())) {
      if ("AquaComboBoxEditor".equals(editor.getClass().getSimpleName())
          || UIUtil.isUnderIntelliJLaF()) {
        _editor = new FixedComboBoxEditor();
      }
    }

    super.setEditor(new MyEditor(this, _editor));
  }
Пример #2
0
 private JTextField createColorField(boolean hex) {
   final NumberDocument doc = new NumberDocument(hex);
   int lafFix = UIUtil.isUnderWindowsLookAndFeel() || UIUtil.isUnderDarcula() ? 1 : 0;
   UIManager.LookAndFeelInfo info = LafManager.getInstance().getCurrentLookAndFeel();
   if (info != null
       && (info.getName().startsWith("IDEA") || info.getName().equals("Windows Classic")))
     lafFix = 1;
   final JTextField field;
   if (SystemInfo.isMac && UIUtil.isUnderIntelliJLaF()) {
     field = new JTextField("");
     field.setDocument(doc);
     field.setPreferredSize(new Dimension(hex ? 60 : 40, 26));
   } else {
     field = new JTextField(doc, "", (hex ? 5 : 2) + lafFix);
     field.setSize(50, -1);
   }
   doc.setSource(field);
   field.getDocument().addDocumentListener(this);
   field.addFocusListener(
       new FocusAdapter() {
         @Override
         public void focusGained(final FocusEvent e) {
           field.selectAll();
         }
       });
   return field;
 }
  public final void setEditor(final ComboBoxEditor editor) {
    ComboBoxEditor _editor = editor;
    if (SystemInfo.isMac && (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderIntelliJLaF())) {
      if (editor instanceof UIResource) {
        _editor = new FixedComboBoxEditor();
      }
    }

    super.setEditor(new MyEditor(this, _editor));
  }
 @Override
 protected final boolean isWideSelection() {
   return UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF();
 }
 private static boolean isUsingDarculaUIFlavor() {
   return UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF();
 }