mirror of
https://gitlab.com/2009scape/tools/rs09-thanos-tool.git
synced 2026-08-01 14:39:20 -06:00
Merge branch 'regex-fix' into 'master'
Disable regex searching when using search Closes #6 and #8 See merge request 2009scape/tools/rs09-thanos-tool!7
This commit is contained in:
commit
8108d96a00
4 changed files with 12 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ import java.awt.event.KeyListener
|
|||
import java.awt.event.MouseEvent
|
||||
import java.awt.event.MouseListener
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import java.util.regex.PatternSyntaxException
|
||||
import javax.swing.*
|
||||
import javax.swing.table.DefaultTableCellRenderer
|
||||
|
|
@ -23,7 +24,8 @@ object ItemMenu : JFrame("Item Selection Menu") {
|
|||
var rf: RowFilter<DefaultTableModel?, Any?>? = null
|
||||
//If current expression doesn't parse, don't update.
|
||||
rf = try {
|
||||
RowFilter.regexFilter("(?i)${searchField.text}")
|
||||
val searchPattern = Pattern.quote(searchField.text)
|
||||
RowFilter.regexFilter("(?i)${searchPattern}")
|
||||
} catch (e: PatternSyntaxException) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import java.awt.BorderLayout
|
|||
import java.awt.Dimension
|
||||
import java.awt.event.*
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import java.util.regex.PatternSyntaxException
|
||||
import javax.swing.*
|
||||
import javax.swing.table.DefaultTableCellRenderer
|
||||
|
|
@ -105,7 +106,8 @@ class ShopList : JFrame("RS09 Shop Editor") {
|
|||
var rf: RowFilter<DefaultTableModel?, Any?>? = null
|
||||
//If current expression doesn't parse, don't update.
|
||||
rf = try {
|
||||
RowFilter.regexFilter("(?i)${searchField.text}")
|
||||
val searchPattern = Pattern.quote(searchField.text)
|
||||
RowFilter.regexFilter("(?i)${searchPattern}")
|
||||
} catch (e: PatternSyntaxException) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.awt.event.ActionEvent
|
|||
import java.awt.event.KeyEvent
|
||||
import java.awt.event.KeyListener
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import java.util.regex.PatternSyntaxException
|
||||
import javax.swing.*
|
||||
import javax.swing.JComponent.WHEN_FOCUSED
|
||||
|
|
@ -222,7 +223,8 @@ class TableEditor(val editor: Editors) : JFrame("Editing ${editor.name.replace("
|
|||
}
|
||||
|
||||
private fun filter() {
|
||||
val regex = Regex("(?i)${searchField.text}")
|
||||
val searchPattern = Pattern.quote(searchField.text)
|
||||
val regex = Regex("(?i)${searchPattern}")
|
||||
if (editor == Editors.OBJECT_CONFIGS) {
|
||||
var rf: RowFilter<DefaultTableModel?, Any?>? = null
|
||||
//If current expression doesn't parse, don't update.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import java.awt.BorderLayout
|
|||
import java.awt.Dimension
|
||||
import java.awt.event.*
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import java.util.regex.PatternSyntaxException
|
||||
import javax.swing.*
|
||||
import javax.swing.table.DefaultTableCellRenderer
|
||||
|
|
@ -100,7 +101,8 @@ class TableList : JFrame("RS09 Drop Table Editor") {
|
|||
var rf: RowFilter<DefaultTableModel?, Any?>? = null
|
||||
//If current expression doesn't parse, don't update.
|
||||
rf = try {
|
||||
RowFilter.regexFilter("(?i)${searchField.text}")
|
||||
val searchPattern = Pattern.quote(searchField.text)
|
||||
RowFilter.regexFilter("(?i)${searchPattern}")
|
||||
} catch (e: PatternSyntaxException) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue