|
|
@ -24,6 +24,9 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package com.github.weisj.darklaf.components.text; |
|
|
|
package com.github.weisj.darklaf.components.text; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.github.weisj.darklaf.ui.text.DarkTextFieldUI; |
|
|
|
|
|
|
|
import com.github.weisj.darklaf.ui.text.DarkTextUI; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.text.Document; |
|
|
|
import javax.swing.text.Document; |
|
|
@ -64,7 +67,7 @@ public class SearchTextFieldWithHistory extends SearchTextField { |
|
|
|
public SearchTextFieldWithHistory(final Document doc, final String text, final int columns) { |
|
|
|
public SearchTextFieldWithHistory(final Document doc, final String text, final int columns) { |
|
|
|
super(doc, text, columns); |
|
|
|
super(doc, text, columns); |
|
|
|
history = new TextFieldHistoryPopup(this, 100, 800); |
|
|
|
history = new TextFieldHistoryPopup(this, 100, 800); |
|
|
|
putClientProperty("JTextField.Search.FindPopup", history); |
|
|
|
putClientProperty(DarkTextFieldUI.KEY_FIND_POPUP, history); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -169,11 +172,4 @@ public class SearchTextFieldWithHistory extends SearchTextField { |
|
|
|
public int getLength() { |
|
|
|
public int getLength() { |
|
|
|
return history.getLength(); |
|
|
|
return history.getLength(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setHistoryLength(final int length) { |
|
|
|
|
|
|
|
if (length < 0) throw new IllegalArgumentException("History can't have negative size"); |
|
|
|
|
|
|
|
if (length == 0) { |
|
|
|
|
|
|
|
putClientProperty("JTextField.Search.FindPopup", null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|