Skip to content

Commit 5549f3a

Browse files
check availability of generate menu option based on preferences
1 parent 43b0b31 commit 5549f3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sqldev/src/main/java/org/utplsql/sqldev/menu/UtplsqlController.xtend

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,13 @@ class UtplsqlController implements Controller {
119119
if (view instanceof Editor) {
120120
val component = view.defaultFocusComponent
121121
if (component instanceof JEditorPane) {
122-
val parser = new UtplsqlParser(component.text)
123-
action.enabled = parser.getObjectAt(component.caretPosition) !== null
122+
val preferences = PreferenceModel.getInstance(Preferences.preferences)
123+
if (preferences.checkGenerateUtplsqlTest) {
124+
val parser = new UtplsqlParser(component.text)
125+
action.enabled = parser.getObjectAt(component.caretPosition) !== null
126+
} else {
127+
action.enabled = true
128+
}
124129
}
125130
} else if (view instanceof DBNavigatorWindow) {
126131
// multiselection is not supported, use oddgen to generte tests for multiple objects

0 commit comments

Comments
 (0)