Autoselect SQL statement in Execute Command window in IFS Developer Studio release701
authorSubhashini Sooriarachchi <subslk@netbeans.org>
Mon, 23 Jul 2012 14:29:14 +0530
branchrelease701
changeset 260167cd8387eaa
parent 259 c96374242ed1
child 261 25af782a9c76
Autoselect SQL statement in Execute Command window in IFS Developer Studio
PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java
     1.1 --- a/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java	Mon Jul 23 14:28:34 2012 +0530
     1.2 +++ b/PLSQL/Execution/src/org/netbeans/modules/plsql/execution/PlsqlExecuteAction.java	Mon Jul 23 14:29:14 2012 +0530
     1.3 @@ -338,6 +338,23 @@
     1.4                      if (!newblocks.isEmpty()) {
     1.5                          blocks = newblocks;
     1.6                      }
     1.7 +                }else if (OptionsUtilities.isCommandWindowAutoSelectEnabled()) {
     1.8 +                    List<PlsqlExecutableObject> newblocks = new ArrayList<PlsqlExecutableObject>();
     1.9 +
    1.10 +                    int caretPos = 0;
    1.11 +                    if ((panes != null) && (panes.length > 0)) {
    1.12 +                        caretPos = panes[0].getCaretPosition();
    1.13 +                    }
    1.14 +                    for (PlsqlExecutableObject block : blocks) {
    1.15 +                        if (caretPos >= block.getStartOffset() && caretPos <= block.getEndOffset()) {
    1.16 +                            if (block.getPlsqlString().startsWith("SELECT")) {
    1.17 +                                newblocks.add(block);
    1.18 +                            }
    1.19 +                        }
    1.20 +                    }
    1.21 +                    if (!newblocks.isEmpty()) {
    1.22 +                        blocks = newblocks;
    1.23 +                    }
    1.24                  }
    1.25              }
    1.26          }