Browse Source

JTextField.variant=search causes NPE #1

master
Konstantin Bulenkov 11 years ago
parent
commit
497a538cc7
  1. BIN
      build/darcula.jar
  2. 6
      src/com/bulenkov/darcula/darcula.properties
  3. BIN
      src/com/bulenkov/darcula/icons/clear.png
  4. BIN
      src/com/bulenkov/darcula/icons/clear@2x.png
  5. BIN
      src/com/bulenkov/darcula/icons/search.png
  6. BIN
      src/com/bulenkov/darcula/icons/search@2x.png
  7. BIN
      src/com/bulenkov/darcula/icons/searchWithHistory.png
  8. BIN
      src/com/bulenkov/darcula/icons/searchWithHistory@2x.png
  9. 8
      src/com/bulenkov/darcula/ui/DarculaTextFieldUI.java

BIN
build/darcula.jar

Binary file not shown.

6
src/com/bulenkov/darcula/darcula.properties

@ -79,9 +79,9 @@ Focus.color=ff0000
TextField.background=45494A
TextFieldUI=com.bulenkov.darcula.ui.DarculaTextFieldUI
TextField.border=com.bulenkov.darcula.ui.DarculaTextBorder
TextField.darcula.search.icon=/com/intellij/ide/ui/laf/darcula/icons/search.png
TextField.darcula.searchWithHistory.icon=/com/intellij/ide/ui/laf/darcula/icons/searchWithHistory.png
TextField.darcula.clear.icon=/com/intellij/ide/ui/laf/darcula/icons/clear.png
TextField.darcula.search.icon=/com/bulenkov/darcula/icons/search.png
TextField.darcula.searchWithHistory.icon=/com/bulenkov/darcula/icons/searchWithHistory.png
TextField.darcula.clear.icon=/com/bulenkov/darcula/icons/clear.png
TextArea.selectionForeground=bbbbbb
PasswordField.background=45494A

BIN
src/com/bulenkov/darcula/icons/clear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

BIN
src/com/bulenkov/darcula/icons/clear@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
src/com/bulenkov/darcula/icons/search.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

BIN
src/com/bulenkov/darcula/icons/search@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

BIN
src/com/bulenkov/darcula/icons/searchWithHistory.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

BIN
src/com/bulenkov/darcula/icons/searchWithHistory@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

8
src/com/bulenkov/darcula/ui/DarculaTextFieldUI.java

@ -32,10 +32,6 @@ import java.awt.event.*;
* @author Konstantin Bulenkov
*/
public class DarculaTextFieldUI extends BasicTextFieldUI {
private static final Icon SEARCH_ICON = IconLoader.findIcon("/com/intellij/ide/ui/laf/darcula/icons/search.png", DarculaTextFieldUI.class, true);
private static final Icon SEARCH_WITH_HISTORY_ICON = IconLoader.findIcon("/com/intellij/ide/ui/laf/darcula/icons/searchWithHistory.png", DarculaTextFieldUI.class, true);
private static final Icon CLEAR_ICON = IconLoader.findIcon("/com/intellij/ide/ui/laf/darcula/icons/clear.png", DarculaTextFieldUI.class, true);
private enum SearchAction {POPUP, CLEAR}
private final JTextField myTextField;
@ -165,14 +161,14 @@ public class DarculaTextFieldUI extends BasicTextFieldUI {
Point p = getSearchIconCoord();
Icon searchIcon = getComponent().getClientProperty("JTextField.Search.FindPopup") instanceof JPopupMenu ? UIManager.getIcon("TextField.darcula.searchWithHistory.icon") : UIManager.getIcon("TextField.darcula.search.icon");
if (searchIcon == null) {
searchIcon = IconLoader.findIcon("/com/intellij/ide/ui/laf/icons/search.png", DarculaTextFieldUI.class, true);
searchIcon = IconLoader.findIcon("/com/bulenkov/darcula/icons/search.png", DarculaTextFieldUI.class, true);
}
searchIcon.paintIcon(null, g, p.x, p.y);
if (getComponent().hasFocus() && getComponent().getText().length() > 0) {
p = getClearIconCoord();
Icon clearIcon = UIManager.getIcon("TextField.darcula.clear.icon");
if (clearIcon == null) {
clearIcon = IconLoader.findIcon("/com/intellij/ide/ui/laf/icons/clear.png", DarculaTextFieldUI.class, true);
clearIcon = IconLoader.findIcon("/com/bulenkov/darcula/icons/clear.png", DarculaTextFieldUI.class, true);
}
clearIcon.paintIcon(null, g, p.x, p.y);
}

Loading…
Cancel
Save