From fd918327cc2ec151b6abeb34e2009670aa21e0fe Mon Sep 17 00:00:00 2001 From: khartlage Date: Sat, 24 Jul 2004 19:25:19 +0000 Subject: [PATCH] Quantum version 2.4.1 --- .../doc/bookmark_name.html | 16 + .../doc/getting_started_connections.html | 63 +--- .../doc/images/new_bookmark/add_driver.gif | Bin 0 -> 9274 bytes .../doc/images/new_bookmark/page1.gif | Bin 0 -> 12519 bytes .../doc/images/new_bookmark/page2.gif | Bin 0 -> 9129 bytes .../doc/images/new_bookmark/page2_informix.gif | Bin 0 -> 11048 bytes .../doc/images/new_bookmark/page2_postgresql.gif | Bin 0 -> 10603 bytes .../doc/images/new_bookmark/page3.gif | Bin 0 -> 8609 bytes .../doc/images/new_bookmark/page4.gif | Bin 0 -> 9850 bytes .../doc/jdbc_connection_details.html | 34 ++ .../doc/jdbc_driver.html | 41 ++ .../doc/schema_rules.html | 22 + .../doc/toc.xml | 7 +- .../icons/bigtable.gif | Bin 242 -> 1004 bytes .../icons/close.gif | Bin 916 -> 916 bytes .../icons/close_all.gif | Bin 0 -> 964 bytes .../icons/close_all_2x.gif | Bin 0 -> 891 bytes .../icons/close_all_disabled.gif | Bin 0 -> 945 bytes .../icons/close_disabled.gif | Bin 0 -> 910 bytes .../icons/entitygroup.gif | Bin 169 -> 928 bytes .../icons/external_jar.gif | Bin 0 -> 581 bytes .../icons/external_jar_2x.gif | Bin 0 -> 259 bytes .../icons/next.gif | Bin 183 -> 931 bytes .../icons/previous.gif | Bin 183 -> 920 bytes .../icons/table_details.gif | Bin 0 -> 929 bytes .../plugin.xml | 14 +- .../src/com/quantum/ImageStore.java | 14 +- .../src/com/quantum/QuantumPlugin.java | 20 +- .../src/com/quantum/QuantumResources.properties | 56 ++- .../src/com/quantum/actions/BaseExecuteAction.java | 31 +- .../com/quantum/actions/BaseSequenceAction.java | 31 ++- .../src/com/quantum/actions/CloseTableAction.java | 40 -- .../src/com/quantum/actions/ExecuteAction.java | 122 ++++-- .../com/quantum/actions/ExecuteAgainstAction.java | 8 +- .../com/quantum/actions/NextSequenceAction.java | 26 +- .../com/quantum/actions/PrevSequenceAction.java | 24 +- .../com/quantum/actions/RefreshTableAction.java | 40 -- .../src/com/quantum/actions/ViewTableAction.java | 54 ++- .../quantum/actions/ViewTableDetailsAction.java | 25 +- .../src/com/quantum/adapters/AdapterFactory.java | 89 +++- .../src/com/quantum/adapters/DB2AS400Adapter.java | 10 +- .../src/com/quantum/adapters/DB2Adapter.java | 21 +- .../src/com/quantum/adapters/DatabaseAdapter.java | 15 +- .../src/com/quantum/adapters/InformixAdapter.java | 43 ++ .../com/quantum/adapters/MSSQLServerAdapter.java | 25 + .../src/com/quantum/adapters/MySQLAdapter.java | 14 +- .../src/com/quantum/adapters/OracleAdapter.java | 5 +- .../src/com/quantum/adapters/PointbaseAdapter.java | 25 + .../src/com/quantum/adapters/PostgresAdapter.java | 17 +- .../quantum/editors/SQLContentAssistProcessor.java | 2 +- .../com/quantum/editors/SQLContentOutlinePage.java | 155 ++++++ .../com/quantum/editors/SQLDocumentProvider.java | 1 + .../src/com/quantum/editors/SQLEditor.java | 21 +- .../editors/SQLSourceViewerConfiguration.java | 110 +++++ .../src/com/quantum/model/Bookmark.java | 1 + .../src/com/quantum/model/BookmarkCollection.java | 97 ++++- .../src/com/quantum/model/ColumnImpl.java | 4 +- .../src/com/quantum/model/Database.java | 60 ++- .../com/quantum/model/DisplayableComparator.java | 43 ++ .../src/com/quantum/model/EntityImpl.java | 78 +++- .../src/com/quantum/model/JDBCDriver.java | 113 +++-- .../src/com/quantum/model/TableImpl.java | 5 +- .../src/com/quantum/model/ViewImpl.java | 4 +- .../com/quantum/model/xml/ModelToXMLConverter.java | 16 +- .../src/com/quantum/php/PHPMessages.java | 41 ++ .../src/com/quantum/php/PHPResources.properties | 27 ++ .../PHPSQLConnectionPreferencePage.java | 108 +++++ .../preferences/PHPSQLTemplatesPreferencePage.java | 94 ++++ .../com/quantum/php/wizards/PHPDeleteRowPage.java | 359 ++++++++++++++ .../com/quantum/php/wizards/PHPInsertRowPage.java | 290 ++++++++++++ .../com/quantum/php/wizards/PHPSelectRowPage.java | 210 +++++++++ .../com/quantum/php/wizards/PHPUpdateRowPage.java | 185 ++++++++ .../quantum/preferences/SQLEditorPreferences.java | 4 +- .../php/PHPSQLConnectionPreferencePage.java | 108 ----- .../php/PHPSQLTemplatesPreferencePage.java | 94 ---- .../quantum/properties/BookmarkPropertyPage.java | 171 +++++--- .../src/com/quantum/sql/MultiSQLServer.java | 319 +++---------- .../src/com/quantum/sql/SQLHelper.java | 69 --- .../src/com/quantum/sql/SQLMetaDataResults.java | 91 ++++ .../com/quantum/sql/SQLResultSetCollection.java | 56 +++ .../src/com/quantum/sql/SQLResultSetResults.java | 271 +++++++++++ .../src/com/quantum/sql/SQLResults.java | 140 +------ .../quantum/sql/SQLStandardResultSetResults.java | 284 +++++++++++ .../src/com/quantum/sql/SQLUpdateResults.java | 21 + .../src/com/quantum/sql/Scrollable.java | 20 + .../src/com/quantum/sql/parser/SQL.java | 16 + .../src/com/quantum/sql/parser/SQLParser.java | 59 +++ .../src/com/quantum/sql/parser/SQLScript.java | 12 + .../quantum/ui/dialog/SimpleSelectionDialog.java | 6 +- .../src/com/quantum/util/JarUtil.java | 135 ++++-- .../com/quantum/util/StringArrayComparator.java | 45 ++ .../src/com/quantum/util/sql/TypesHelper.java | 30 ++ .../com/quantum/view/JDBCDriverTableViewer.java | 2 +- .../src/com/quantum/view/ViewHelper.java | 18 +- .../src/com/quantum/view/bookmark/TreeNode.java | 2 +- .../quantum/view/driver/DeleteDriverAction.java | 86 ++++ .../com/quantum/view/driver/JDBCDriverView.java | 45 ++ .../view/driver/JDBCDriverViewActionGroup.java | 25 + .../view/tableview/ChangeEncodingAction.java | 39 ++ .../view/tableview/CloseAllResultSetsAction.java | 44 ++ .../view/tableview/CloseResultSetAction.java | 54 +++ .../src/com/quantum/view/tableview/CopyAction.java | 54 +++ .../com/quantum/view/tableview/FullModeAction.java | 41 ++ .../com/quantum/view/tableview/NextPageAction.java | 81 ++++ .../quantum/view/tableview/PreviousPageAction.java | 82 ++++ .../quantum/view/tableview/RefreshTableAction.java | 33 ++ .../quantum/view/tableview/ResultSetAction.java | 72 +++ .../quantum/view/tableview/ResultSetViewer.java | 246 ++++++++++ .../quantum/view/tableview/SelectAllAction.java | 33 ++ .../com/quantum/view/tableview/TableAdapter.java | 265 ----------- .../src/com/quantum/view/tableview/TableView.java | 385 +++++++--------- .../view/tableview/TableViewActionGroup.java | 417 +++++++++++++++++ .../src/com/quantum/wizards/AddDriverWizard.java | 172 +++++--- .../src/com/quantum/wizards/BaseSQLPage.java | 31 +- .../wizards/BasicOnePartURLSetupControl.java | 57 +++ .../wizards/BasicThreePartURLSetupControl.java | 80 ++++ .../wizards/BookmarkConnectionWizardPage.java | 134 +++++- .../src/com/quantum/wizards/DeleteRowPage.java | 47 +-- .../quantum/wizards/InformixURLSetupControl.java | 95 ++++ .../src/com/quantum/wizards/InsertRowPage.java | 35 +- .../wizards/JDBCDriverSelectionWizardPage.java | 2 +- .../src/com/quantum/wizards/PHPDeleteRowPage.java | 179 ------- .../src/com/quantum/wizards/PHPInsertRowPage.java | 149 ------ .../src/com/quantum/wizards/PHPSelectRowPage.java | 207 -------- .../src/com/quantum/wizards/PHPUpdateRowPage.java | 200 -------- .../src/com/quantum/wizards/SQLPage.java | 5 +- .../src/com/quantum/wizards/SQLRowWizard.java | 17 +- .../src/com/quantum/wizards/SortFilterPage.java | 53 +-- .../src/com/quantum/wizards/URLBuilder.java | 67 +++ .../src/com/quantum/wizards/URLSetupControl.java | 112 +++++ .../quantum/wizards/URLSetupControlFactory.java | 80 ++++ .../src/com/quantum/wizards/UpdateRowPage.java | 49 +-- .../actions/PHPOpenSQLTableEditorAction.java | 493 +++++++++++--------- 133 files changed, 6371 insertions(+), 2844 deletions(-) create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/bookmark_name.html create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/add_driver.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page1.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2_informix.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2_postgresql.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page3.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page4.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/jdbc_connection_details.html create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/jdbc_driver.html create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/doc/schema_rules.html create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_all.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_all_2x.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_all_disabled.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_disabled.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar_2x.gif create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/icons/table_details.gif delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/CloseTableAction.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/RefreshTableAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/InformixAdapter.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MSSQLServerAdapter.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PointbaseAdapter.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentOutlinePage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLSourceViewerConfiguration.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/DisplayableComparator.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPMessages.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPResources.properties create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLConnectionPreferencePage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLTemplatesPreferencePage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPDeleteRowPage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPInsertRowPage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPSelectRowPage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPUpdateRowPage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLConnectionPreferencePage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLTemplatesPreferencePage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLHelper.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLMetaDataResults.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetCollection.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetResults.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLStandardResultSetResults.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLUpdateResults.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/Scrollable.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQL.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLParser.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLScript.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/StringArrayComparator.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/DeleteDriverAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverView.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverViewActionGroup.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ChangeEncodingAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseAllResultSetsAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseResultSetAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CopyAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/FullModeAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/NextPageAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/PreviousPageAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/RefreshTableAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetAction.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetViewer.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/SelectAllAction.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableAdapter.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableViewActionGroup.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicOnePartURLSetupControl.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicThreePartURLSetupControl.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPDeleteRowPage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPInsertRowPage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPSelectRowPage.java delete mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPUpdateRowPage.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLBuilder.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControl.java create mode 100644 archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControlFactory.java diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/bookmark_name.html b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/bookmark_name.html new file mode 100644 index 0000000..a6260d1 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/bookmark_name.html @@ -0,0 +1,16 @@ + + + + + Choosing a Bookmark Name + + + +

Choosing a Bookmark Name

+

Provide a unique name for your bookmark:

+ + + + + diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/getting_started_connections.html b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/getting_started_connections.html index c14d6aa..df0d83a 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/getting_started_connections.html +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/getting_started_connections.html @@ -19,59 +19,16 @@ when right-clicking on the blank space in the Once this menu item is selected, you will see the "New Bookmark" wizard:

- + + +

Creating Bookmarks involve four things: + +

    +
  1. specify a JDBC Driver; +
  2. provide the connection details (userid, password and JDBC URL); +
  3. choose a name for your bookmark; and +
  4. optionally, specify which schemas you want to view. +
-

The data that the form asks of you is: -

-

Other examples (only as orientation, your particular data may be -different)
-

-For MySql (in Windows):

-
Connect: jdbc:mysql://localhost/test
Driver: com.mysql.jdbc.Driver
Driver Filename: C:\mysql\jdbc\mysql-connector-java-2.0.4-bin.jar
-
-

For PostgreSql (in Linux):

-
- 
Connect: jdbc:postgresql://localhost/emsdevel
Driver: org.postgresql.Driver
driver filename: /opt/postgresql/share/java/postgresql.jar
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/add_driver.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/add_driver.gif new file mode 100644 index 0000000000000000000000000000000000000000..177f0a6733cf52b63bd0386b31d7d82d7c26965c GIT binary patch literal 9274 zcmV-AB*oiDNk%w1VYUHQ0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeHR0G86IjKB2p#{R3sTqC>dBZ6<8@3Wh5JRG8bhx8g?upOfDo`H7rUuC0jT$S1KlC zBRYOOCTcq%d^tR8GC6r&4|+vDK|(uOK`nPhGh|0PdQd-YQ9pJ_Kv7OYV@*YQQAcH1 zOL=i`WB?P33K)Y49EkuGk^mH$02`Ya0Du4$pa2%G03DzJ7^?spyaywd877JVBd7o( zxd1A+04%))FslVPwksllDL9rtKZyVt&j26N042x(DAfQp#Q-+Z1~J$GJ<HtXb09EDyS@RN7qQohNhOC!I)+O-kWn^*T{DmH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zLQ6OX@) z8+N(XgCQxGj=eTD?aox~jzkMvvu)~0bq1!XJEr@aJ9WGL4iPc%#l`pYcd8yTLmnwa z)<6QLWm;0xg{Rbk2?@wtfd!g|V0{(+_tJzAGAGc32YQ#@g8hl8l6?>1rlBpDwXF67;j%vOLLy&I1>04rA%6Vr*X5yJqntQ5c z;gWtvBwLGuR(P0^b{cx8o{NUGnWJdtI9ZRCT6!s_nQB@ooLolAV~JoUs^6z)Qo1Rs zsj9lESF5`EDy%ueFe|OK+IlOlx$3$rueqiNE3m<48mdBJl3MDRy(+sbv&}mDEVR+) zT9HoGT6-8iW#nZ}ySF1+!|J1@QD9$7EG`Rco` zpziYfFTeo{%%8sl8+x&3q3T^MH_uI(n%}5G}BEx z{WR23OFcE!MMEJ(omzOY#T8d*;q?<=Tha9uP?&u-+G(r3Hrs8x{Wjcj%RM*Ub=!S6 z-g)c2H{X5x{WsumH-U8wIp}aW;)yH1IOB~w{y5~3OFlW}m0Nx}=9z20Ip>{w{yFHO xi*7>Zz-~I_s^w{yOZj%RW2pwcCC>?z!u}JMX>w{yXr&3x9e*06VnVT@C;M literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2.gif new file mode 100644 index 0000000000000000000000000000000000000000..20dba7ebeb4b553796cf2ae7386946c23d20c596 GIT binary patch literal 9129 zcmV;aBUao;Nk%w1VYUID0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeHR0G86IjKB2p#{R3sTqC>dBZ6<8@3Wh5JRG8bhx8g?upOfDo`H7rUuC0jT$S1KlC zBRYOOCTcq%d^tR8GC6r&4|+vDK|(uOK`nPhGh|0PdQd-YQ9pJ_Kv7OYV@*YQQAcH1 zOL=i`WB?P33K)Y49EkuGk^mH$02`Ya0Du4$pa2%G03DzJ7^?spyaywc877JVBdGu) zxd1A+04%)*F{=eRw<{umDL0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/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2_informix.gif new file mode 100644 index 0000000000000000000000000000000000000000..3619e74b9eaa9a7626695797b6bb5f934aa20f69 GIT binary patch literal 11048 zcmV+@E7#OVNk%w1VYUIl0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeHR0G86IjKB2p#{R3sTqC>dBZ6<8@3Wh5JRG8bhx8g?upOfDo`H7rUuC0jT$S1KlC zBRYOOCTcq%d^tR8GC6r&4|+vDK|(uOK`nPhGh|0PdQd-YQ9pJ_Kv7OYV@*YQQAcH1 zOL=i`WB?P33K)Y49EkuGk^mH$02`Ya0Du4$pa2%G03DzJ7^?spyaywc877JVBdGu) zxd1A+04%)*F{=eRw<{umDL0irKZyVt&j26N042x(DAfQo#Q-+Z1~J$GJ<@XKSl|F->j7r^19JWlV(u1d?h$456MFw5U)CaF+B9X)A#3a+c=w1awcBS^KCIhTB7qKb@u`mv>GZM8#D7H&5!YTmFI~UO}0M#}J+C38DI|SH68qP)} z(@G}ZQZCw4GUh`Jpf=5A8wb6MzoVuD|@fNivZ zaj&0!%&Tb5>4R$Pi*oFed#tFLjFQBOp4W(({hXrBnylQ3r{#yS_n4;ro3`kfy7r=m z(W#iwwT#5MgWI~B&9;{3tg_amrS_`7?7hIDc<=-0ko7?ehEa z@8b67|Nj2|A^8LV00930EC2ui0JZ_Z0RRa90I>-aXr&;PD_0JF(GteYmWF1+G@KYl zjKqo;ElSjgabw1h9z%8<$+09zk|#}yREctB%9j>nVw6d9rp=l-Z|cm+bEnUqK!57I zNVKTYqezn~UCOkn)2B%_sstnPOPDWK!C>8rRcn)cV8Q+yTks4THkdGF%Cw17C%2vA z%AHHMuHCzM^XlEpx3Ay7fCCF2Ot`S&!-x|r1`KyoT*sXpZ<({Vj%brcUw(Z-vbL-yCySMM(z=ONaq#x8DE9|hu7HjOW$R;aM zmCJ_V1v&g|ChfG+lGB9}*#6Li4LvA9s}{E6dZw-yJyhpi#gc&p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@e#MVpWt=kxZYsemgYXvb@h0!`Ht+LB@AOvh^=9w( zcJKFw@A#JQ`KIssw(tAK@BG&9{a$Y;00Owd0x!sdDj@IzH}EQOf&^Fa1!wREckl;? z@CcXi38(N1x9|(c@C?`R4d?I<_wWw~@emjB5uflS`0p3E0US{A6=(4lckvg8@fer! z8K?0YxA7at@f_Fj9p~{L_wgSG@*o%TAt&-8r-2ukffrEnC1>&`ck(BP@+g<`DW~!( ixAH5;@+{Z#E$8ws_wp|X^Dr0lF(>l{GFS3|0029ob()y~ literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2_postgresql.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page2_postgresql.gif new file mode 100644 index 0000000000000000000000000000000000000000..9c72ec32d544d46dc8a1c414cca748b4d9923e59 GIT binary patch literal 10603 zcmV-xDU{YnNk%w1VYUIl0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeHR0G86IjKB2p#{R3sTqC>dBZ6<8@3Wh5JRG8bhx8g?upOfDo`H7rUuC0jT$S1KlC zBRYOOCTcq%d^tR8GC6r&4|+vDK|(uOK`nPhGh|0PdQd-YQ9pJ_Kv7OYV@*YQQAcH1 zOL=i`WB?P33K)Y49EkuGk^mH$02`Ya0Du4$pa2%G03DzJ7^?spyaywc877JVBdGu) zxd1A+04%)*F{=eRw<{umDL0irKZyVt&j26N042x(DAfQo#Q-+Z1~J$GJ<@XKSl|F->j7r^19JWlV(u1d?h$456MFw5U)CaF+B9X)A#3a+c=w1awcBS^KCIhTB7qKb@u`mv>GZM8#D7H&5!YTmFI~UO}0M#}J+C38DI|SH68qP)} z(@G}ZQZCw4GUh`Jpf=5A8wb6MzoVuD|@fNivZ zaj&0!%&Tb5>4R$Pi*oFed#tFLjFQBOp4W(({hXrBnylQ3r{#yS_n4;ro3`kfy7r=m z(W#iwwT#5MgWI~B&9;{3tg_amrS_`7?7hIDc<=-0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PF_ze)fA literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page3.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page3.gif new file mode 100644 index 0000000000000000000000000000000000000000..42b13aea463741bb49b715f2e46d72a923c93e1e GIT binary patch literal 8609 zcmV;SAzt1`Nk%w1VYUIl0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeHR0G86IjKB2p#{R3sTqC>dBZ6<8@3Wh5JRG8bhx8g?upOfDo`H7rUuC0jT$S1KlC zBRYOOCTcq%d^tR8GC6r&4|+vDK|(uOK`nPhGh|0PdQd-YQ9pJ_Kv7OYV@*YQQAcH1 zOL=i`WB?P33K)Y49EkuGk^mH$02`Ya0Du4$pa2%G03DzJ7^?spyaywc877JVBdGu) zxd1A+04%)*F{=eRw<{umDL0irKZyVt&j26N042x(DAfQo#Q-+Z1~J$GJ<HtXb09EDyS@RN7O)iwv(Jrd$O1lU6w z&PF8DN+#Y?F4|Kv=0gnSOBm-+8{thPDc<=-0SZ5?ehEa z@8b67|Nj2|A^8LV00930EC2ui0JZ_Z0RRa90J8}cXr&;PD_0JN(L(0TmWF4@G@MAL zjKqo;ElSjgabw1h9z%8<$+09zk|#}yREctB%9j>nVw6d9rp=l-Z|cm+bEnUqK!57I zNVKTYqezn~UCOkn)2B%_niNAOjF>Q0tzHfD({Vj%brcUw(Z-vbL-yCySMM(z=I2yeL6KsQgJm%2;Djns;RIS!Sh2;1TVxkn8fSobUx;fh zXrh89rikK-p|Pl9i!i<@ql+}gSmTT~=7{5tH}%#1&I$VJ3%D%9y4_4mQN*n{LM0=A3ZSDQBH{ z-l?aZeCFBbo_+>85tV}$O6Z}6CW`2yiZ;sVqmD)j>7QygrfF+v9YUq+uDtf@>#x8DE9|hu7HjOW$cAbq z8C;Z7k7v+E3+*VJDWSvTtAw;)k_YkNTJtUF2WT2~Vx$K_XZo2QT>+Zbp z(kpMh_};5;y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S8 zSi_QbB8xRhVhLMT$X;Zzk<5o_aas`6io~%3X{}vL;#rGWR)u7Is!};J&Cd$trqq-u zagRG(!|HV-i}fpN<*3-c8kVoLRjpfDD_qga7Oiunu64gVU69;1w%ol4Wsy75^|JT4 z#5L(^xr)KOc{QfIod|rT*tPV-~>lkwtdy{qbm#Ky{fski@tG=C9P*Uci6-I9dxJ*ty1|Ww91;faz~)t z+4V+w)Y?UKUlqM$zFwHoMyBo~lT7L7T3XZ4t@WihJ?Tzww$-kV@3EI#>W-c|GqGmM zp*>9z)9U)bq^&k?A3bb6quC?dj_qT^&ERn3cGtz;s;T=N+&mjwvM>p4W$PFe!9p9- z;63YxaXW3Sm^dMr)r!6UjUw%iP!cHh<~Ow^nQwHHb-vVLcZ{PFZ?GVotPNl4!>fd9 znzq#AF8z4OK|XSdW0lt?$M{h-&P4leRNzagHzQ@vM}41nsLfutm1n+lJvNi)KeuC9 zT`+W_7v1PbM|#qgzI3K1UCuyVt{9*=~u^k*0sKMu6Nz*N#Acb#Xfejm;K!W z`Fh&bzVwyX*O)ML_S=Di;s(-Pfp$M2-U+Dp0P@{`e%~M9@hABDO~nil5kuk?zj!f> z!SRoWeB>oRdCFJb@|VYa<~6^0&UfDPp9g*DML&Adm)`WJM?L1900b&w!3$ZaLhNNf z``A0d_P57500-B{ ze)hG$eeQSP``-tD_{Bed@|WNI=SP3~)xUoBx8MEmhkyL#PlFfC;05=`fByBqfByI1 n|NjTT02IIhB)|eRzyn0U1XREUWWWY=zz2lD2$aD43kU!^cddd% literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page4.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/images/new_bookmark/page4.gif new file mode 100644 index 0000000000000000000000000000000000000000..f4c8eee596fd5341e767fc0495d533d9fdd3dc0c GIT binary patch literal 9850 zcmV-=CWYBYNk%w1VYUIl0fztp0000002~SmF9--V3=BpV2SytWP#Y3P8xd9k0B!&d zeH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mOAo_euvuw`w&`=7cyNIMrJ(RbuV+w3VBg&Ge1iOxJo_C(U8Fv-OX((C-t+K9$$6w_=Z(=j#E4zW`If5g&u zbkQsI(jk41B0Y*UwF+Y_!!G<$IW-CxjZz}LQ!f;aKgCnyP^v<;7hM!oE`-v2qYXoK z)JKKXf5DDYq|{2a)JiRgNYzw!5z;=TM6ScmPhGT76;(~6z*2=YQbkp!TGhc*)mDAC zQ-xJ-^VC^o#8W!7eO)@Oy*XqDD! zrPgY-)@#MqY}M9n<<@TX)^7z@XmtW0&>k%Cf-IsbdtCx@eSsUmfro|Ih?Uq^iKW + + + + Specifying JDBC Connection Details + + + +

Specifying JDBC Connection Details

+

Once a JDBC Driver has been selected, provide the JDBC connection details such as +userid, password and JDBC connection URL.

+ + + +

Please note that passwords are stored relatively unsecurely in a QuantumDB +configuration file. A more secure option might be to select the "Prompt for +Password" option. When this option is selected, QuantumDB will prompt the user +for a password whenever it tries to connect to the database. + +

QuantumDB provides extra JDBC URL assistance for some well-known drivers. For example, +if you're using the standard PostgreSQL driver, org.postgresql.Driver, you'll +see the following screen:

+ + + +

Similarly, the standard IBM Informix driver provides the following screen:

+ + + + + + + diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/jdbc_driver.html b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/jdbc_driver.html new file mode 100644 index 0000000..98cbf67 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/jdbc_driver.html @@ -0,0 +1,41 @@ + + + + + Creating a QuantumDB Bookmark + + + +

Specifying a JDBC Driver

+

QuantumDB uses standard JDBC Drivers to access databases. The first step in +setting up a database bookmark is, therefore, selecting a JDBC Driver.

+ + + +

The first time you try to configure a bookmark, QuantumDB will already recognize +one driver: the standard JDBC-ODBC driver provided with the Java Runtime Environment. +For some people, this will be sufficient to access databases, but most people will +probably choose to set up additional drivers. + +

Select the "Add Driver..." button to choose an alternate driver.

+ + + +

Provide the details for the new driver. Most drivers require at least one .jar file. +Specify the location of the .jar file(s), and the driver class name. Note that once you +specify the .jar locations, you can use the "Browse..." button beside the class name +field to select valid driver class names. + +

Finally, the Add Driver Wizard asks for a database type. If you're setting up a fairly +standard driver (such as, for example, the standard Oracle or DB2 driver), QuantumDB will +probably recognize the driver class name and select the appropriate driver from the list. +Otherwise, choose the corresponding database type or, if your database type isn't listed, +select "Generic JDBC". + +

The database type helps QuantumDB provide defaults for later parts of the bookmark set-up +process, and also tells the plugin how to support some of the non-standard database features +(such as sequences). + + + diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/schema_rules.html b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/schema_rules.html new file mode 100644 index 0000000..50a681a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/schema_rules.html @@ -0,0 +1,22 @@ + + + + + Choosing Which Schemas You Want to View + + + +

Choosing Which Schemas You Want to View

+

Optionally, the fourth page of the Bookmark Wizard lets you choose which +schemas you want to work with.

+ + + +

By default, bookmarks are set up to view all schemas. + +

If your database doesn't support schemas (like, for example, MySQL), then the +schema selection rule has no effect. + + + diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/toc.xml b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/toc.xml index 5af310f..d676b89 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/doc/toc.xml +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/doc/toc.xml @@ -4,6 +4,11 @@ - + + + + + + diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/bigtable.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/bigtable.gif index b90c043b856311e3a5aad26a4fbf5dc63d66544d..2ea69c8c1eb51e1cd263c645eb5c49b7446858e9 100644 GIT binary patch literal 1004 zcmZ?wbhEHb6krfwXlGzBFi5nu&5N(MOKNdU>vGQOcgvgNQ8d%Lbe?bJ;(*!}L5*ue zTQ`SKoOo!#f{O`xz`(>Nppo!^p^1e{%z)v; zgM=fUqWWnm0t=K|+BC#x@dzk7HBaM<+Sd~hq`)x4sL<^}g+Z#u(pJFR5Exo x$@*(-zL>F5q3?!w?2IGxbDW>vXluNCX?jaq<1sB$F^3uFUu;hG?POrE1^|Q_I2r%| diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/close.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/close.gif index 3fb8662c62103530e9fff857daa9cd3b8c5192f2..97335a3b9ea46b867a92de5b8e90c5c16fc27aae 100644 GIT binary patch delta 188 zcmV;t07L(j2b2epC@rL1uCBAQv$nRixVX5wy1Bf(yurc2!ok7D#>UIb z%k1gc=;-LNF}MPMA^8LY000&MEC2ui01yBW000Pa04)d{NU)&6g9ry4D0pCi!2tvm z4r~~apn?Gi5I|HAG2;LQ1P=%}aG-#I0whNoBoM%WOP2u%APg{|fXx8`5Ly6G^Ckd< q1ON~iI#lRNp#%f~5KvU+Km|yJa*PUc;8LRkgDN$Mbzo4Fi~|VD3`c(;H?uwldI&6~Gv+qz@Nj$ONU?%A{F;K7534jw#q?AYnkr*GW2@#f`? z7cX8gjDpb+7z!bv_>+a1fkB!<2jo~#o?zfu$Y7phalm1LBO5!9lubj!1IIQ_QMn5X z8WmgGMED&7PAp(J%EBrXpc4@Akd1{!W0gw7fhCSi!t5#*4hIsN7}*4QE*La4oMF_> z|7Ejt^Fanyt}3$+og&Zu=5ey9cqBM9G_DLX=h0v&VQysLIMl`)5S$R+$jBxUVXe^M t-N?cqFvB{0-RT|0tPBDH+t(amEBdI%%X8pK-0lMY-7bGN6*w?h0|26hbbJ5+ literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_all_2x.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/close_all_2x.gif new file mode 100644 index 0000000000000000000000000000000000000000..65a384158457f0d165ad631e870bb31498e75e15 GIT binary patch literal 891 zcmZ?wbhEHb6krfwXlG!sw~x1vuaAn2vYfTIde`0u_a8Hig3%BdF(IJ%lZBaqft5iA z|a5&A# znz~HJV)DTTR_-jL37jVCu5*}#R16djGz2kPazBufU}y|o&6spdCSk$rD=qAd0ut6@ j4W}BDI5`*;7U+1gW}X%DSsirn){LC1|5(WL3x6KBbz~#L&jsnf`iQ*f(jZdE+{ZDF^h4z7&J5- z>0}mC=~!X#_*gfW0Eb1vf`$er71oA15(gT*r!$7}Es0o==F+0benqF?vjP(XOA{Nb m!sqk=Mg|rh*32mkfvpa6ja;ifF86BJmVR{S)YJqA25SIT*FZ@C literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/entitygroup.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/entitygroup.gif index 8bfe5933f4c3f35913b6c76381df7057b1b45518..f124fcb1fbb8bb080e601467413281a377edc790 100644 GIT binary patch literal 928 zcmZ?wbhEHb6krfwXlGzBG)%U%%#Mn(jEaiNnc$W;#iMY#SMhA`vU$E0i~OsX2Gp($ zYH4BEJI8X)oa%dfEvHO5HfPSc|M%wn|3Bx~e-L081*0J_WJ5slCkrzJg9w8T$OoW2 z!N5_=pvfWQu_56gP(aIvqd|e0je$eNpn$=ViItm)M@AvhiJ?7kVr=HyxX#XUiqwwPgjv93d8)h*Kq*&5RC{&2oQDS$buq h-@;8I7Z$7zUmwM4CE>7bO=NS%jpSft1%ywSi>bCT0_k=KWE zXN4GO-;xk&adCTmvc?e`U)EDY8FAcRN& diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar.gif new file mode 100644 index 0000000000000000000000000000000000000000..6cb185cffe9b4c46437c456ad81b5f0e6775f8bb GIT binary patch literal 581 zcmZ?wbhEHb6krfwc*ekR@5$SDpME4Ztjz1$&@yNDiapmBZa%&5+~a%CKUYrO(X;f( zncHuVT)2Pt#n(r#zde2X{mGke;_fw#Gd5m)@bS{akJq1mdHDL<>yJNTPW*mx{eRA)a8y~;^`26ihz@keIOKnwR{@>3>f8Or=`}zE?>1yY8xy$=tk^Qy^l?@&uzkdDt|NlS3&;g1+Sr{1@+!%B~ zP6ovZ1N))|x2EQn)>Z@k&Mtj}HaC539X(wmLo@w817j0o)7hrIZ48_oQm%>|oD6L| zTzryBYSNN?Ts*C8tOATSb~20ttZc0;?0n)D7WU#|>@3Z)a`MV5vexDn{Jh-E&4TwI zC|Fxqi3&5dXuf)-;b3VkB5}7_{p(k)N7nWV=bN1VGyG?~d2#U(14rj3jTj3Smwq|> VJWeI2jY_VZ{IwRhJTwFttN|xR$M^sM literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar_2x.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/external_jar_2x.gif new file mode 100644 index 0000000000000000000000000000000000000000..11e04e21bc641147f8e76fd857cbd3c4ead74c16 GIT binary patch literal 259 zcmZ?wbhEHb6krfwIKlt~4fgT#?d$h1IPqcr{QCX-=ij)o}hrA8%i8Zy#@O|NsC0{Xh-#=QlJo#K*@2xghgUf#OdVMg|5+ z1|5(v$W8{mSkfQbZOa`yV6}_pWKYj0t?F@TGJbgR&J4qJjs~q zb@kz-D=wWvnKoiQqGeKrK0D%$IO(X)X1>e%C{d>PY?Foa+>O)KE8~jzYjevRV&jY1 r#aY?ex#}BBs=39)#l%D>bxQIVONvQoI&m{_^SAIM*sZlwWUvMR&n91; literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/next.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/next.gif index d25a3f956f88b2044da971544cb110250a9aed9f..90bcce66be60d8176b8101779966541618db44ab 100644 GIT binary patch literal 931 zcmZ?wbhEHb6krfwXlGzpmMyS6M_@&s!0H0Q)dfOpiUrpe39T;$BH@kY!kfy4H&zI5 zsu12%1wCC*k2&|ucVHAvp09`^r@h1y21A`ia4#+l8o?zf;VDROT@z}7yQCLhU%EIG< zQ;&pxf=)`tqCVt}zy=3)ekq%R8ygNbH#RdHWSnhKWM=GQ((Bl(;IO!p SA&Gg0CI59CO{_}UvFQ_ca zOwTA$FfuSOP)Mp&2rkW2@Xbsv$}g@gE=kQT)=}`xOV(3x%*jy*0x2w32udwZEh$jBQUydJTdGC2 z)rf4X71>cQy0cz%SEJbOMzK9jVtbm!_O^)qzT5o!LErC(eSd)Dlexd2&iw;Kuh##4 zwf@hm4S!#4cyRympAU!semL|ONPfNY_uJKfU$6Z8diCGWr~iIE`S@GgFjxZs`xSy2 literal 183 zcmZ?wbhEHb6krfwSoELa|NsAI&itP_^9%z6!+`?_fFuMc{$ycfU|?a;0dYZU8JIOa zcHKGmc(351m=F%_&ur7p8)6sqF8mpLYC&$!@1ln?!tW|~zwo=~5XQuy_|M-tzo4=x zGd-h3!N|bCKq0A8A-FV8!8bFxD8IO}xFj{VSVzG#FIi8)F(*eM2&AxBAt<#twWusL aMUR)u%g0T@JxC!ewMfBG&w!VU!5RQ4a6W+m diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/icons/table_details.gif b/archive/net.sourceforge.phpeclipse.quantum.sql/icons/table_details.gif new file mode 100644 index 0000000000000000000000000000000000000000..4c96271d7ff606dfa3a7f7db289ced2f0e8a0f43 GIT binary patch literal 929 zcmZ?wbhEHb6krfwXlDQc1A|0c+q~FX+k{5@XL&a?H0~FaNxkN{~!R?H%g3#z>p6C#h)z948W|Q1M&$dPcU%QF(`7#cx+hUz{n_| zTa*O VKSkGgZuUOSXR~@*!pQ~(YXCm|ODzBZ literal 0 HcmV?d00001 diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/plugin.xml b/archive/net.sourceforge.phpeclipse.quantum.sql/plugin.xml index bc0c025..710df0b 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/plugin.xml +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/plugin.xml @@ -3,8 +3,8 @@ @@ -122,7 +122,7 @@ + class="com.quantum.php.preferences.PHPSQLConnectionPreferencePage" + id="com.quantum.php.preferences.PHPSQLConnectionPreferencePage"> + class="com.quantum.php.preferences.PHPSQLTemplatesPreferencePage" + id="com.quantum.php.preferences.PHPSQLTemplatesPreferencePage"> diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ImageStore.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ImageStore.java index 4d643d7..1a7495f 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ImageStore.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ImageStore.java @@ -35,6 +35,9 @@ public class ImageStore { public static final String CLASS = "class"; public static final String CLEAR = "clear"; public static final String CLOSE = "close"; + public static final String CLOSE_DISABLED = "close_disabled"; + public static final String CLOSE_ALL = "close_all"; + public static final String CLOSE_ALL_DISABLED = "close_all_disabled"; public static final String COLUMN = "column"; public static final String CONNECT = "connect"; public static final String CONNECTED = "connected"; @@ -46,6 +49,7 @@ public class ImageStore { public static final String EDIT = "edit"; public static final String ENTITYGROUP = "entitygroup"; public static final String EXPORT = "export"; + public static final String EXTERNAL_JAR = "external_jar"; public static final String FILTER = "filter"; public static final String FOREIGNKEY = "foreignkey"; public static final String FULLDATA = "fulldata"; @@ -75,6 +79,7 @@ public class ImageStore { public static final String SUBSET = "subset"; public static final String SUCCESS = "success"; public static final String TABLE = "bigtable"; + public static final String TABLE_DETAILS = "table_details"; public static final String TEMPLATE = "template"; public static final String TORQUE = "torque"; public static final String TRIGGER = "trigger"; @@ -96,7 +101,7 @@ public class ImageStore { * @param default1 * @return */ - private static Image getImage(String imageName, AbstractUIPlugin plugin) { + public static Image getImage(String imageName, AbstractUIPlugin plugin) { ImageRegistry registry = plugin.getImageRegistry(); String key = stripSuffix(imageName); Image image = registry.get(getVersionAppropriateImage(key)); @@ -153,6 +158,9 @@ public class ImageStore { addImage(registry, url, CLASS); addImage(registry, url, CLEAR); addImage(registry, url, CLOSE); + addImage(registry, url, CLOSE_DISABLED); + addImage(registry, url, CLOSE_ALL); + addImage(registry, url, CLOSE_ALL_DISABLED); addImage(registry, url, COLUMN); addImage(registry, url, CONNECT); addImage(registry, url, CONNECTED); @@ -164,6 +172,7 @@ public class ImageStore { addImage(registry, url, EDIT); addImage(registry, url, ENTITYGROUP); addImage(registry, url, EXPORT); + addImage(registry, url, EXTERNAL_JAR); addImage(registry, url, FILTER); addImage(registry, url, FOREIGNKEY); addImage(registry, url, FULLDATA); @@ -192,6 +201,7 @@ public class ImageStore { addImage(registry, url, SUBSET); addImage(registry, url, SUCCESS); addImage(registry, url, TABLE); + addImage(registry, url, TABLE_DETAILS); addImage(registry, url, TEMPLATE); addImage(registry, url, TORQUE); addImage(registry, url, TRIGGER); @@ -202,9 +212,11 @@ public class ImageStore { if (!VersioningHelper.isEclipse30()) { addImage(registry, url, CLOSE + VERSION_2); + addImage(registry, url, CLOSE_ALL + VERSION_2); addImage(registry, url, COPY + VERSION_2); addImage(registry, url, DELETE + VERSION_2); addImage(registry, url, EXPORT + VERSION_2); + addImage(registry, url, EXTERNAL_JAR + VERSION_2); addImage(registry, url, IMPORT + VERSION_2); addImage(registry, url, PASTE + VERSION_2); addImage(registry, url, REFRESH + VERSION_2); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumPlugin.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumPlugin.java index 12d4f2f..5a8b0e9 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumPlugin.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumPlugin.java @@ -20,11 +20,9 @@ import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.RGB; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbench; @@ -130,16 +128,7 @@ public class QuantumPlugin extends AbstractUIPlugin { sysClip = new Clipboard(null); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#shutdown() - */ - public void shutdown() throws CoreException { -// if (!sysClip.isDisposed()) { -// sysClip.dispose(); -// } - super.shutdown(); - } - + /** * Write the bookmarks and subsets to a file, saving them for next use of the quantum plugin * @param target @@ -198,8 +187,9 @@ public class QuantumPlugin extends AbstractUIPlugin { getPreferenceStore().setDefault("quantum.string.bold", false); //$NON-NLS-1$ getPreferenceStore().setDefault("quantum.comment.bold", false); //$NON-NLS-1$ getPreferenceStore().setDefault("quantum.numeric.bold", false); //$NON-NLS-1$ - PreferenceConverter.setDefault(getPreferenceStore(), "quantum.font", (FontData) null); //$NON-NLS-1$ - getPreferenceStore().setDefault("com.quantum.model.Bookmark.queryHistorySize", 20); //$NON-NLS-1$ + PreferenceConverter.setDefault(getPreferenceStore(), "quantum.font", //$NON-NLS-1$ + JFaceResources.getTextFont().getFontData()); + getPreferenceStore().setDefault("com.quantum.model.Bookmark.queryHistorySize", 20); //$NON-NLS-1$ getPreferenceStore().setDefault( diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumResources.properties b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumResources.properties index 326db6a..7cb2931 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumResources.properties +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/QuantumResources.properties @@ -16,7 +16,6 @@ bookmarkview.deleteAllRows = Delete all rows from bookmarkview.deleteRowsAction = Delete all rows bookmarkview.customCopyAction = Custom Copy bookmarkview.confirmDeleteAllRows = Are you sure you want to delete all the rows from this table? -sqlqueryview.executeQuery = Execute Query (Ctrl+Shift+Q) sqlqueryview.importQuery = Import Query sqlqueryview.exportQuery = Export Query sqlqueryview.clear = Clear @@ -30,7 +29,6 @@ tableview.close = Close Table tableview.update = Update... tableview.insert = Insert... tableview.delete = Delete... -tableview.filterSort = Sort or Filter Table... tableview.showAll = Toggle Show All Table Rows tableview.defaultEncoding = Set Default Encoding tableview.UTF8Encoding = Set UTF-8 @@ -174,10 +172,13 @@ SubsetView.CreatesANewEmptySubset=Creates a new empty subset SubsetView.DeletesTheSelectedColumns=Deletes the selected column SubsetView.DeletesTheSelectedObject=Deletes the selected object SubsetView.DeletesTheSelectedSubset=Deletes the selected subset -TableView.FilterAndSort=Filter and Sort TableView.UpdateRow=Update Row TableView.InsertRow=Insert Row TableView.DeleteRow=Delete Row +TableView.PHPSelectRow=PHP Select Row +TableView.PHPUpdateRow=PHP Update Row +TableView.PHPInsertRow=PHP Insert Row +TableView.PHPDeleteRow=PHP Delete Row TableAdapter.to=\ to TableAdapter.of=\ of TableAdapter.full=\ (FULL) @@ -192,7 +193,7 @@ BookmarkWizard.PasswordAst=Password BookmarkWizard.Schema=Schema (optional) BookmarkWizard.ConnectAst=*JDBC URL BookmarkWizard.DriverAst=*Driver -BookmarkWizard.TypeAst=*Type +BookmarkWizard.TypeAst=Type BookmarkWizard.Prompt=Prompt for password BookmarkWizard.DriverFilenameAst=*Driver Filename BookmarkWizard.Browse=Browse... @@ -303,9 +304,11 @@ com.quantum.view.JDBCDriverTableViewer.driverColumn4=File Path com.quantum.wizards.AddDriverWizard.windowTitle=New JDBC Driver com.quantum.wizards.AddDriverWizard$PageImpl.title=JDBC Driver com.quantum.wizards.AddDriverWizard$PageImpl.description=Provide the following information about the driver. -com.quantum.wizards.AddDriverWizard$PageImpl.browse=Browse -com.quantum.wizards.AddDriverWizard$PageImpl.fileName=File name: -com.quantum.wizards.AddDriverWizard$PageImpl.driverClassName=Class name: +com.quantum.wizards.AddDriverWizard.addExternalJar=Add External Jar... +com.quantum.wizards.AddDriverWizard.removeJar=Remove Jar... +com.quantum.wizards.AddDriverWizard.browse=Browse... +com.quantum.wizards.AddDriverWizard.jars=Driver Jars: +com.quantum.wizards.AddDriverWizard.driverClassName=Class name: com.quantum.adapters.DatabaseAdapter.GENERIC = Generic JDBC com.quantum.adapters.DatabaseAdapter.HSQLDB = HSQL (Hypersonic) @@ -319,6 +322,8 @@ com.quantum.adapters.DatabaseAdapter.INFORMIX = Informix Dynamic Server com.quantum.adapters.DatabaseAdapter.REDBRICK = Red Brick com.quantum.adapters.DatabaseAdapter.SYBASE = Sybase com.quantum.adapters.DatabaseAdapter.POINTBASE = Pointbase +com.quantum.adapters.DatabaseAdapter.JDBC_ODBC_BRIDGE = JDBC-ODBC Bridge +com.quantum.adapters.DatabaseAdapter.MS_SQL_SERVER = Microsoft SQL Server com.quantum.view.SchemaSelectionControl.addSchemaDialog = Select a Schema com.quantum.view.SchemaSelectionControl.connectTitle = Connect Required @@ -369,6 +374,41 @@ com.quantum.actions.BaseExecuteAction.execute2=Executing Query.. com.quantum.actions.BaseExecuteAction.done=Done ({0} queries executed, {1} rows updated, {2} result sets displayed, {3} errors, {4} seconds) com.quantum.actions.BaseExecuteAction.selectBookmark=Select a bookmark +com.quantum.actions.ExecuteAction.textNoBookmark=Execute... +com.quantum.actions.ExecuteAction.text=Execute Against "{0}" com.quantum.actions.ExecuteAction.parsing=Parsing sql script... com.quantum.actions.ExecuteAction.autocommitTitle=Autocommit changed -com.quantum.actions.ExecuteAction.autocommitMessage=The autocommit setting of the bookmark, {0} has been changed. \ No newline at end of file +com.quantum.actions.ExecuteAction.autocommitMessage=The autocommit setting of the bookmark, {0} has been changed. +com.quantum.view.driver.DeleteDriverAction.text=Delete +com.quantum.view.driver.DeleteDriverAction.confirm=Confirm Delete +com.quantum.view.driver.DeleteDriverAction.confirmText=Are you sure you want to delete "{0}"? +com.quantum.view.driver.DeleteDriverAction.failed=Delete Failed +com.quantum.view.driver.DeleteDriverAction.inUse=The selected driver is still in use. +com.quantum.view.driver.DeleteDriverAction.cant=The selected driver cannot be deleted. + +com.quantum.view.tableview.NextPageAction.text=Next +com.quantum.view.tableview.PreviousPageAction.text=Previous +com.quantum.view.tableview.RefreshTableAction.text=Refresh +com.quantum.view.tableview.ChangeEncodingAction.default=Default encoding +com.quantum.view.tableview.ChangeEncodingAction.utf8=UTF-8 encoding +com.quantum.view.tableview.ChangeEncodingAction.utf16=UTF-16 encoding +com.quantum.view.tableview.CloseResultSetAction.text=Close Result Set +com.quantum.view.tableview.CloseAllResultSetsAction.text=Close All Result Sets +com.quantum.view.tableview.CopyAction.text=Copy +com.quantum.view.tableview.SelectAllAction.text=Select All +com.quantum.view.tableview.FullModeAction.text = Toggle Show All Table Rows +com.quantum.view.tableview.TableViewActionGroup.filterSortTitle = Sort or Filter Table... +com.quantum.view.tableview.TableViewActionGroup.filterSort=Filter and Sort + +com.quantum.view.tableview.ResultSetViewer.position = {0} to {1} of {2} rows. +com.quantum.view.tableview.ResultSetViewer.unknown = + +com.quantum.wizards.URLSetupControl.text=JDBC Connection URL +com.quantum.wizards.URLSetupControl.hostname=Host name: +com.quantum.wizards.URLSetupControl.port=Port: +com.quantum.wizards.URLSetupControl.dbname=Database name: +com.quantum.wizards.URLSetupControl.datasource=Data Source: +com.quantum.wizards.InformixURLSetupControl.informixserver=Informix Server: +com.quantum.wizards.URLSetupControl.url=URL: + +com.quantum.model.ConnectionException.couldNotInstaniateDriver = The driver, {0}, could not be instantiated.\nPlease ensure that the bookmark, {1}, is properly defined. diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseExecuteAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseExecuteAction.java index 5e8c9d6..c5ab79e 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseExecuteAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseExecuteAction.java @@ -10,12 +10,14 @@ import com.quantum.Messages; import com.quantum.model.Bookmark; import com.quantum.model.BookmarkCollection; import com.quantum.sql.MultiSQLServer; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; import com.quantum.sql.SQLResults; +import com.quantum.sql.SQLUpdateResults; import com.quantum.ui.dialog.ExceptionDisplayDialog; import com.quantum.ui.dialog.SimpleSelectionDialog; import com.quantum.util.connection.ConnectionUtil; import com.quantum.view.LogProxy; -import com.quantum.view.tableview.DefaultSizes; import com.quantum.view.tableview.TableView; import org.eclipse.core.runtime.CoreException; @@ -43,12 +45,12 @@ public abstract class BaseExecuteAction extends Action { if (results == null) { errorCount++; } else { - queryDuration += results.getTime()/1000.0; // calculate the execution time (in seconds) + queryDuration += results.getTime()/1000.0; resultCount++; if (results.isResultSet()) { resultsDisplayed++; } else { - resultUpdateCount += results.getUpdateCount(); + resultUpdateCount += ((SQLUpdateResults) results).getUpdateCount(); } } } @@ -129,12 +131,14 @@ public abstract class BaseExecuteAction extends Action { String query = (String) queries.get(i); System.out.println(">" + query + "<"); //$NON-NLS-1$ //$NON-NLS-2$ if (query != null && query.trim().length() > 0) { - SQLResults results = getSQLResults(connection, server, query); + SQLResults results = getSQLResults(bookmark, connection, server, query); metrics.measure(results); if (results != null) { bookmark.addQuery(query); if (results.isResultSet()) { - TableView.getInstance().loadQuery(bookmark, results); + SQLResultSetCollection.getInstance().addSQLResultSet( + (SQLResultSetResults) results); + activateTableView(); } } } @@ -145,6 +149,13 @@ public abstract class BaseExecuteAction extends Action { } /** + * + */ + private void activateTableView() { + TableView.getInstance(); + } + + /** * @return * @throws CoreException * @throws IOException @@ -162,14 +173,13 @@ public abstract class BaseExecuteAction extends Action { private void displayFinalStatusMessage(Metrics metrics) { String message = Messages.getString( BaseExecuteAction.class, - "done", //$NON-NLS-1$ //$NON-NLS-2$ + "done", //$NON-NLS-1$ metrics.getResults()); if (metrics.hasErrors()) { getStatusLineManager().setErrorMessage( ImageStore.getImage(ImageStore.STOP), message); } else { - getStatusLineManager().setMessage( - ImageStore.getImage(ImageStore.SUCCESS), message); + getStatusLineManager().setMessage(message); } } @@ -179,11 +189,10 @@ public abstract class BaseExecuteAction extends Action { * @param query * @return */ - private SQLResults getSQLResults(Connection connection, MultiSQLServer server, String query) { + private SQLResults getSQLResults(Bookmark bookmark, Connection connection, MultiSQLServer server, String query) { SQLResults results = null; try { - results = server.execute(connection, query, 1, - DefaultSizes.PAGE_SIZE, DefaultSizes.MAX_COLUMN_SIZE); + results = server.execute(bookmark, connection, query); } catch (SQLException e) { LogProxy log = LogProxy.getInstance(); log.addText(LogProxy.ERROR, diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSequenceAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSequenceAction.java index 0e967c4..d0f4217 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSequenceAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSequenceAction.java @@ -3,8 +3,13 @@ package com.quantum.actions; import java.sql.Connection; import java.util.List; +import com.quantum.adapters.DatabaseAdapter; import com.quantum.model.Bookmark; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.SQLResults; import com.quantum.util.connection.ConnectionUtil; +import com.quantum.view.ViewHelper; import com.quantum.view.bookmark.EntityNode; import com.quantum.view.bookmark.TreeNode; @@ -23,7 +28,7 @@ public abstract class BaseSequenceAction extends SelectionListenerAction { protected BaseSequenceAction(String text, IViewPart view) { super(text); - + this.view = view; } protected Bookmark getBookmark() { @@ -50,4 +55,28 @@ public abstract class BaseSequenceAction extends SelectionListenerAction { && (selection.getFirstElement() instanceof EntityNode) && ((EntityNode) selection.getFirstElement()).isSequence(); } + + public void run() { + EntityNode sequence = getEntityNode(); + String name = null; + if (sequence.isSequence()) { + Bookmark bookmark = sequence.getBookmark(); + DatabaseAdapter adapter = bookmark.getAdapter(); + if (adapter == null) return; + name = sequence.getName(); + String query = getQuery(sequence, name, adapter); + + SQLResults results = ViewHelper.tryGetResults(view, bookmark, getConnection(), query); + if (results != null && results.isResultSet()) + SQLResultSetCollection.getInstance().addSQLResultSet((SQLResultSetResults) results); + } + } + + /** + * @param sequence + * @param name + * @param adapter + * @return + */ + protected abstract String getQuery(EntityNode sequence, String name, DatabaseAdapter adapter); } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/CloseTableAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/CloseTableAction.java deleted file mode 100644 index dc99395..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/CloseTableAction.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.quantum.actions; - -import com.quantum.view.tableview.TableView; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; - -/** - * @author root - * - */ -public class CloseTableAction extends Action implements IViewActionDelegate { - TableView view; - /** - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init(IViewPart view) { - this.view = (TableView) view; - } - - /** - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run(IAction action) { - run(); - } - public void run() { - view.closeCurrent(); - } - - /** - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } - -} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAction.java index d0044f5..26f869c 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAction.java @@ -3,14 +3,17 @@ package com.quantum.actions; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; +import java.util.Arrays; import java.util.List; import java.util.Vector; import com.quantum.ImageStore; import com.quantum.Messages; +import com.quantum.QuantumPlugin; import com.quantum.model.Bookmark; import com.quantum.model.BookmarkCollection; -import com.quantum.sql.SQLParser; +import com.quantum.model.DisplayableComparator; +import com.quantum.sql.parser.SQLParser; import com.quantum.view.SQLQueryView; import org.eclipse.core.runtime.CoreException; @@ -18,6 +21,7 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.action.ActionContributionItem; import org.eclipse.jface.action.IMenuCreator; import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.Separator; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.events.MenuAdapter; import org.eclipse.swt.events.MenuEvent; @@ -32,36 +36,60 @@ import org.eclipse.swt.widgets.Shell; * @author panic */ public class ExecuteAction extends BaseExecuteAction implements IMenuCreator { + +private static final String LAST_USED_BOOKMARK_PREFERENCE = ExecuteAction.class.getName() + ".bookmark"; private SQLQueryView view; public ExecuteAction(SQLQueryView view) { this.view = view; setActionDefinitionId("com.quantum.actions.ExecuteAction"); setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.PLAY)); - setText(Messages.getString("sqlqueryview.executeQuery")); - setToolTipText(Messages.getString("sqlqueryview.executeQuery")); + initTextAndToolTip(); setMenuCreator(this); } - - + /** + * + */ + private void initTextAndToolTip() { + Bookmark lastUsedBookmark = getLastUsedBookmark(); + if (lastUsedBookmark == null) { + setText(Messages.getString(ExecuteAction.class, "textNoBookmark")); + setToolTipText(Messages.getString(ExecuteAction.class, "textNoBookmark")); + } else { + Object[] parameters = new Object[] { lastUsedBookmark.getName() }; + setText(Messages.getString(ExecuteAction.class, "text", parameters)); + setToolTipText(Messages.getString(ExecuteAction.class, "text", parameters)); + } + } + + protected Bookmark getBookmark() { + Bookmark lastUsedBookmark = getLastUsedBookmark(); + return lastUsedBookmark == null ? super.getBookmark() : lastUsedBookmark; + } protected void execute(Bookmark bookmark, Connection connection) throws IOException, CoreException, SQLException { - boolean autoCommitPreference = this.view.isAutoCommitPreference(); - boolean changed = false; - if (connection.getAutoCommit() != autoCommitPreference) { - connection.setAutoCommit(autoCommitPreference); - changed = true; - } - - super.execute(bookmark, connection); - - if (changed) { - MessageDialog.openInformation(getShell(), - Messages.getString(ExecuteAction.class, "autocommitTitle"), - Messages.getString(ExecuteAction.class, "autocommitMessage", - new Object[] { bookmark.getName() })); + try { + boolean autoCommitPreference = this.view.isAutoCommitPreference(); + boolean changed = false; + if (connection.getAutoCommit() != autoCommitPreference) { + connection.setAutoCommit(autoCommitPreference); + changed = true; + } + + super.execute(bookmark, connection); + + if (changed) { + MessageDialog.openInformation(getShell(), + Messages.getString(ExecuteAction.class, "autocommitTitle"), + Messages.getString(ExecuteAction.class, "autocommitMessage", + new Object[] { bookmark.getName() })); + } + } finally { + QuantumPlugin.getDefault().getPreferenceStore().setValue( + LAST_USED_BOOKMARK_PREFERENCE, bookmark.getName()); + initTextAndToolTip(); } } /** @@ -113,18 +141,58 @@ public class ExecuteAction extends BaseExecuteAction implements IMenuCreator { } protected void fillMenu(Menu menu) { + Bookmark lastUsedBookmark = getLastUsedBookmark(); + + if (lastUsedBookmark != null) { + createSubAction(menu, lastUsedBookmark); + Separator separator = new Separator(); + separator.fill(menu, -1); + } + Bookmark[] bookmarks = BookmarkCollection.getInstance().getBookmarks(); + Arrays.sort(bookmarks, new DisplayableComparator()); for (int i = 0, length = bookmarks == null ? 0 : bookmarks.length; i < length; i++) { final Bookmark bookmark = bookmarks[i]; - Action action = new Action() { - public void run() { - ExecuteAction.this.execute(bookmark); - } - }; - action.setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.BOOKMARK)); + createSubAction(menu, bookmark); + } + } + + + + /** + * @return + */ + private Bookmark getLastUsedBookmark() { + String lastUsedName = QuantumPlugin.getDefault().getPreferenceStore().getString( + LAST_USED_BOOKMARK_PREFERENCE); + Bookmark lastUsedBookmark = lastUsedName == null + ? null + : BookmarkCollection.getInstance().find(lastUsedName); + return lastUsedBookmark; + } + + + + /** + * @param menu + * @param bookmark + */ + private void createSubAction(Menu menu, final Bookmark bookmark) { + Action action = new Action() { + public void run() { + ExecuteAction.this.execute(bookmark); + } + }; + action.setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.BOOKMARK)); + + // The last '@' sign is treated specially, so if the + // bookmark name contains an '@', then add an extra one to the end + if (bookmark.getName().indexOf('@') >= 0) { + action.setText(bookmark.getName() + '@'); + } else { action.setText(bookmark.getName()); - ActionContributionItem item = new ActionContributionItem(action); - item.fill(menu, -1); } + ActionContributionItem item = new ActionContributionItem(action); + item.fill(menu, -1); } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAgainstAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAgainstAction.java index ffdac6c..0051eaf 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAgainstAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ExecuteAgainstAction.java @@ -5,12 +5,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import com.quantum.ImageStore; -import com.quantum.Messages; -import com.quantum.model.Bookmark; -import com.quantum.model.BookmarkCollection; -import com.quantum.sql.SQLParser; -import com.quantum.ui.dialog.SimpleSelectionDialog; +import com.quantum.sql.parser.SQLParser; import com.quantum.util.io.InputStreamHelper; import org.eclipse.core.resources.IFile; @@ -20,7 +15,6 @@ import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IObjectActionDelegate; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchPart; diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/NextSequenceAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/NextSequenceAction.java index 83a7a26..f4b032c 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/NextSequenceAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/NextSequenceAction.java @@ -3,11 +3,7 @@ package com.quantum.actions; import com.quantum.ImageStore; import com.quantum.Messages; import com.quantum.adapters.DatabaseAdapter; -import com.quantum.model.Bookmark; -import com.quantum.sql.SQLResults; -import com.quantum.view.ViewHelper; import com.quantum.view.bookmark.EntityNode; -import com.quantum.view.tableview.TableView; import org.eclipse.ui.IViewPart; @@ -22,19 +18,13 @@ public class NextSequenceAction extends BaseSequenceAction { setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.APPEND)); } - public void run() { - EntityNode sequence = getEntityNode(); - String name = null; - if (sequence.isSequence()) { - Bookmark bookmark = sequence.getBookmark(); - DatabaseAdapter adapter = bookmark.getAdapter(); - if (adapter == null) return; - name = sequence.getName(); - String query = adapter.getNextValue(name, sequence.getEntity().getSchema()); - - SQLResults results = ViewHelper.tryGetResults(view, getConnection(), query); - if (results != null && ! results.isError()) - TableView.getInstance().loadQuery(bookmark, results); - } + /** + * @param sequence + * @param name + * @param adapter + * @return + */ + protected String getQuery(EntityNode sequence, String name, DatabaseAdapter adapter) { + return adapter.getNextValue(name, sequence.getEntity().getSchema()); } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/PrevSequenceAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/PrevSequenceAction.java index ab63311..ba086d0 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/PrevSequenceAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/PrevSequenceAction.java @@ -7,11 +7,7 @@ package com.quantum.actions; import com.quantum.ImageStore; import com.quantum.Messages; import com.quantum.adapters.DatabaseAdapter; -import com.quantum.model.Bookmark; -import com.quantum.sql.SQLResults; -import com.quantum.view.ViewHelper; import com.quantum.view.bookmark.EntityNode; -import com.quantum.view.tableview.TableView; import org.eclipse.ui.IViewPart; @@ -25,17 +21,13 @@ public class PrevSequenceAction extends BaseSequenceAction { setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.GRID)); } - public void run() { - EntityNode sequence = getEntityNode(); - if (sequence.isSequence()) { - Bookmark bookmark = sequence.getBookmark(); - DatabaseAdapter adapter = bookmark.getAdapter(); - if (adapter == null) return; - String name = sequence.getName(); - String query = adapter.getPrevValue(name, sequence.getEntity().getSchema()); - SQLResults results = ViewHelper.tryGetResults(view, getConnection(), query); - if (results != null && ! results.isError()) - TableView.getInstance().loadQuery(bookmark, results); - } + /** + * @param sequence + * @param name + * @param adapter + * @return + */ + protected String getQuery(EntityNode sequence, String name, DatabaseAdapter adapter) { + return adapter.getPrevValue(name, sequence.getEntity().getSchema()); } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/RefreshTableAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/RefreshTableAction.java deleted file mode 100644 index d987d8a..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/RefreshTableAction.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.quantum.actions; - -import com.quantum.view.tableview.TableView; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; - -/** - * @author root - * Implements the "Refresh Table" action for the TableView view - */ -public class RefreshTableAction extends Action implements IViewActionDelegate { - TableView view; - /** - * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) - */ - public void init(IViewPart view) { - this.view = (TableView) view; - } - - /** - * @see org.eclipse.ui.IActionDelegate#run(IAction) - */ - public void run(IAction action) { - run(); - } - public void run() { - view.refreshCurrent(); - } - - /** - * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - } - -} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableAction.java index 91b9916..7975f0b 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableAction.java @@ -1,12 +1,22 @@ package com.quantum.actions; +import java.sql.SQLException; + import com.quantum.ImageStore; import com.quantum.Messages; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.Bookmark; import com.quantum.model.Entity; +import com.quantum.sql.MultiSQLServer; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.SQLResults; +import com.quantum.ui.dialog.ExceptionDisplayDialog; +import com.quantum.util.connection.ConnectionUtil; import com.quantum.view.bookmark.EntityNode; -import com.quantum.view.tableview.TableView; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IViewPart; import org.eclipse.ui.actions.SelectionListenerAction; @@ -16,28 +26,42 @@ import org.eclipse.ui.actions.SelectionListenerAction; */ public class ViewTableAction extends SelectionListenerAction { private Entity entity; + private ConnectionUtil connectionUtil = new ConnectionUtil(); + private final IViewPart view; public ViewTableAction(IViewPart view) { super(Messages.getString(ViewTableAction.class, "text")); + this.view = view; setImageDescriptor( ImageStore.getImageDescriptor(ImageStore.OPEN_TABLE)); } public void run() { - TableView.getInstance().loadTable(this.entity); - // TODO: reinstate this -// } else if (view instanceof SubsetView){ -// SubsetView subsetView = (SubsetView) view; -// node = (TreeNode) subsetView.getCurrent(); -// if (!(node instanceof ObjectNode)) return; -// ObjectNode objectNode = (ObjectNode) node; -// -// String query = objectNode.getQuery(); -// -// SQLResults results = ViewHelper.tryGetResults(view, objectNode.getConnection(), query); -// if (results != null && ! results.isError()) -// TableView.getInstance().loadQuery(bookmark.getBookmark(), results); -// + + Bookmark bookmark = this.entity.getBookmark(); + DatabaseAdapter adapter = bookmark.getAdapter(); + String query = adapter.getTableQuery((entity).getQualifiedName()); + + try { + SQLResults results = MultiSQLServer.getInstance().execute( + bookmark, + this.connectionUtil.connect(bookmark, getShell()), + this.entity, + query); + + if (results != null && results.isResultSet()) { + SQLResultSetCollection.getInstance().addSQLResultSet((SQLResultSetResults) results); + } + } catch (SQLException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); + } + } + + /** + * @return + */ + private Shell getShell() { + return this.view.getSite().getShell(); } public boolean updateSelection(IStructuredSelection selection) { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableDetailsAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableDetailsAction.java index 9d16eef..19d803c 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableDetailsAction.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/ViewTableDetailsAction.java @@ -1,17 +1,19 @@ package com.quantum.actions; import java.sql.Connection; +import java.sql.SQLException; import java.util.List; import com.quantum.ImageStore; import com.quantum.Messages; import com.quantum.model.Bookmark; import com.quantum.model.Entity; -import com.quantum.sql.SQLResults; +import com.quantum.sql.MultiSQLServer; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.ui.dialog.ExceptionDisplayDialog; import com.quantum.util.connection.ConnectionUtil; -import com.quantum.view.ViewHelper; import com.quantum.view.bookmark.EntityNode; -import com.quantum.view.tableview.TableView; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; @@ -26,20 +28,23 @@ public class ViewTableDetailsAction extends SelectionListenerAction { public ViewTableDetailsAction(IViewPart view) { super(Messages.getString(ViewTableDetailsAction.class, "text")); - setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.OPEN_TABLE)); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.TABLE_DETAILS)); this.view = view; } public void run() { Entity entity = getEntity(); - StringBuffer query = new StringBuffer(); - query.append(Messages.getString("MetaDataKey")+Messages.getString("MetaDataKeySeparator")); //$NON-NLS-1$ //$NON-NLS-2$ - query.append(entity.getQuotedTableName()); Connection connection = connectionUtil.getConnection(getBookmark(), getShell()); if (connection != null) { - SQLResults results = ViewHelper.tryGetResults(view, connection, query.toString()); - if (results != null && ! results.isError()) - TableView.getInstance().loadQuery(entity.getBookmark(), results); + try { + SQLResultSetResults results = + MultiSQLServer.getInstance().getMetaData(entity, connection); + if (results != null) { + SQLResultSetCollection.getInstance().addSQLResultSet(results); + } + } catch (SQLException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); + } } } public void selectionChanged(IAction action, ISelection selection) { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/AdapterFactory.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/AdapterFactory.java index 37f05c4..8ff6821 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/AdapterFactory.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/AdapterFactory.java @@ -31,6 +31,26 @@ public class AdapterFactory { } } + static class DriverInfo { + private final String type; + private final String urlPattern; + + DriverInfo(String type) { + this(type, null); + } + DriverInfo(String type, String urlPattern) { + this.type = type; + this.urlPattern = urlPattern; + + } + public String getType() { + return this.type; + } + public String getURLPattern() { + return this.urlPattern; + } + } + public static final String GENERIC = "GENERIC"; //$NON-NLS-1$ public static final String HSQLDB = "HSQLDB"; //$NON-NLS-1$ public static final String ORACLE = "ORACLE"; //$NON-NLS-1$ @@ -43,33 +63,39 @@ public class AdapterFactory { public static final String REDBRICK = "REDBRICK"; //$NON-NLS-1$ public static final String POINTBASE = "POINTBASE"; //$NON-NLS-1$ public static final String SYBASE = "SYBASE"; //$NON-NLS-1$ + public static final String JDBC_ODBC_BRIDGE = "JDBC_ODBC_BRIDGE"; //$NON-NLS-1$ + public static final String MS_SQL_SERVER = "MS_SQL_SERVER"; //$NON-NLS-1$ private static final Map DRIVER_MAP = Collections.synchronizedMap(new HashMap()); static { - DRIVER_MAP.put("com.ddtek.jdbc.informix.InformixDriver", AdapterFactory.INFORMIX); - DRIVER_MAP.put("com.ddtek.jdbc.db2.DB2Driver", AdapterFactory.DB2); - DRIVER_MAP.put("com.ddtek.jdbc.oracle.OracleDriver", AdapterFactory.ORACLE); - DRIVER_MAP.put("com.ddtek.jdbc.sqlserver.SQLServerDriver", AdapterFactory.GENERIC); - DRIVER_MAP.put("com.ddtek.jdbc.sybase.SybaseDriver", AdapterFactory.SYBASE); - DRIVER_MAP.put("com.ibm.as400.access.AS400JDBCDriver", AdapterFactory.DB2AS400); - DRIVER_MAP.put("COM.ibm.db2.jdbc.app.DB2Driver", AdapterFactory.DB2); - DRIVER_MAP.put("COM.ibm.db2.jdbc.net.DB2Driver", AdapterFactory.DB2); - DRIVER_MAP.put("com.inet.ora.OraDriver", AdapterFactory.ORACLE); - DRIVER_MAP.put("com.inet.drda.DRDADriver", AdapterFactory.DB2); - DRIVER_MAP.put("com.inet.syb.SybDriver", AdapterFactory.SYBASE); - DRIVER_MAP.put("com.inet.tds.TdsDriver", AdapterFactory.GENERIC); - DRIVER_MAP.put("com.informix.jdbc.IfxDriver", AdapterFactory.INFORMIX); - DRIVER_MAP.put("com.microsoft.jdbc.sqlserver.SQLServerDriver", AdapterFactory.GENERIC); - DRIVER_MAP.put("com.mysql.jdbc.Driver", AdapterFactory.MYSQL); - DRIVER_MAP.put("com.pointbase.jdbc.jdbcUniversalDriver", AdapterFactory.POINTBASE); - DRIVER_MAP.put("com.sybase.jdbcx.SybDriver", AdapterFactory.SYBASE); - DRIVER_MAP.put("oracle.jdbc.driver.OracleDriver", AdapterFactory.ORACLE); - DRIVER_MAP.put("org.gjt.mm.mysql.Driver", AdapterFactory.MYSQL); - DRIVER_MAP.put("org.hsqldb.jdbcDriver", AdapterFactory.HSQLDB); - DRIVER_MAP.put("org.postgresql.Driver", AdapterFactory.POSTGRES); - DRIVER_MAP.put("weblogic.jdbc.informix.InformixDriver", AdapterFactory.INFORMIX); - DRIVER_MAP.put("weblogic.jdbc.sqlserver.SybaseDriver", AdapterFactory.SYBASE); + DRIVER_MAP.put("com.ddtek.jdbc.informix.InformixDriver", new DriverInfo(INFORMIX)); + DRIVER_MAP.put("com.ddtek.jdbc.db2.DB2Driver", new DriverInfo(DB2, "jdbc:datadirect:db2://${hostname}:${port};DatabaseName=${dbname}")); + DRIVER_MAP.put("com.ddtek.jdbc.oracle.OracleDriver", new DriverInfo(ORACLE)); + DRIVER_MAP.put("com.ddtek.jdbc.sqlserver.SQLServerDriver", new DriverInfo(GENERIC)); + DRIVER_MAP.put("com.ddtek.jdbc.sybase.SybaseDriver", new DriverInfo(SYBASE)); + DRIVER_MAP.put("com.ibm.as400.access.AS400JDBCDriver", new DriverInfo(DB2AS400)); + DRIVER_MAP.put("COM.ibm.db2.jdbc.app.DB2Driver", new DriverInfo(DB2, "jdbc:db2:{dbname}")); + DRIVER_MAP.put("COM.ibm.db2.jdbc.net.DB2Driver", new DriverInfo(DB2, "jdbc:db2://{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("com.inet.ora.OraDriver", new DriverInfo(ORACLE)); + DRIVER_MAP.put("com.inet.drda.DRDADriver", new DriverInfo(DB2, "jdbc:inetdb2:{hostname}:{port}?database={dbname}")); + DRIVER_MAP.put("com.inet.syb.SybDriver", new DriverInfo(SYBASE)); + DRIVER_MAP.put("com.inet.tds.TdsDriver", new DriverInfo(MS_SQL_SERVER)); + DRIVER_MAP.put("com.informix.jdbc.IfxDriver", new DriverInfo(INFORMIX, "jdbc:informix-sqli://{hostname}:{port}/{dbname}:INFORMIXSERVER={informixserver}")); + DRIVER_MAP.put("com.microsoft.jdbc.sqlserver.SQLServerDriver", new DriverInfo(MS_SQL_SERVER)); + DRIVER_MAP.put("com.mysql.jdbc.Driver", new DriverInfo(MYSQL, "jdbc:mysql://{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("com.pointbase.jdbc.jdbcUniversalDriver", new DriverInfo(POINTBASE, "jdbc:pointbase:server://{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("com.sybase.jdbc.SybDriver", new DriverInfo(SYBASE, "jdbc:sybase:Tds:{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("com.sybase.jdbc2.jdbc.SybDriver", new DriverInfo(SYBASE, "jdbc:sybase:Tds:{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("com.sybase.jdbcx.SybDriver", new DriverInfo(SYBASE, "jdbc:sybase:Tds:{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("net.sourceforge.jtds.jdbc.Driver", new DriverInfo(MS_SQL_SERVER)); + DRIVER_MAP.put("oracle.jdbc.driver.OracleDriver", new DriverInfo(ORACLE)); + DRIVER_MAP.put("org.gjt.mm.mysql.Driver", new DriverInfo(MYSQL, "jdbc:mysql://{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("org.hsqldb.jdbcDriver", new DriverInfo(HSQLDB)); + DRIVER_MAP.put("org.postgresql.Driver", new DriverInfo(POSTGRES, "jdbc:postgresql://{hostname}:{port}/{dbname}")); + DRIVER_MAP.put("sun.jdbc.odbc.JdbcOdbcDriver", new DriverInfo(JDBC_ODBC_BRIDGE, "jdbc:odbc:{datasource}")); + DRIVER_MAP.put("weblogic.jdbc.informix.InformixDriver", new DriverInfo(INFORMIX)); + DRIVER_MAP.put("weblogic.jdbc.sqlserver.SybaseDriver", new DriverInfo(SYBASE)); } private static AdapterFactory instance; @@ -83,12 +109,14 @@ public class AdapterFactory { addAdapter(new DB2Adapter()); addAdapter(new DB2AS400Adapter()); addAdapter(new PostgresAdapter()); - addAdapter(new GenericAdapter(MYSQL)); + addAdapter(new MySQLAdapter()); addAdapter(new AdabasDAdapter()); - addAdapter(new GenericAdapter(INFORMIX)); + addAdapter(new InformixAdapter()); addAdapter(new RedBrickAdapter()); addAdapter(new GenericAdapter(SYBASE)); addAdapter(new GenericAdapter(POINTBASE)); + addAdapter(new GenericAdapter(JDBC_ODBC_BRIDGE)); + addAdapter(new MSSQLServerAdapter()); } private void addAdapter(DatabaseAdapter adapter) { this.adapters.put(adapter.getType(), adapter); @@ -121,6 +149,15 @@ public class AdapterFactory { * @return the adapter type, or null if the adapter type is not known */ public String getAdapterType(String driverClassName) { - return (String) DRIVER_MAP.get(driverClassName); + DriverInfo driverInfo = (DriverInfo) DRIVER_MAP.get(driverClassName); + return driverInfo == null ? null : driverInfo.getType(); } + /** + * @param type + * @return + */ + public String getURLPattern(String driverClassName) { + DriverInfo driverInfo = (DriverInfo) DRIVER_MAP.get(driverClassName); + return driverInfo == null ? null : driverInfo.getURLPattern(); + } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2AS400Adapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2AS400Adapter.java index 437dbf4..755b768 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2AS400Adapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2AS400Adapter.java @@ -6,13 +6,15 @@ public class DB2AS400Adapter extends DatabaseAdapter { super(AdapterFactory.DB2AS400); } public String getShowTableQuery(String qualifier) { - return "SELECT TABLE_NAME FROM QSYS2.SYSTABLES WHERE table_schema = '" + + return "SELECT table_schema, TABLE_NAME FROM QSYS2.SYSTABLES " + + "WHERE table_schema = '" + qualifier.toUpperCase() + - "' AND TABLE_TYPE IN ('T', 'P')"; //$NON-NLS-1$ //$NON-NLS-2$ + "' AND TABLE_TYPE IN ('T', 'P')"; } public String getShowViewQuery(String qualifier) { - return "SELECT TABLE_NAME FROM QSYS2.SYSTABLES WHERE table_schema = '" + + return "SELECT table_schema, TABLE_NAME FROM QSYS2.SYSTABLES " + + "WHERE table_schema = '" + qualifier.toUpperCase() + - "' AND TABLE_TYPE IN ('V', 'L')"; //$NON-NLS-1$ //$NON-NLS-2$ + "' AND TABLE_TYPE IN ('V', 'L')"; } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2Adapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2Adapter.java index 3f0141d..29ef4b7 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2Adapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DB2Adapter.java @@ -1,6 +1,8 @@ package com.quantum.adapters; -import com.quantum.sql.SQLHelper; +import java.util.HashMap; +import java.util.Map; + public class DB2Adapter extends DatabaseAdapter { /** @@ -10,18 +12,25 @@ public class DB2Adapter extends DatabaseAdapter { super(AdapterFactory.DB2); } public String getShowTableQuery(String qualifier) { - return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$ + return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$ } public String getShowViewQuery(String qualifier) { - return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$ + return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$ } public String getShowSequenceQuery(String qualifier) { - return "SELECT SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$ + return "SELECT seqschema, SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$ } public String getNextValue(String sequence, String owner) { - return "VALUES NEXTVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$ + return "VALUES NEXTVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$ } public String getPrevValue(String sequence, String owner) { - return "VALUES PREVVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$ + return "VALUES PREVVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$ + } + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + // the standard driver doesn't use these values, but other drivers might... + map.put("port", "50000"); + map.put("hostname", "localhost"); + return map; } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DatabaseAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DatabaseAdapter.java index 12bde71..1917e9f 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DatabaseAdapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/DatabaseAdapter.java @@ -1,8 +1,11 @@ package com.quantum.adapters; +import java.util.HashMap; +import java.util.Map; + import com.quantum.Messages; -import com.quantum.sql.SQLHelper; import com.quantum.util.StringUtil; +import com.quantum.util.sql.TypesHelper; /** * Abstract base class for all the adapter classes. Most functions can be redefined in @@ -127,7 +130,7 @@ public abstract class DatabaseAdapter { * @return */ protected boolean isTextType(int type, String typeString) { - return SQLHelper.isText(type); + return TypesHelper.isText(type); } @@ -212,4 +215,12 @@ public abstract class DatabaseAdapter { public String getType() { return this.type; } + + protected String getQualifiedName(String schema, String name) { + return (schema != null && schema.length() > 0) ? schema + "." + name : name; + } + + public Map getDefaultConnectionParameters() { + return new HashMap(); + } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/InformixAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/InformixAdapter.java new file mode 100644 index 0000000..46862e0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/InformixAdapter.java @@ -0,0 +1,43 @@ +package com.quantum.adapters; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Map; + +/** + * @author BC Holmes + */ +public class InformixAdapter extends GenericAdapter { + + /** + * @param type + */ + protected InformixAdapter() { + super(AdapterFactory.INFORMIX); + } + + /** + * Get the default connection properties for Informix. These defaults assume that + * the database is located on the user's local machine. Informix doesn't allow + * for "localhost". + */ + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + map.put("hostname", getHostName()); + map.put("informixserver", "ol_" + getHostName()); + map.put("port", "1526"); + return map; + } + + /** + * @return + */ + private String getHostName() { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + return "localhost"; + } + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MSSQLServerAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MSSQLServerAdapter.java new file mode 100644 index 0000000..c38bf2c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MSSQLServerAdapter.java @@ -0,0 +1,25 @@ +package com.quantum.adapters; + +import java.util.HashMap; +import java.util.Map; + + +/** + * @author BC + */ +public class MSSQLServerAdapter extends GenericAdapter { + + /** + * @param type + */ + protected MSSQLServerAdapter() { + super(AdapterFactory.MS_SQL_SERVER); + } + + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + map.put("port", "1433"); + map.put("hostname", "localhost"); + return map; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MySQLAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MySQLAdapter.java index 3478b3c..e4e1ad3 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MySQLAdapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/MySQLAdapter.java @@ -1,8 +1,11 @@ package com.quantum.adapters; +import java.util.HashMap; +import java.util.Map; -public class MySQLAdapter extends DatabaseAdapter { + +public class MySQLAdapter extends GenericAdapter { /** * @param type @@ -10,7 +13,10 @@ public class MySQLAdapter extends DatabaseAdapter { protected MySQLAdapter() { super(AdapterFactory.MYSQL); } -// public String getShowTableQuery(String qualifier, boolean isDefault) { -// return "SHOW TABLES"; //$NON-NLS-1$ -// } + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + map.put("port", "3306"); + map.put("hostname", "localhost"); + return map; + } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/OracleAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/OracleAdapter.java index a01fbbf..78d2cce 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/OracleAdapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/OracleAdapter.java @@ -1,7 +1,6 @@ package com.quantum.adapters; import com.quantum.Messages; -import com.quantum.sql.SQLHelper; import com.quantum.util.QuantumUtil; @@ -15,9 +14,9 @@ public class OracleAdapter extends DatabaseAdapter { } public String getPrevValue(String sequence, String owner) { return "SELECT LAST_NUMBER FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER = '" + owner + "' AND SEQUENCE_NAME = '" + sequence + "'"; //$NON-NLS-1$ //$NON-NLS-2$ - } + } public String getNextValue(String sequence, String owner) { - return "SELECT " + SQLHelper.getQualifiedName(owner, sequence) + ".NEXTVAL FROM DUAL"; + return "SELECT " + getQualifiedName(owner, sequence) + ".NEXTVAL FROM DUAL"; } public String getCommentsQuery(String tableName, String column) { String query = "SELECT COMMENTS FROM ALL_COL_COMMENTS WHERE TABLE_NAME = '"; diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PointbaseAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PointbaseAdapter.java new file mode 100644 index 0000000..7f7a5c0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PointbaseAdapter.java @@ -0,0 +1,25 @@ +package com.quantum.adapters; + +import java.util.HashMap; +import java.util.Map; + + +/** + * @author BC + */ +public class PointbaseAdapter extends GenericAdapter { + + /** + * @param type + */ + protected PointbaseAdapter() { + super(AdapterFactory.POINTBASE); + } + + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + map.put("port", "9093"); + map.put("hostname", "localhost"); + return map; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PostgresAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PostgresAdapter.java index 3283163..90bf17f 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PostgresAdapter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/adapters/PostgresAdapter.java @@ -1,6 +1,8 @@ package com.quantum.adapters; -import com.quantum.sql.SQLHelper; +import java.util.HashMap; +import java.util.Map; + import com.quantum.util.QuantumUtil; import com.quantum.util.sql.TypesHelper; @@ -24,10 +26,10 @@ public class PostgresAdapter extends DatabaseAdapter { "and pg_namespace.nspname = '" + qualifier + "'"; } public String getNextValue(String sequence, String owner) { - return "SELECT NEXTVAL('" + SQLHelper.getQualifiedName(owner, sequence) + "')"; + return "SELECT NEXTVAL('" + getQualifiedName(owner, sequence) + "')"; } public String getPrevValue(String sequence, String owner) { - return "SELECT * FROM " + SQLHelper.getQualifiedName(owner, sequence); + return "SELECT * FROM " + getQualifiedName(owner, sequence); } /** @@ -51,6 +53,9 @@ public class PostgresAdapter extends DatabaseAdapter { return super.quote(string, type, typeString); } + public String getTableQuery(String table) { + return "SELECT OID, * FROM " + filterTableName(table); //$NON-NLS-1$ + } /** * @see com.quantum.adapters.DatabaseAdapter#filterTableName(java.lang.String) */ @@ -72,4 +77,10 @@ public class PostgresAdapter extends DatabaseAdapter { return "public"; } + public Map getDefaultConnectionParameters() { + Map map = new HashMap(); + map.put("port", "5432"); + map.put("hostname", "localhost"); + return map; + } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java index bf225cf..e90ed5c 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentAssistProcessor.java @@ -28,7 +28,7 @@ public class SQLContentAssistProcessor implements IContentAssistProcessor { ICompletionProposal proposal = new CompletionProposal("select", offset, 0, 6, ImageStore.getImage(ImageStore.TEMPLATE), "select - select columns from a table or view", null, null); -System.out.println(this.text); +//System.out.println(this.text); // complete a key word // complete a function diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentOutlinePage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentOutlinePage.java new file mode 100644 index 0000000..c32788e --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLContentOutlinePage.java @@ -0,0 +1,155 @@ +package com.quantum.editors; + +import java.util.List; +import java.util.StringTokenizer; + +import com.quantum.ImageStore; +import com.quantum.sql.parser.SQLParser; + +import org.eclipse.jface.text.DocumentEvent; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IDocumentListener; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; + + +/** + * @author BC + */ +public class SQLContentOutlinePage extends ContentOutlinePage { + + class LabelProviderImpl implements ILabelProvider { + public Image getImage(Object element) { + return ImageStore.getImage(ImageStore.SCRIPT); + } + + public String getText(Object element) { + if (element != null && element instanceof String) { + StringTokenizer tokenizer = new StringTokenizer((String) element); + + String token = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : ""; + + if ("select".equalsIgnoreCase(token) + || "update".equalsIgnoreCase(token) + || "insert".equalsIgnoreCase(token) + || "delete".equalsIgnoreCase(token) + || "grant".equalsIgnoreCase(token)) { + return token; + } else if (tokenizer.hasMoreTokens()) { + return token + " " + tokenizer.nextToken(); + } else { + return token; + } + } else { + return element == null ? "" : element.toString(); + } + } + + public void addListener(ILabelProviderListener listener) { + } + + public void dispose() { + } + + public boolean isLabelProperty(Object element, String property) { + return false; + } + + public void removeListener(ILabelProviderListener listener) { + } + } + + class ContentProviderImpl implements ITreeContentProvider { + + public Object[] getElements(Object inputElement) { + if (inputElement != null && inputElement instanceof IDocument) { + String text = ((IDocument) inputElement).get(); + List sql = SQLParser.parse(text); + return sql.toArray(); + } else { + return null; + } + } + + public void dispose() { + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + public Object[] getChildren(Object parentElement) { + return null; + } + + public Object getParent(Object element) { + return null; + } + + public boolean hasChildren(Object element) { + return false; + } + } + + private IDocumentListener listener; + + private final SQLDocumentProvider documentProvider; + private IEditorInput editorInput; + /** + * @param documentProvider + * @param editor + */ + public SQLContentOutlinePage(SQLDocumentProvider documentProvider, SQLEditor editor) { + this.documentProvider = documentProvider; + } + + + + public void createControl(Composite parent) { + super.createControl(parent); + + final TreeViewer treeViewer = getTreeViewer(); + + IDocument document = this.documentProvider.getDocument(this.editorInput); + if (document != null) { + treeViewer.setLabelProvider(new LabelProviderImpl()); + treeViewer.setContentProvider(new ContentProviderImpl()); + treeViewer.setInput(document); + + this.listener = new IDocumentListener() { + + public void documentAboutToBeChanged(DocumentEvent event) { + } + + public void documentChanged(DocumentEvent event) { + treeViewer.refresh(); + } + }; + document.addDocumentListener(this.listener); + } + } + /** + * @param editorInput + */ + public void setInput(IEditorInput editorInput) { + this.editorInput = editorInput; + } + + + public void dispose() { + if (this.listener != null) { + IDocument document = this.documentProvider.getDocument(this.editorInput); + if (document != null) { + document.removeDocumentListener(this.listener); + this.listener = null; + } + } + super.dispose(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLDocumentProvider.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLDocumentProvider.java index 1fab1c3..51c7d28 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLDocumentProvider.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLDocumentProvider.java @@ -13,6 +13,7 @@ public class SQLDocumentProvider extends FileDocumentProvider { } protected IDocument createDocument(Object element) throws CoreException { +//System.out.println("element: " + element.getClass().getName()); IDocument document = super.createDocument(element); if (document != null) { IDocumentPartitioner partitioner = diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLEditor.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLEditor.java index 1ceab17..a27f6ec 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLEditor.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLEditor.java @@ -12,17 +12,20 @@ import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.editors.text.TextEditor; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; public class SQLEditor extends TextEditor { - SQLConfiguration config; + private SQLSourceViewerConfiguration config; private ColorManager colorManager; + private SQLContentOutlinePage outlinePage; /** * An editor capable of editing SQL scripts */ public SQLEditor() { super(); +//System.out.println("SQL Editor"); colorManager = new ColorManager(); - config = new SQLConfiguration(colorManager); + config = new SQLSourceViewerConfiguration(colorManager); config.loadPrefs(); setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); @@ -56,4 +59,18 @@ public class SQLEditor extends TextEditor { Color background = colorManager.getColor(SQLColorConstants.BACKGROUND); widget.setBackground(background); } + + public Object getAdapter(Class required) { + if (IContentOutlinePage.class.equals(required)) { + if (this.outlinePage == null) { + this.outlinePage= new SQLContentOutlinePage( + (SQLDocumentProvider) getDocumentProvider(), this); + if (getEditorInput() != null) + this.outlinePage.setInput(getEditorInput()); + } + return this.outlinePage; + } + return super.getAdapter(required); + } + } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLSourceViewerConfiguration.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLSourceViewerConfiguration.java new file mode 100644 index 0000000..8582103 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/editors/SQLSourceViewerConfiguration.java @@ -0,0 +1,110 @@ +package com.quantum.editors; + +import java.util.HashMap; + +import com.quantum.QuantumPlugin; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferenceConverter; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.TextAttribute; +import org.eclipse.jface.text.contentassist.ContentAssistant; +import org.eclipse.jface.text.contentassist.IContentAssistant; +import org.eclipse.jface.text.presentation.IPresentationReconciler; +import org.eclipse.jface.text.presentation.PresentationReconciler; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.source.SourceViewerConfiguration; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.RGB; + +public class SQLSourceViewerConfiguration extends SourceViewerConfiguration { + private PresentationReconciler reconciler = new PresentationReconciler(); + private ColorManager colorManager; + private HashMap cache = new HashMap(); + private boolean textBold = false; + private boolean keywordBold = true; + private boolean stringBold = false; + private boolean commentBold = false; + private boolean numericBold = false; + public SQLSourceViewerConfiguration(ColorManager colorManager) { + this.colorManager = colorManager; + } + public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { + return new String[] { + IDocument.DEFAULT_CONTENT_TYPE, + SQLPartitionScanner.SQL_COMMENT, + SQLPartitionScanner.SQL_KEYWORD, + SQLPartitionScanner.SQL_IDENTIFIER}; + } + + public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { + initializeColors(); + return reconciler; + } + public void loadPrefs() { + IPreferenceStore store = QuantumPlugin.getDefault().getPreferenceStore(); + textBold = store.getBoolean("quantum.text.bold"); //$NON-NLS-1$ + keywordBold = store.getBoolean("quantum.keyword.bold"); //$NON-NLS-1$ + stringBold = store.getBoolean("quantum.string.bold"); //$NON-NLS-1$ + commentBold = store.getBoolean("quantum.comment.bold"); //$NON-NLS-1$ + numericBold = store.getBoolean("quantum.numeric.bold"); //$NON-NLS-1$ + SQLColorConstants.BACKGROUND = PreferenceConverter.getColor(store, "quantum.background.color"); //$NON-NLS-1$ + SQLColorConstants.DEFAULT = PreferenceConverter.getColor(store, "quantum.text.color"); //$NON-NLS-1$ + SQLColorConstants.IDENTIFIER = PreferenceConverter.getColor(store, "quantum.text.color"); //$NON-NLS-1$ + SQLColorConstants.KEYWORD = PreferenceConverter.getColor(store, "quantum.keyword.color"); //$NON-NLS-1$ + SQLColorConstants.STRING = PreferenceConverter.getColor(store, "quantum.string.color"); //$NON-NLS-1$ + SQLColorConstants.COMMENT = PreferenceConverter.getColor(store, "quantum.comment.color"); //$NON-NLS-1$ + SQLColorConstants.NUMERIC = PreferenceConverter.getColor(store, "quantum.numeric.color"); //$NON-NLS-1$ + } + public void initializeColors() { + setDamageRepairer(getAttr(SQLColorConstants.KEYWORD, keywordBold), SQLPartitionScanner.SQL_KEYWORD); + setDamageRepairer(getAttr(SQLColorConstants.COMMENT, commentBold), SQLPartitionScanner.SQL_COMMENT); + setDamageRepairer(getAttr(SQLColorConstants.STRING, stringBold), SQLPartitionScanner.SQL_STRING); + setDamageRepairer(getAttr(SQLColorConstants.DEFAULT, textBold), IDocument.DEFAULT_CONTENT_TYPE); + setDamageRepairer(getAttr(SQLColorConstants.DEFAULT, textBold), SQLPartitionScanner.SQL_SYMBOL); + setDamageRepairer(getAttr(SQLColorConstants.DEFAULT, textBold), SQLPartitionScanner.SQL_IDENTIFIER); + setDamageRepairer(getAttr(SQLColorConstants.DEFAULT, textBold), SQLPartitionScanner.SQL_SEPARATOR); + setDamageRepairer(getAttr(SQLColorConstants.NUMERIC, numericBold), SQLPartitionScanner.SQL_NUMERIC); + } + public TextAttribute getAttr(RGB color, boolean bold) { + colorManager.getColor(SQLColorConstants.BACKGROUND); + Color foreground = colorManager.getColor(color); + TextAttribute attr = new TextAttribute(foreground); + if (bold) { + return new TextAttribute(foreground, attr.getBackground(), SWT.BOLD); + } + return attr; + } + public void setDamageRepairer(TextAttribute attr, String token) { + NonRuleBasedDamagerRepairer ndr = (NonRuleBasedDamagerRepairer) cache.get(token); + if (ndr == null) { + ndr = + new NonRuleBasedDamagerRepairer(attr); + reconciler.setDamager(ndr, token); + reconciler.setRepairer(ndr, token); + cache.put(token, ndr); + } else { + ndr.setTextAttribute(attr); + } + } +// public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { +// ContentAssistant assistant = new ContentAssistant(); +// assistant.setContentAssistProcessor(new SQLContentAssistProcessor("default"), +// IDocument.DEFAULT_CONTENT_TYPE); +//// assistant.setContentAssistProcessor(new SQLContentAssistProcessor("comment"), +//// SQLPartitionScanner.SQL_COMMENT); +//// assistant.setContentAssistProcessor(new SQLContentAssistProcessor("keyword"), +//// SQLPartitionScanner.SQL_KEYWORD); +//// assistant.setContentAssistProcessor(new SQLContentAssistProcessor("identifier"), +//// SQLPartitionScanner.SQL_IDENTIFIER); +// +// // everybody else is doin' it... +// assistant.enableAutoActivation(true); +// assistant.setAutoActivationDelay(500); +// +// assistant.setProposalPopupOrientation(ContentAssistant.CONTEXT_INFO_BELOW); +// assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_BELOW); +// return assistant; +// } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Bookmark.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Bookmark.java index a4a50e8..4b42669 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Bookmark.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Bookmark.java @@ -76,6 +76,7 @@ public class Bookmark implements Displayable { setPromptForPassword(data.getPromptForPassword()); setAutoCommit(data.isAutoCommit()); setAutoCommitPreference(data.getAutoCommitPreference()); + setSchemaRule(data.getSchemaRule()); this.schemas.addAll(data.schemas); this.quickList = new Hashtable(data.quickList); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/BookmarkCollection.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/BookmarkCollection.java index 882f111..2f66b2e 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/BookmarkCollection.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/BookmarkCollection.java @@ -20,8 +20,10 @@ import org.w3c.dom.NodeList; import com.quantum.IQuantumConstants; import com.quantum.Messages; +import com.quantum.adapters.AdapterFactory; import com.quantum.model.xml.ModelToXMLConverter; import com.quantum.sql.metadata.MetaDataXMLInterface; +import com.quantum.util.JarUtil; /** * The collection of database bookmarks that the Quantum plug-in knows about. @@ -32,7 +34,9 @@ import com.quantum.sql.metadata.MetaDataXMLInterface; */ public class BookmarkCollection { - private static BookmarkCollection instance = new BookmarkCollection(); + +private static final String SUN_JDBC_ODBC_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver"; + private static BookmarkCollection instance = new BookmarkCollection(); private List bookmarks = new Vector(); private boolean changed = false; private PropertyChangeSupport support = new PropertyChangeSupport(this); @@ -86,7 +90,7 @@ public class BookmarkCollection { String driver = props.getProperty(i + ".driver"); //$NON-NLS-1$ String driverFile = props.getProperty(i + ".driverLocation"); //$NON-NLS-1$ String type = props.getProperty(i + ".type"); //$NON-NLS-1$ - this.drivers.add(new JDBCDriver(driver, driverFile, type)); + this.drivers.add(new JDBCDriver(driver, new String[] { driverFile }, type)); } if (overwrite) { this.bookmarks = newBookmarks; @@ -154,15 +158,49 @@ public class BookmarkCollection { for (int i = 0; i < nodes.getLength(); i++) { Element driver = (Element) nodes.item(i); - if (!"".equals(driver.getAttribute("type"))) { + List jarFileNames = new ArrayList(); + String jarFileName = driver.getAttribute("jarFileName"); + if (jarFileName != null && jarFileName.trim().length() > 0) { + jarFileNames.add(jarFileName); + } + NodeList jars = driver.getElementsByTagName("jar"); + for (int j = 0; j < jars.getLength(); j++) { + String fileName = ((Element) jars.item(j)).getAttribute("fileName"); + if (fileName != null && fileName.trim().length() > 0) { + jarFileNames.add(fileName); + } + } + + if (!isQuantum232Notation(driver)) { addDriver(new JDBCDriver( driver.getAttribute("className"), - driver.getAttribute("jarFileName"), + (String[]) jarFileNames.toArray(new String[jarFileNames.size()]), driver.getAttribute("type"), driver.getAttribute("name"), driver.getAttribute("version"))); } - + } + addStandardDrivers(); + } + + /** + * An earlier version of the Quantum XML format omitted the + * type. + * + * @param driver + * @return + */ + private boolean isQuantum232Notation(Element driver) { + return "".equals(driver.getAttribute("type")); + } + + /** + * + */ + private void addStandardDrivers() { + if (JarUtil.loadDriver(null, SUN_JDBC_ODBC_DRIVER) != null) { + addDriver(new JDBCDriver(SUN_JDBC_ODBC_DRIVER, new String[0], + AdapterFactory.JDBC_ODBC_BRIDGE)); } } @@ -204,10 +242,21 @@ public class BookmarkCollection { backwardCompatibility(bookmark, column); String driverClassName = MetaDataXMLInterface.getElementText(column,"driver"); //$NON-NLS-1$ - String driverFile = MetaDataXMLInterface.getElementText(column,"driverLocation"); //$NON-NLS-1$ + + List jarFiles = new ArrayList(); + NodeList driverLocations = column.getElementsByTagName("driverLocation"); + for (int j = 0, length = driverLocations == null + ? 0 : driverLocations.getLength(); j < length; j++) { + String jarFileName = MetaDataXMLInterface.extractText((Element) driverLocations.item(j), ""); + if (jarFileName != null && jarFileName.trim().length() > 0) { + jarFiles.add(jarFileName); + } + } String type = MetaDataXMLInterface.getElementText(column,"type"); //$NON-NLS-1$ - bookmark.setJDBCDriver(new JDBCDriver(driverClassName, driverFile, type)); + bookmark.setJDBCDriver(new JDBCDriver(driverClassName, + (String[]) jarFiles.toArray(new String[jarFiles.size()]), + type)); NodeList children = column.getElementsByTagName("Other_Schemas"); if (children.getLength() > 0) { @@ -336,7 +385,13 @@ public class BookmarkCollection { } public JDBCDriver[] getJDBCDrivers() { - return (JDBCDriver[]) this.drivers.toArray(new JDBCDriver[this.drivers.size()]); + if (this.drivers.isEmpty()) { + addStandardDrivers(); + } + + List list = new ArrayList(this.drivers); + Collections.sort(list); + return (JDBCDriver[]) list.toArray(new JDBCDriver[list.size()]); } /** * @return @@ -396,8 +451,8 @@ public class BookmarkCollection { * @param driver * @param driverFile */ - public JDBCDriver findDriver(String driverClassName, String driverFile, String type) { - JDBCDriver temp = new JDBCDriver(driverClassName, driverFile, type); + public JDBCDriver findDriver(String driverClassName, String[] driverFiles, String type) { + JDBCDriver temp = new JDBCDriver(driverClassName, driverFiles, type); return findDriver(temp); } @@ -420,5 +475,25 @@ public class BookmarkCollection { return result; } - + /** + * @param driver + */ + public boolean removeDriver(JDBCDriver driver) { + boolean found = false; + for (Iterator i = this.bookmarks.iterator(); + !found && driver != null && i.hasNext();) { + Bookmark bookmark = (Bookmark) i.next(); + found |= driver.equals(bookmark.getJDBCDriver()); + } + + if (!found && driver != null && !SUN_JDBC_ODBC_DRIVER.equals(driver.getClassName())) { + boolean deleted = this.drivers.remove(driver); + if (deleted) { + this.support.firePropertyChange("drivers", null, null); + } + return deleted; + } else { + return false; + } + } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ColumnImpl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ColumnImpl.java index 0775427..7944c2b 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ColumnImpl.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ColumnImpl.java @@ -1,6 +1,6 @@ package com.quantum.model; -import com.quantum.sql.SQLHelper; +import com.quantum.util.sql.TypesHelper; /** * @author BC @@ -79,7 +79,7 @@ class ColumnImpl implements Column, Comparable { * @see com.quantum.model.Column#isNumeric() */ public boolean isNumeric() { - return SQLHelper.isNumeric(this.type); + return TypesHelper.isNumeric(this.type); } /** diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Database.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Database.java index 5637b55..cdc3501 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Database.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/Database.java @@ -12,14 +12,32 @@ import java.util.Set; import com.quantum.adapters.DatabaseAdapter; import com.quantum.sql.MultiSQLServer; -import com.quantum.sql.SQLResults; +import com.quantum.sql.SQLResultSetResults; /** * @author BC */ public class Database { - private DatabaseAdapter databaseAdapter; + private static final int TABLE_METADATA_TABLE_SCHEM = 2; + private static final int TABLE_METADATA_TABLE_NAME = 3; + + private static final int TABLE_TYPE_METADATA_TABLE_TYPE = 1; + + private static final int FOREIGN_KEY_METADATA_PKTABLE_SCHEM = 2; + private static final int FOREIGN_KEY_METADATA_PKTABLE_NAME = 3; + private static final int FOREIGN_KEY_METADATA_PKCOLUMN_NAME = 4; + private static final int FOREIGN_KEY_METADATA_FKTABLE_SCHEM = 6; + private static final int FOREIGN_KEY_METADATA_FKTABLE_NAME = 7; + private static final int FOREIGN_KEY_METADATA_FKCOLUMN_NAME = 8; + private static final int FOREIGN_KEY_METADATA_KEY_SEQ = 9; + private static final int FOREIGN_KEY_METADATA_DELETE_RULE = 11; + private static final int FOREIGN_KEY_METADATA_FK_NAME = 12; + + private static final int TYPE_INFO_METADATA_TYPE_NAME = 1; + private static final int TYPE_INFO_METADATA_DATA_TYPE = 2; + + private DatabaseAdapter databaseAdapter; private Bookmark bookmark; public Database(Bookmark bookmark) { @@ -80,7 +98,7 @@ public class Database { DatabaseMetaData metaData = connection.getMetaData(); ResultSet resultSet = metaData.getTableTypes(); while (resultSet.next()) { - String type = resultSet.getString("TABLE_TYPE"); + String type = resultSet.getString(TABLE_TYPE_METADATA_TABLE_TYPE); if (type != null) { // Informix, in particular, pads this with extra spaces type = type.trim(); @@ -149,9 +167,10 @@ public class Database { String sql = getSQL(bookmark, type, schema); List list = new ArrayList(); - SQLResults results = null; + SQLResultSetResults results = null; if (sql != null) { - results = MultiSQLServer.getInstance().execute(connection, sql); + results = (SQLResultSetResults) MultiSQLServer.getInstance().execute( + bookmark, connection, sql, Integer.MAX_VALUE); for (int i = 1, size = (results == null) ? 0 : results.getRowCount(); i <= size; i++) { String schemaName = results.getColumnCount() == 1 ? schema.getName() : results.getElement(1, i).toString(); @@ -173,15 +192,16 @@ public class Database { DatabaseMetaData metaData = connection.getMetaData(); // getTables needs a null schema to get all the schemas. So we don't pass a "" schema, but a null one ResultSet set = null; - if (metaData.supportsSchemasInTableDefinitions()) + if (metaData.supportsSchemasInTableDefinitions()) { set = metaData.getTables(null, (schema != null) ? schema.getName() : null, "%", new String[] { type }); - else + } else { set = metaData.getTables(null, null, "%", new String[] { type }); + } while (set.next()) { - String tempSchema = set.getString("TABLE_SCHEM"); + String tempSchema = set.getString(TABLE_METADATA_TABLE_SCHEM); tempSchema = (tempSchema == null) ? "" : tempSchema.trim(); - String tableName = set.getString("TABLE_NAME"); + String tableName = set.getString(TABLE_METADATA_TABLE_NAME); tableName = (tableName == null) ? "" : tableName.trim(); if (tableName != null && tableName.length() > 0) { @@ -201,8 +221,8 @@ public class Database { ResultSet results = metaData.getTypeInfo(); try { while (results.next()) { - String name = results.getString("TYPE_NAME"); - int type = results.getInt("DATA_TYPE"); + String name = results.getString(TYPE_INFO_METADATA_TYPE_NAME); + int type = results.getInt(TYPE_INFO_METADATA_DATA_TYPE); list.add(new DataType(type, name)); } } finally { @@ -261,23 +281,23 @@ public class Database { int lowestKeySequence = Integer.MAX_VALUE; try { while (resultSet.next()) { - int keySequence = resultSet.getInt("KEY_SEQ"); + int keySequence = resultSet.getInt(FOREIGN_KEY_METADATA_KEY_SEQ); lowestKeySequence = Math.min(lowestKeySequence, keySequence); if (keySequence == lowestKeySequence || foreignKey == null) { foreignKey = new ForeignKeyImpl(); list.add(foreignKey); - foreignKey.setName(resultSet.getString("FK_NAME")); - foreignKey.setDeleteRule(resultSet.getShort("DELETE_RULE")); - foreignKey.setForeignEntitySchema(resultSet.getString("FKTABLE_SCHEM")); - foreignKey.setForeignEntityName(resultSet.getString("FKTABLE_NAME")); - foreignKey.setLocalEntitySchema(resultSet.getString("PKTABLE_SCHEM")); - foreignKey.setLocalEntityName(resultSet.getString("PKTABLE_NAME")); + foreignKey.setName(resultSet.getString(FOREIGN_KEY_METADATA_FK_NAME)); + foreignKey.setDeleteRule(resultSet.getShort(FOREIGN_KEY_METADATA_DELETE_RULE)); + foreignKey.setForeignEntitySchema(resultSet.getString(FOREIGN_KEY_METADATA_FKTABLE_SCHEM)); + foreignKey.setForeignEntityName(resultSet.getString(FOREIGN_KEY_METADATA_FKTABLE_NAME)); + foreignKey.setLocalEntitySchema(resultSet.getString(FOREIGN_KEY_METADATA_PKTABLE_SCHEM)); + foreignKey.setLocalEntityName(resultSet.getString(FOREIGN_KEY_METADATA_PKTABLE_NAME)); } foreignKey.addColumns( - resultSet.getString("PKCOLUMN_NAME"), - resultSet.getString("FKCOLUMN_NAME")); + resultSet.getString(FOREIGN_KEY_METADATA_PKCOLUMN_NAME), + resultSet.getString(FOREIGN_KEY_METADATA_FKCOLUMN_NAME)); } return (ForeignKey[]) list.toArray(new ForeignKey[list.size()]); } finally { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/DisplayableComparator.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/DisplayableComparator.java new file mode 100644 index 0000000..ab3f402 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/DisplayableComparator.java @@ -0,0 +1,43 @@ +package com.quantum.model; + +import java.util.Comparator; + + +/** + * This class is used to compare two displayable objects. + * + * @author BC Holmes + */ +public class DisplayableComparator implements Comparator { + + public int compare(Object arg0, Object arg1) { + if (arg0 == null && arg1 == null) { + return 0; + } else if (arg0 == null) { + return -1; + } else if (arg1 == null) { + return 1; + } else { + return compare((Displayable) arg0, (Displayable) arg1); + } + } + + /** + * @param displayable0 + * @param displayable1 + * @return + */ + private int compare(Displayable displayable0, Displayable displayable1) { + if (displayable0.getDisplayName() == null && displayable1.getDisplayName() == null) { + return 0; + } else if (displayable0.getDisplayName() == null) { + return -1; + } else if (displayable1.getDisplayName() == null) { + return 1; + } else { + return displayable0.getDisplayName().toLowerCase().compareTo( + displayable1.getDisplayName().toLowerCase()); + } + } + +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/EntityImpl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/EntityImpl.java index 8973ffd..f16a1e0 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/EntityImpl.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/EntityImpl.java @@ -1,4 +1,4 @@ - package com.quantum.model; +package com.quantum.model; import java.sql.Connection; import java.sql.DatabaseMetaData; @@ -19,7 +19,27 @@ import com.quantum.adapters.DatabaseAdapter; * @author bcholmes */ abstract class EntityImpl implements Entity { - private String schema; + + // The JDBC-ODBC Driver is more happy if you look up metadata values + // using the column number than if you use the column name + + private static final int INDEX_METADATA_INDEX_NAME = 6; + private static final int INDEX_METADATA_COLUMN_NAME = 9; + private static final int INDEX_METADATA_ASC_OR_DESC = 10; + + private static final int PRIMARY_KEYS_METADATA_COLUMN_NAME = 4; + private static final int PRIMARY_KEYS_METADATA_KEY_SEQ = 5; + + private static final int COLUMN_METADATA_COLUMN_NAME = 4; + private static final int COLUMN_METATDATA_DATA_TYPE = 5; + private static final int COLUMN_METATDATA_TYPE_NAME = 6; + private static final int COLUMN_METADATA_COLUMN_SIZE = 7; + private static final int COLUMN_METADATA_DECIMAL_DIGITS = 9; + private static final int COLUMN_METADATA_REMARKS = 12; + private static final int COLUMN_METADATA_ORDINAL_POSITION = 17; + private static final int COLUMN_METADATA_IS_NULLABLE = 18; + + private String schema; private String name; private String type; private Bookmark bookmark; @@ -69,14 +89,17 @@ abstract class EntityImpl implements Entity { while (resultSet.next()) { ColumnImpl column = new ColumnImpl( this, - resultSet.getString("COLUMN_NAME"), - resultSet.getString("TYPE_NAME"), - resultSet.getInt("DATA_TYPE"), - resultSet.getInt("COLUMN_SIZE"), - resultSet.getInt("DECIMAL_DIGITS"), - "YES".equalsIgnoreCase(resultSet.getString("IS_NULLABLE")), - resultSet.getInt("ORDINAL_POSITION"), - getComments(resultSet.getString("REMARKS"),getQualifiedName(), resultSet.getString("COLUMN_NAME")) + resultSet.getString(COLUMN_METADATA_COLUMN_NAME), + resultSet.getString(COLUMN_METATDATA_TYPE_NAME), + resultSet.getInt(COLUMN_METATDATA_DATA_TYPE), + resultSet.getInt(COLUMN_METADATA_COLUMN_SIZE), + resultSet.getInt(COLUMN_METADATA_DECIMAL_DIGITS), + "YES".equalsIgnoreCase(resultSet.getString(COLUMN_METADATA_IS_NULLABLE)), + resultSet.getInt(COLUMN_METADATA_ORDINAL_POSITION), + getComments( + resultSet.getString(COLUMN_METADATA_REMARKS), + getQualifiedName(), + resultSet.getString(COLUMN_METADATA_COLUMN_NAME)) ); temp.put(column.getName(), column); } @@ -87,8 +110,8 @@ abstract class EntityImpl implements Entity { resultSet = metaData.getPrimaryKeys(null, getSchema(), getName()); try { while (resultSet.next()) { - String name = resultSet.getString("COLUMN_NAME"); - short keySequence = resultSet.getShort("KEY_SEQ"); + String name = resultSet.getString(PRIMARY_KEYS_METADATA_COLUMN_NAME); + short keySequence = resultSet.getShort(PRIMARY_KEYS_METADATA_KEY_SEQ); ColumnImpl column = (ColumnImpl) temp.get(name); if (column != null) { column.setPrimaryKeyOrder(keySequence); @@ -118,14 +141,24 @@ abstract class EntityImpl implements Entity { String comment = ""; try { Connection con = this.bookmark.getConnection(); - Statement stmt = con.createStatement(); DatabaseAdapter adapter = this.bookmark.getAdapter(); - if (adapter != null && stmt != null && adapter.getCommentsQuery(tableName, columnName) != null) { - - stmt.execute(adapter.getCommentsQuery(tableName, columnName)); - ResultSet set = stmt.getResultSet(); - if (set.next()) - comment = set.getString(1); + Statement stmt = con.createStatement(); + try { + if (adapter != null && stmt != null + && adapter.getCommentsQuery(tableName, columnName) != null) { + + stmt.execute(adapter.getCommentsQuery(tableName, columnName)); + ResultSet set = stmt.getResultSet(); + try { + if (set.next()) { + comment = set.getString(1); + } + } finally { + set.close(); + } + } + } finally { + stmt.close(); } } catch (NotConnectedException e) { } catch (SQLException e) { @@ -133,6 +166,7 @@ abstract class EntityImpl implements Entity { return comment; } + public Index[] getIndexes() { List indexList = new ArrayList(); @@ -143,14 +177,14 @@ abstract class EntityImpl implements Entity { ResultSet resultSet = metaData.getIndexInfo(null, getSchema(), getName(), false, false); while (resultSet.next()) { - String indexName = resultSet.getString("INDEX_NAME"); + String indexName = resultSet.getString(INDEX_METADATA_INDEX_NAME); IndexImpl index = (IndexImpl) temp.get(indexName); if (index == null) { index = new IndexImpl(this, indexName); temp.put(indexName, index); } - String columnName = resultSet.getString("COLUMN_NAME"); - String ascending = resultSet.getString("ASC_OR_DESC"); + String columnName = resultSet.getString(INDEX_METADATA_COLUMN_NAME); + String ascending = resultSet.getString(INDEX_METADATA_ASC_OR_DESC); index.addColumn(columnName, ascending == null ? null : (ascending.toUpperCase().startsWith("A") ? Boolean.TRUE : Boolean.FALSE)); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/JDBCDriver.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/JDBCDriver.java index 8f28a75..d768589 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/JDBCDriver.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/JDBCDriver.java @@ -2,32 +2,34 @@ package com.quantum.model; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; +import java.io.File; import java.sql.Driver; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; import com.quantum.util.JarUtil; +import com.quantum.util.StringArrayComparator; /** * @author BC */ -public class JDBCDriver { +public class JDBCDriver implements Comparable, Displayable { private String name; private String version; private String className; - private String jarFileName; + private List jarFileNames = Collections.synchronizedList(new ArrayList()); private String type; private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); /** * @param className * @param jarFileName */ - public JDBCDriver(String className, String jarFileName, String type) { - this(className, jarFileName, type, null, null); - } - /** - * - */ - public JDBCDriver() { + public JDBCDriver(String className, String[] jarFileNames, String type) { + this(className, jarFileNames, type, null, null); } /** * @param className @@ -35,12 +37,12 @@ public class JDBCDriver { * @param name * @param version */ - public JDBCDriver(String className, String jarFileName, String type, String name, String version) { + public JDBCDriver(String className, String[] jarFileNames, String type, String name, String version) { this.name = name; this.version = version; this.type = type; this.className = className; - this.jarFileName = jarFileName; + this.jarFileNames.addAll(Arrays.asList(jarFileNames)); } /** * @return Returns the className. @@ -61,17 +63,21 @@ public class JDBCDriver { /** * @return Returns the jarFileName. */ - public String getJarFileName() { - return this.jarFileName; + public String[] getJarFileNames() { + return (String[]) this.jarFileNames.toArray(new String[this.jarFileNames.size()]); } /** * @param jarFileName The jarFileName to set. */ - public void setJarFileName(String jarFileName) { - if (jarFileName != null && !jarFileName.equals(this.jarFileName)) { - String original = this.jarFileName; - this.jarFileName = jarFileName; - this.propertyChangeSupport.firePropertyChange("jarFileName", original, jarFileName); + public void setJarFileNames(String[] jarFileNames) { + StringArrayComparator comparator = new StringArrayComparator(); + if (comparator.compare( + (String[]) this.jarFileNames.toArray(new String[this.jarFileNames.size()]), + jarFileNames) != 0) { + String[] original = getJarFileNames(); + this.jarFileNames.clear(); + this.jarFileNames.addAll(Arrays.asList(jarFileNames)); + this.propertyChangeSupport.firePropertyChange("jarFileName", original, jarFileNames); } } /** @@ -115,23 +121,27 @@ public class JDBCDriver { } else if (getClass() != object.getClass()) { return false; } else { - JDBCDriver that = (JDBCDriver) object; - - if (this.className == null && that.className != null) { - return false; - } else if (this.className != null && !this.className.equals(that.className)) { - return false; - } else if (this.jarFileName == null && that.jarFileName != null) { - return false; - } else if (this.jarFileName != null && !this.jarFileName.equals(that.jarFileName)) { - return false; - } else if (this.type == null && that.type != null) { - return false; - } else if (this.type != null && !this.type.equals(that.type)) { - return false; - } else { - return true; - } + return equals((JDBCDriver) object); + } + } + /** + * @param that + * @return + */ + private boolean equals(JDBCDriver that) { + if (this.className == null && that.className != null) { + return false; + } else if (this.className != null && !this.className.equals(that.className)) { + return false; + } else if ((new StringArrayComparator()).compare( + this.getJarFileNames(), that.getJarFileNames()) != 0) { + return false; + } else if (this.type == null && that.type != null) { + return false; + } else if (this.type != null && !this.type.equals(that.type)) { + return false; + } else { + return true; } } public int hashCode() { @@ -139,8 +149,11 @@ public class JDBCDriver { if (this.className != null) { hashCode ^= this.className.hashCode(); } - if (this.jarFileName != null) { - hashCode ^= this.jarFileName.hashCode(); + for (Iterator i = this.jarFileNames.iterator(); i.hasNext();) { + Object jarFile = i.next(); + if (jarFile != null) { + hashCode ^= jarFile.hashCode(); + } } if (this.type != null) { hashCode ^= this.type.hashCode(); @@ -149,7 +162,7 @@ public class JDBCDriver { } public Driver getDriver() { - return JarUtil.loadDriver(getJarFileName(), getClassName()); + return JarUtil.loadDriver(getJarFileNames(), getClassName()); } /** * @param listener @@ -193,4 +206,28 @@ public class JDBCDriver { this.propertyChangeSupport.firePropertyChange("type", original, type); } } + /* (non-Javadoc) + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + public int compareTo(Object object) { + return (new DisplayableComparator()).compare(this, object); + } + /* (non-Javadoc) + * @see com.quantum.model.Displayable#getDisplayName() + */ + public String getDisplayName() { + return getName(); + } + + public String getJarFilePath() { + StringBuffer buffer = new StringBuffer(); + for (Iterator i = this.jarFileNames.iterator(); i.hasNext();) { + String element = (String) i.next(); + buffer.append(element); + if (i.hasNext()) { + buffer.append(File.pathSeparator); + } + } + return buffer.toString(); + } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/TableImpl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/TableImpl.java index cddb0bc..87e5c85 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/TableImpl.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/TableImpl.java @@ -3,7 +3,6 @@ package com.quantum.model; import java.sql.SQLException; import com.quantum.sql.MultiSQLServer; -import com.quantum.sql.SQLHelper; class TableImpl extends EntityImpl implements Table { @@ -14,7 +13,7 @@ class TableImpl extends EntityImpl implements Table { public Integer getSize() { Integer size = null; try { - size = new Integer(SQLHelper.getSize( + size = new Integer(MultiSQLServer.getInstance().getSize(getBookmark(), getBookmark().getConnection(), getQualifiedName(), getBookmark().getAdapter())); } catch (SQLException e) { @@ -25,6 +24,6 @@ class TableImpl extends EntityImpl implements Table { public void deleteAllRows() throws SQLException, ConnectionException { String sql = "DELETE FROM " + getQualifiedName(); - MultiSQLServer.getInstance().execute(getBookmark().getConnection(), sql); + MultiSQLServer.getInstance().execute(getBookmark(), getBookmark().getConnection(), sql); } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ViewImpl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ViewImpl.java index d63ca35..565c2a7 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ViewImpl.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ViewImpl.java @@ -2,7 +2,7 @@ package com.quantum.model; import java.sql.SQLException; -import com.quantum.sql.SQLHelper; +import com.quantum.sql.MultiSQLServer; class ViewImpl extends EntityImpl implements View { @@ -13,7 +13,7 @@ class ViewImpl extends EntityImpl implements View { public Integer getSize() { Integer size = null; try { - size = new Integer(SQLHelper.getSize( + size = new Integer(MultiSQLServer.getInstance().getSize(getBookmark(), getBookmark().getConnection(), getQualifiedName(), getBookmark().getAdapter())); } catch (SQLException e) { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/xml/ModelToXMLConverter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/xml/ModelToXMLConverter.java index 5251fdc..075a1ad 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/xml/ModelToXMLConverter.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/xml/ModelToXMLConverter.java @@ -37,8 +37,17 @@ public class ModelToXMLConverter { driverNode.setAttribute("name", jdbcDriver.getName()); driverNode.setAttribute("version", jdbcDriver.getVersion()); driverNode.setAttribute("type", jdbcDriver.getType()); - driverNode.setAttribute("jarFileName", jdbcDriver.getJarFileName()); driverNode.setAttribute("className", jdbcDriver.getClassName()); + + String[] fileNames = jdbcDriver.getJarFileNames(); + for (int i = 0, length = fileNames == null ? 0 : fileNames.length; i < length; i++) { + if (fileNames[i] != null) { + Element fileName = document.createElement("jar"); + fileName.setAttribute("fileName", fileNames[i]); + driverNode.appendChild(fileName); + } + } + bookmarkRoot.appendChild(driverNode); } @@ -54,7 +63,10 @@ public class ModelToXMLConverter { MetaDataXMLInterface.createElementText(bookmark,"autoCommitPreference", b.getAutoCommitPreference()); //$NON-NLS-1$ MetaDataXMLInterface.createElementText(bookmark,"driver", b.getJDBCDriver().getClassName()); //$NON-NLS-1$ MetaDataXMLInterface.createElementText(bookmark,"type", b.getJDBCDriver().getType()); //$NON-NLS-1$ - MetaDataXMLInterface.createElementText(bookmark,"driverLocation", b.getJDBCDriver().getJarFileName()); //$NON-NLS-1$ + String[] fileNames = b.getJDBCDriver().getJarFileNames(); + for (int i = 0, length = fileNames == null ? 0 : fileNames.length; i < length; i++) { + MetaDataXMLInterface.createElementText(bookmark,"driverLocation", fileNames[i]); + } Element otherSchemas = (Element) bookmark.appendChild(document.createElement("Other_Schemas")); //$NON-NLS-1$ otherSchemas.setAttribute("schemaRule", b.useAllSchemas() diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPMessages.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPMessages.java new file mode 100644 index 0000000..3b2ce26 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPMessages.java @@ -0,0 +1,41 @@ +package com.quantum.php; + +import java.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class PHPMessages { + + private static final String BUNDLE_NAME = "com.quantum.php.PHPResources"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private PHPMessages() { + } + + public static String getString(Class resourceClass, String key) { + return getString( + createKey(resourceClass, key)); + } + + private static String createKey(Class resourceClass, String key) { + return resourceClass.getName() + (key.startsWith(".") ? key : "." + key); + } + + public static String getString(String key) { + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } + + public static String getString(Class resourceClass, String key, Object[] arguments) { + return getString(createKey(resourceClass, key), arguments); + } + + public static String getString(String key, Object[] arguments) { + String string = getString(key); + return MessageFormat.format(string, arguments); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPResources.properties b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPResources.properties new file mode 100644 index 0000000..06eee1f --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/PHPResources.properties @@ -0,0 +1,27 @@ +tableview.phpselect = PHP SELECT to Clipboard... +tableview.phpupdate = PHP UPDATE to Clipboard... +tableview.phpinsert = PHP INSERT to Clipboard... +tableview.phpdelete = PHP DELETE to Clipboard... +TableView.PHPSelectRow=PHP Select Row +TableView.PHPUpdateRow=PHP Update Row +TableView.PHPInsertRow=PHP Insert Row +TableView.PHPDeleteRow=PHP Delete Row + +PHPDeleteRowPage.ColumnName=Column Name +PHPDeleteRowPage.Value=Value +PHPDeleteRowPage.IncludeIn=Include in? +PHPDeleteRowPage.WhereClause=Where clause +PHPDeleteRowPage.UpdatingQuery=Updating query +PHPDeleteRowPage.WarningNoWhere=Warning: no \"where clause\" columns selected, all rows will be deleted +PHPInsertRowPage.ColumnName=Column Name +PHPInsertRowPage.Value=Value +PHPUpdateRowPage.ColumnName=Column Name +PHPUpdateRowPage.OldValue=Old Value +PHPUpdateRowPage.NewValue=New Value +PHPUpdateRowPage._13= +PHPUpdateRowPage.SetValue=Set Value +PHPSelectRowPage.ColumnName=Column Name +PHPSelectRowPage.VariableName=Variable Name +PHPSelectRowPage.NewValue=New Value +PHPSelectRowPage._13= +PHPSelectRowPage.SelectValue=Select Value \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLConnectionPreferencePage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLConnectionPreferencePage.java new file mode 100644 index 0000000..c9bc536 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLConnectionPreferencePage.java @@ -0,0 +1,108 @@ +package com.quantum.php.preferences; + +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +import com.quantum.QuantumPlugin; + +public class PHPSQLConnectionPreferencePage + extends PreferencePage + implements IWorkbenchPreferencePage { + + StringFieldEditor fUserNameSFE; + StringFieldEditor fConnectSFE; + StringFieldEditor fDriverSFE; + StringFieldEditor fTypeSFE; + StringFieldEditor fDriverFileFFE; + + public PHPSQLConnectionPreferencePage() { + super(); + setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); + } + public void init(IWorkbench workbench) { + setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); + } + protected void performDefaults() { + fUserNameSFE.loadDefault(); + fConnectSFE.loadDefault(); + fDriverSFE.loadDefault(); + fTypeSFE.loadDefault(); + fDriverFileFFE.loadDefault(); + super.performDefaults(); + } + + public boolean performOk() { + fUserNameSFE.store(); + fConnectSFE.store(); + fDriverSFE.store(); + fTypeSFE.store(); + fDriverFileFFE.store(); + return super.performOk(); + } + + protected Control createContents(Composite parent) { + initializeDialogUnits(parent); + // final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + Composite composite = new Composite(parent, SWT.LEFT); + GridLayout layout = new GridLayout(); + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + // layout.numColumns = 1; + + fUserNameSFE = + new StringFieldEditor( + "phpeclipse.sql.username.connect", + "Default User name:", + composite); + fUserNameSFE.setPreferencePage(this); + fUserNameSFE.setPreferenceStore(getPreferenceStore()); + fUserNameSFE.load(); + + fConnectSFE = + new StringFieldEditor( + "phpeclipse.sql.connect.connect", + "Connect:", + composite); + fConnectSFE.setPreferencePage(this); + fConnectSFE.setPreferenceStore(getPreferenceStore()); + fConnectSFE.load(); + + fDriverSFE = + new StringFieldEditor( + "phpeclipse.sql.driver.connect", + "Driver:", + composite); + fDriverSFE.setPreferencePage(this); + fDriverSFE.setPreferenceStore(getPreferenceStore()); + fDriverSFE.load(); + + fTypeSFE = + new StringFieldEditor("phpeclipse.sql.type.connect", "Type:", composite); + fTypeSFE.setPreferencePage(this); + fTypeSFE.setPreferenceStore(getPreferenceStore()); + fTypeSFE.load(); + + // fDriverFileFFE = + // new FileFieldEditor( + // "phpeclipse.sql.filename.connect", + // "Driver filename:", + // composite); + fDriverFileFFE = + new StringFieldEditor( + "phpeclipse.sql.filename.connect", + "Driver filename:", + composite); + fDriverFileFFE.setPreferencePage(this); + fDriverFileFFE.setPreferenceStore(getPreferenceStore()); + fDriverFileFFE.load(); + + return composite; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLTemplatesPreferencePage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLTemplatesPreferencePage.java new file mode 100644 index 0000000..31b3d9e --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/preferences/PHPSQLTemplatesPreferencePage.java @@ -0,0 +1,94 @@ +package com.quantum.php.preferences; + +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +import com.quantum.QuantumPlugin; + +public class PHPSQLTemplatesPreferencePage + extends PreferencePage + implements IWorkbenchPreferencePage { + + StringFieldEditor fPHPSelectSFE; + StringFieldEditor fPHPInsertSFE; + StringFieldEditor fPHPUpdateSFE; + StringFieldEditor fPHPDeleteSFE; + + public PHPSQLTemplatesPreferencePage() { + super(); + setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); + // setDescription("PHP SQL templates"); //$NON-NLS-1$ + } + + public void init(IWorkbench workbench) { + setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); + } + + protected void performDefaults() { + fPHPSelectSFE.loadDefault(); + fPHPInsertSFE.loadDefault(); + fPHPUpdateSFE.loadDefault(); + fPHPDeleteSFE.loadDefault(); + super.performDefaults(); + } + + public boolean performOk() { + fPHPSelectSFE.store(); + fPHPInsertSFE.store(); + fPHPUpdateSFE.store(); + fPHPDeleteSFE.store(); + return super.performOk(); + } + + protected Control createContents(Composite parent) { + initializeDialogUnits(parent); + // final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + Composite composite = new Composite(parent, SWT.LEFT); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + composite.setLayout(new GridLayout()); + + fPHPSelectSFE = + new StringFieldEditor( + "phpeclipse.sql.select.template", + "SELECT template:", + composite); + fPHPSelectSFE.setPreferencePage(this); + fPHPSelectSFE.setPreferenceStore(getPreferenceStore()); + fPHPSelectSFE.load(); + + fPHPInsertSFE = + new StringFieldEditor( + "phpeclipse.sql.insert.template", + "INSERT template:", + composite); + fPHPInsertSFE.setPreferencePage(this); + fPHPInsertSFE.setPreferenceStore(getPreferenceStore()); + fPHPInsertSFE.load(); + + fPHPUpdateSFE = + new StringFieldEditor( + "phpeclipse.sql.update.template", + "UPDATE template:", + composite); + fPHPUpdateSFE.setPreferencePage(this); + fPHPUpdateSFE.setPreferenceStore(getPreferenceStore()); + fPHPUpdateSFE.load(); + + fPHPDeleteSFE = + new StringFieldEditor( + "phpeclipse.sql.delete.template", + "DELETE template:", + composite); + fPHPDeleteSFE.setPreferencePage(this); + fPHPDeleteSFE.setPreferenceStore(getPreferenceStore()); + fPHPDeleteSFE.load(); + return composite; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPDeleteRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPDeleteRowPage.java new file mode 100644 index 0000000..8422670 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPDeleteRowPage.java @@ -0,0 +1,359 @@ +package com.quantum.php.wizards; + +import java.text.MessageFormat; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.quantum.QuantumPlugin; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.Bookmark; +import com.quantum.model.Column; +import com.quantum.model.Entity; +import com.quantum.php.PHPMessages; +import com.quantum.wizards.BaseSQLPage; +import com.quantum.wizards.SQLPage; + +public class PHPDeleteRowPage extends BaseSQLPage implements SQLPage { + String[] columnNames; + + Text[] values; + + Button[] whereValues; + + Text query; + + IPreferenceStore fStore; + + public PHPDeleteRowPage(String pageName) { + super(pageName); + } + + public void createControl(Composite parent) { + System.out.println("page create control"); //$NON-NLS-1$ + Composite container = new Composite(parent, SWT.V_SCROLL); + fStore = QuantumPlugin.getDefault().getPreferenceStore(); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + layout.numColumns = 3; + + Entity entity = this.results.getEntity(); + columnNames = this.results.getColumnNames(); + + values = new Text[columnNames.length]; + whereValues = new Button[columnNames.length]; + new Label(container, SWT.NULL).setText(PHPMessages + .getString("PHPDeleteRowPage.ColumnName")); //$NON-NLS-1$ + new Label(container, SWT.NULL).setText(PHPMessages + .getString("PHPDeleteRowPage.Value")); //$NON-NLS-1$ + new Label(container, SWT.NULL).setText(PHPMessages + .getString("PHPDeleteRowPage.IncludeIn")); //$NON-NLS-1$ + for (int i = 0; i < columnNames.length; i++) { + Label label = new Label(container, SWT.NULL); + label.setText(columnNames[i]); + values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); +// Object object = this.row == null ? null : this.row.get(i + 1); +// values[i].setText(object == null ? "" : '$'+columnNames[i]); //object.toString()); + values[i].setText('$'+columnNames[i]); //object.toString()); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.widthHint = 150; + values[i].setLayoutData(gridData); + values[i].addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + updateQuery(); + } + }); + + whereValues[i] = new Button(container, SWT.CHECK); + whereValues[i].setText(PHPMessages + .getString("PHPDeleteRowPage.WhereClause")); //$NON-NLS-1$ + // we check if it's a primary key to select it in the WHERE clause + Column column = getColumn(entity, columnNames[i]); + whereValues[i].setSelection(column == null ? false : column + .isPrimaryKey()); + whereValues[i].addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent e) { + } + + public void widgetSelected(SelectionEvent e) { + updateQuery(); + } + }); + } + query = new Text(container, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP); + GridData gridData = new GridData(); + gridData.horizontalSpan = layout.numColumns; + gridData.verticalSpan = 3; + gridData.horizontalAlignment = GridData.FILL; + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + query.setLayoutData(gridData); + + setControl(container); + updateQuery(); + + setPageComplete(true); + } + + public void updateQuery() { + System.out.println(PHPMessages.getString("PHPDeleteRowPage.UpdatingQuery")); //$NON-NLS-1$ + StringBuffer whereClause = new StringBuffer(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); + DatabaseAdapter adapter = bookmark.getAdapter(); + + int numSelected = 0; + for (int i = 0; i < columnNames.length; i++) { + if (whereValues[i].getSelection()) { + if (numSelected > 0) + whereClause.append(" AND "); //$NON-NLS-1$ + numSelected++; + whereClause.append("("); //$NON-NLS-1$ + whereClause.append(columnNames[i]); + whereClause.append(" = "); //$NON-NLS-1$ + appendColumn(whereClause, entity, columnNames[i], adapter, values[i] + .getText()); + whereClause.append(")"); //$NON-NLS-1$ + } + } + // String query = "DELETE FROM " + + // this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ + // if (numSelected > 0) { + // query += " WHERE " + whereClause.toString(); //$NON-NLS-1$ + // } + // if (numSelected > 0) { + // setMessage(""); //$NON-NLS-1$ + // } else { + // setMessage(PHPMessages.getString("PHPDeleteRowPage.WarningNoWhere")); + // //$NON-NLS-1$ + // } + String[] arguments = { this.results.getEntity().getQuotedTableName(), + whereClause.toString() }; + MessageFormat form = new MessageFormat(fStore + .getString("phpeclipse.sql.delete.template")); + + String query = form.format(arguments); + + if (numSelected > 0) { + setMessage(""); //$NON-NLS-1$ + } else { + setMessage(PHPMessages.getString("PHPDeleteRowPage.WarningNoWhere")); + } + + this.query.setText(query); + } + + protected String getQueryText() { + return query.getText(); + } + + /* + * (non-Javadoc) + * + * @see com.quantum.wizards.SQLPage#performFinish() + */ + public boolean performFinish() { + QuantumPlugin.getDefault().getSysClip().setContents( + new Object[] { query.getText() }, + new Transfer[] { TextTransfer.getInstance() }); + return true; + } +} +//import java.text.MessageFormat; +// +//import org.eclipse.jface.preference.IPreferenceStore; +//import org.eclipse.jface.wizard.WizardPage; +//import org.eclipse.swt.SWT; +//import org.eclipse.swt.dnd.TextTransfer; +//import org.eclipse.swt.dnd.Transfer; +//import org.eclipse.swt.events.ModifyEvent; +//import org.eclipse.swt.events.ModifyListener; +//import org.eclipse.swt.events.SelectionEvent; +//import org.eclipse.swt.events.SelectionListener; +//import org.eclipse.swt.layout.GridData; +//import org.eclipse.swt.layout.GridLayout; +//import org.eclipse.swt.widgets.Button; +//import org.eclipse.swt.widgets.Composite; +//import org.eclipse.swt.widgets.Label; +//import org.eclipse.swt.widgets.Text; +// +//import com.quantum.QuantumPlugin; +//import com.quantum.sql.TableRow; +//import com.quantum.wizards.BaseSQLPage; +//import com.quantum.wizards.SQLPage; +////import com.quantum.view.PHPSourceConsole; +////import com.quantum.view.tableview.TableAdapter; +// +//public class PHPDeleteRowPage extends BaseSQLPage implements SQLPage { +// TableRow row; +// String[] columnNames; +// Text[] values; +// Button[] whereValues; +// Label query; +// IPreferenceStore fStore; +// private final static boolean DEBUG = false; +// +// public PHPDeleteRowPage(String pageName) { +// super(pageName); +// } +// +//// public void init(TableRow row, TableAdapter adapter) { +//// this.row = row; +//// } +// +// protected String getQueryText() { +// return query.getText(); +// } +// +// public void createControl(Composite parent) { +// System.out.println("page create control"); +// fStore = QuantumPlugin.getDefault().getPreferenceStore(); +// Composite container = new Composite(parent, SWT.NULL); +// GridLayout layout = new GridLayout(); +// container.setLayout(layout); +// int layoutColumns = 3; +// layout.numColumns = layoutColumns; +// +// if (DEBUG) { +// if (row == null) { +// System.out.println("Row is null"); +// } +// if (row.getColumnNames() == null) { +// System.out.println("Columns are null"); +// } +// if (row.getTableData() == null) { +// System.out.println("Data is null"); +// } +// } +// columnNames = row.getColumnNames(); +// String[] data = row.getTableData(); +// if (DEBUG) { +// for (int i = 0; i < row.getColumnCount(); i++) { +// System.out.println("data = " + i + "=" + data[i]); +// System.out.println("column = " + i + "=" + columnNames[i]); +// } +// } +// values = new Text[row.getColumnCount()]; +// whereValues = new Button[row.getColumnCount()]; +// Label temp = new Label(container, SWT.NULL); +// temp.setText("Column Name"); +// temp = new Label(container, SWT.NULL); +// temp.setText("Value"); +// temp = new Label(container, SWT.NULL); +// temp.setText("Include in?"); +// for (int i = 0; i < row.getColumnCount(); i++) { +// Label label = new Label(container, SWT.NULL); +// label.setText(columnNames[i]); +// values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); +// GridData fullHorizontal = new GridData(); +// fullHorizontal.horizontalAlignment = GridData.FILL; +// values[i].setLayoutData(fullHorizontal); +// +// if (data[i] == null || data[i].equals("")) { +// values[i].setText('$' + columnNames[i]); +// } else { +// values[i].setText(data[i]); +// } +// +// values[i].addModifyListener(new ModifyListener() { +// public void modifyText(ModifyEvent e) { +// updateQuery(); +// } +// }); +// +// whereValues[i] = new Button(container, SWT.CHECK); +// whereValues[i].setText("Where clause"); +// whereValues[i].addSelectionListener(new SelectionListener() { +// public void widgetDefaultSelected(SelectionEvent e) { +// } +// public void widgetSelected(SelectionEvent e) { +// updateQuery(); +// } +// }); +// } +// query = new Label(container, SWT.WRAP); +// GridData gridData = new GridData(); +// gridData.horizontalSpan = layoutColumns; +// gridData.horizontalAlignment = GridData.FILL; +// gridData.verticalAlignment = GridData.FILL; +// gridData.grabExcessHorizontalSpace = true; +// gridData.grabExcessVerticalSpace = true; +// query.setLayoutData(gridData); +// +// setControl(container); +// updateQuery(); +// +// setPageComplete(true); +// } +// public void updateQuery() { +// if (DEBUG) { +// System.out.println("Updating delete query"); +// } +// StringBuffer whereClause = new StringBuffer(); +// int numSelected = 0; +// boolean first = false; +// for (int i = 0; i < columnNames.length; i++) { +// if (whereValues[i].getSelection()) { +// numSelected++; +// if (first) { +// whereClause.append(", "); +// } +// +// whereClause.append(columnNames[i]); +// whereClause.append(" = "); +// whereClause.append("'" + values[i].getText() + "'"); +// +// first = true; +// } +// } +// // if (whereClause.length() > 1) { +// // whereClause.deleteCharAt(whereClause.length() - 1); +// // whereClause.deleteCharAt(whereClause.length() - 1); +// // } +// +// String[] arguments = { row.getTable(), whereClause.toString()}; +// MessageFormat form = new +// MessageFormat(fStore.getString("phpeclipse.sql.delete.template")); +// +// String query = form.format(arguments); +// +// // String query = "$results = mysql_query(\"DELETE FROM " + row.getTable(); +// // if (numSelected > 0) { +// // query += " WHERE " + whereClause.toString() + "\");"; +// // } else { +// // query += "\");"; +// // } +// +// if (numSelected > 0) { +// setMessage(""); +// } else { +// setMessage("Warning: no \"where clause\" columns selected, all rows will be +// deleted"); +// } +// +// this.getControl().pack(); +// this.query.setText(query); +// } +// public boolean performFinish() { +//// PHPSourceConsole console = PHPSourceConsole.getInstance(); +//// console.clear(); +//// console.print(query.getText()); +// QuantumPlugin.getDefault().getSysClip().setContents( +// new Object[] { query.getText() }, +// new Transfer[] { TextTransfer.getInstance()}); +// return true; +// } +//} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPInsertRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPInsertRowPage.java new file mode 100644 index 0000000..13f8e2c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPInsertRowPage.java @@ -0,0 +1,290 @@ +package com.quantum.php.wizards; + +import java.text.MessageFormat; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.quantum.QuantumPlugin; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.Bookmark; +import com.quantum.model.Entity; +import com.quantum.php.PHPMessages; +import com.quantum.wizards.BaseSQLPage; +import com.quantum.wizards.SQLPage; + +public class PHPInsertRowPage extends BaseSQLPage implements SQLPage { + String[] columnNames; + Text[] values; + Label query; + int numColumns = 0; + private IPreferenceStore fStore; + + public PHPInsertRowPage(String pageName) { + super(pageName); + } + + public void createControl(Composite parent) { + System.out.println("page create control"); //$NON-NLS-1$ + fStore = QuantumPlugin.getDefault().getPreferenceStore(); + Composite container = new Composite(parent, SWT.V_SCROLL); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + layout.numColumns = 2; + + columnNames = this.results.getColumnNames(); + values = new Text[columnNames.length]; + new Label(container, SWT.NULL).setText(PHPMessages.getString("PHPInsertRowPage.ColumnName")); //$NON-NLS-1$ + new Label(container, SWT.NULL).setText(PHPMessages.getString("PHPInsertRowPage.Value")); //$NON-NLS-1$ + for (int i = 0; i < columnNames.length; i++) { + Label label = new Label(container, SWT.NULL); + label.setText(columnNames[i]); + values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.widthHint = 150; + values[i].setLayoutData(gridData); + + //values[i].setText(data[i]); + values[i].addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + updateQuery(); + } + }); + } + query = new Label(container, SWT.WRAP); + GridData gridData = new GridData(); + gridData.horizontalSpan = layout.numColumns; + gridData.horizontalAlignment = GridData.FILL; + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + query.setLayoutData(gridData); + + setControl(container); + updateQuery(); + + setPageComplete(true); + } + public void updateQuery() { + System.out.println("Updating query"); //$NON-NLS-1$ + StringBuffer valuesClause = new StringBuffer(); + StringBuffer namesClause = new StringBuffer(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); + DatabaseAdapter adapter = bookmark.getAdapter(); + + numColumns = 0; + for (int i = 0; i < columnNames.length; i++) { + String name = columnNames[i]; + String value = values[i].getText(); + if (value.length() > 0) { + if (numColumns > 0) { + valuesClause.append(", "); //$NON-NLS-1$ + namesClause.append(", "); + } + appendColumn(valuesClause, entity, name, adapter, value); + namesClause.append(name); + numColumns++; + } + } + +// String query = "INSERT INTO " + this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ +// if (numColumns > 0) { +// query += " (" + namesClause + ")"; +// query += " VALUES " + "(" + valuesClause; //$NON-NLS-1$ +// query += " )"; //$NON-NLS-1$ +// } + String[] arguments = { this.results.getEntity().getQuotedTableName(), namesClause.toString(), valuesClause.toString()}; + MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.insert.template")); + + String query = form.format(arguments); + + // String query = "$results = mysql_query(\"INSERT INTO " + row.getTable() + " ("; + // query += fieldClause.toString() + ") "; + // query += " VALUES (" + valuesClause.toString(); + // query += ")\");"; + this.query.setText(query); + } + /* (non-Javadoc) + * @see com.quantum.wizards.BaseSQLPage#getQueryText() + */ + protected String getQueryText() { + return this.query.getText(); + } + /* (non-Javadoc) + * @see com.quantum.wizards.SQLPage#performFinish() + */ + public boolean performFinish() { + QuantumPlugin.getDefault().getSysClip().setContents( + new Object[] { query.getText() }, + new Transfer[] { TextTransfer.getInstance()}); + return true; + } +} + +//package com.quantum.php.wizards; +// +//import java.text.MessageFormat; +// +//import org.eclipse.jface.preference.IPreferenceStore; +//import org.eclipse.jface.wizard.WizardPage; +//import org.eclipse.swt.SWT; +//import org.eclipse.swt.dnd.TextTransfer; +//import org.eclipse.swt.dnd.Transfer; +//import org.eclipse.swt.events.ModifyEvent; +//import org.eclipse.swt.events.ModifyListener; +//import org.eclipse.swt.layout.GridData; +//import org.eclipse.swt.layout.GridLayout; +//import org.eclipse.swt.widgets.Composite; +//import org.eclipse.swt.widgets.Label; +//import org.eclipse.swt.widgets.Text; +// +//import com.quantum.QuantumPlugin; +//import com.quantum.sql.TableRow; +//import com.quantum.wizards.BaseSQLPage; +//import com.quantum.wizards.SQLPage; +////import com.quantum.view.PHPSourceConsole; +////import com.quantum.view.tableview.TableAdapter; +// +//public class PHPInsertRowPage extends BaseSQLPage implements SQLPage { +// TableRow row; +// String[] columnNames; +// Text[] values; +// Label query; +// private final static boolean DEBUG = false; +// private IPreferenceStore fStore; +// +// public PHPInsertRowPage(String pageName) { +// super(pageName); +// } +// +//// public void init(TableRow row, TableAdapter adapter) { +//// this.row = row; +//// } +// +// public void createControl(Composite parent) { +// if (DEBUG) { +// System.out.println("page create control"); +// } +// fStore = QuantumPlugin.getDefault().getPreferenceStore(); +// Composite container = new Composite(parent, SWT.NULL); +// GridLayout layout = new GridLayout(); +// container.setLayout(layout); +// int layoutColumns = 2; +// layout.numColumns = layoutColumns; +// +// if (DEBUG) { +// if (row == null) { +// System.out.println("Row is null"); +// } +// if (row.getColumnNames() == null) { +// System.out.println("Columns are null"); +// } +// if (row.getTableData() == null) { +// System.out.println("Data is null"); +// } +// } +// +// columnNames = row.getColumnNames(); +// String[] data = row.getTableData(); +// if (DEBUG) { +// for (int i = 0; i < row.getColumnCount(); i++) { +// System.out.println("data = " + i + "=" + data[i]); +// System.out.println("column = " + i + "=" + columnNames[i]); +// } +// } +// values = new Text[row.getColumnCount()]; +// Label temp = new Label(container, SWT.NULL); +// temp.setText("Column Name"); +// temp = new Label(container, SWT.NULL); +// temp.setText("Value"); +// for (int i = 0; i < row.getColumnCount(); i++) { +// Label label = new Label(container, SWT.NULL); +// label.setText(columnNames[i]); +// values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); +// GridData fullHorizontal = new GridData(); +// fullHorizontal.horizontalAlignment = GridData.FILL; +// values[i].setLayoutData(fullHorizontal); +// +// //values[i].setText(data[i]); +// values[i].addModifyListener(new ModifyListener() { +// public void modifyText(ModifyEvent e) { +// updateQuery(); +// } +// }); +// } +// query = new Label(container, SWT.WRAP); +// GridData gridData = new GridData(); +// gridData.horizontalSpan = layoutColumns; +// gridData.horizontalAlignment = GridData.FILL; +// gridData.verticalAlignment = GridData.FILL; +// gridData.grabExcessHorizontalSpace = true; +// gridData.grabExcessVerticalSpace = true; +// query.setLayoutData(gridData); +// +// setControl(container); +// updateQuery(); +// +// setPageComplete(true); +// } +// public void updateQuery() { +// if (DEBUG) { +// System.out.println("Updating insert query"); +// } +// StringBuffer fieldClause = new StringBuffer(); +// +// StringBuffer valuesClause = new StringBuffer(); +// String text; +// boolean first = false; +// for (int i = 0; i < columnNames.length; i++) { +// text = values[i].getText(); +// if (!text.equals("")) { +// if (first) { +// valuesClause.append(", "); +// fieldClause.append(", "); +// } +// valuesClause.append("'" + values[i].getText() + "'"); +// fieldClause.append(columnNames[i]); +// first = true; +// } +// } +// // if (valuesClause.length() > 1) { +// // valuesClause.deleteCharAt(valuesClause.length() - 1); +// // valuesClause.deleteCharAt(valuesClause.length() - 1); +// // } +// String[] arguments = { row.getTable(), fieldClause.toString(), valuesClause.toString()}; +// MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.insert.template")); +// +// String query = form.format(arguments); +// +// // String query = "$results = mysql_query(\"INSERT INTO " + row.getTable() + " ("; +// // query += fieldClause.toString() + ") "; +// // query += " VALUES (" + valuesClause.toString(); +// // query += ")\");"; +// this.query.setText(query); +// } +// public boolean performFinish() { +//// PHPSourceConsole console = PHPSourceConsole.getInstance(); +//// console.clear(); +//// console.print(query.getText()); +// QuantumPlugin.getDefault().getSysClip().setContents( +// new Object[] { query.getText() }, +// new Transfer[] { TextTransfer.getInstance()}); +// return true; +// } +// /* (non-Javadoc) +// * @see com.quantum.wizards.BaseSQLPage#getQueryText() +// */ +// protected String getQueryText() { +// return this.query.getText(); +// } +//} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPSelectRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPSelectRowPage.java new file mode 100644 index 0000000..3769350 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPSelectRowPage.java @@ -0,0 +1,210 @@ + +package com.quantum.php.wizards; + +import java.text.MessageFormat; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.quantum.QuantumPlugin; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.Bookmark; +import com.quantum.model.Column; +import com.quantum.model.Entity; +import com.quantum.php.PHPMessages; +import com.quantum.wizards.BaseSQLPage; +import com.quantum.wizards.SQLPage; + +public class PHPSelectRowPage extends BaseSQLPage implements SQLPage { + String[] columnNames; + + Text[] variableNames; + + // Text[] newValues; + Button[] primaryKeys; + + Button[] selectValues; + + Label query; + + IPreferenceStore fStore; + + public PHPSelectRowPage(String pageName) { + super(pageName); + } + + public void createControl(Composite parent) { + System.out.println("page create control"); //$NON-NLS-1$ + Composite container = new Composite(parent, SWT.V_SCROLL); + fStore = QuantumPlugin.getDefault().getPreferenceStore(); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + Entity entity = this.results.getEntity(); + + int layoutColumns = 4; + layout.numColumns = layoutColumns; + + columnNames = this.results.getColumnNames(); + variableNames = new Text[columnNames.length]; + // newValues = new Text[columnNames.length]; + primaryKeys = new Button[columnNames.length]; + selectValues = new Button[columnNames.length]; + Label temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPSelectRowPage.ColumnName")); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPSelectRowPage.VariableName")); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(""); //$NON-NLS-1$ + // temp = new Label(container, SWT.NULL); + // temp.setText(PHPMessages.getString("PHPSelectRowPage.NewValue")); + // //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPSelectRowPage._13")); //$NON-NLS-1$ + for (int i = 0; i < columnNames.length; i++) { + Label label = new Label(container, SWT.NULL); + label.setText(columnNames[i]); + variableNames[i] = new Text(container, SWT.BORDER | SWT.SINGLE); + GridData gridData = new GridData(); + gridData.widthHint = 100; + variableNames[i].setLayoutData(gridData); + Object data = this.row == null ? null : this.row.get(i + 1); + variableNames[i].setText(data == null ? "" : '$' + columnNames[i]);//data.toString()); + variableNames[i].addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + updateQuery(); + } + }); + primaryKeys[i] = new Button(container, SWT.CHECK); + primaryKeys[i].setText("Where"); //$NON-NLS-1$ + Column column = (entity == null) ? null : getColumn(entity, + columnNames[i]); + if (column != null && column.isPrimaryKey()) + primaryKeys[i].setSelection(true); + primaryKeys[i].addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent e) { + } + + public void widgetSelected(SelectionEvent e) { + updateQuery(); + } + }); + // newValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); + // newValues[i].setText(data == null ? "" : '$'+data.toString()); + // gridData = new GridData(); + // gridData.widthHint = 100; + // newValues[i].setLayoutData(gridData); + // newValues[i].addModifyListener(new ModifyListener() { + // public void modifyText(ModifyEvent e) { + // updateQuery(); + // } + // }); + selectValues[i] = new Button(container, SWT.CHECK); + selectValues[i].setText(PHPMessages + .getString("PHPSelectRowPage.SelectValue")); //$NON-NLS-1$ + selectValues[i].addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent e) { + } + + public void widgetSelected(SelectionEvent e) { + updateQuery(); + } + }); + } + query = new Label(container, SWT.WRAP | SWT.V_SCROLL); + GridData gridData = new GridData(); + gridData.horizontalSpan = layoutColumns; + gridData.horizontalAlignment = GridData.FILL; + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + query.setLayoutData(gridData); + + setControl(container); + updateQuery(); + + setPageComplete(true); + } + + public void updateQuery() { + System.out.println("Selecting query"); //$NON-NLS-1$ + StringBuffer setClause = new StringBuffer(); + StringBuffer whereClause = new StringBuffer(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); + DatabaseAdapter adapter = bookmark.getAdapter(); + + int numValuesSet = 0; + int numValuesWhere = 0; + for (int i = 0; i < columnNames.length; i++) { + if (primaryKeys[i].getSelection()) { + String value = variableNames[i].getText(); + if (numValuesWhere > 0) + whereClause.append(" AND "); //$NON-NLS-1$ + whereClause.append("("); //$NON-NLS-1$ + whereClause.append(columnNames[i]); + whereClause.append(" = "); //$NON-NLS-1$ + appendColumn(whereClause, entity, columnNames[i], adapter, value); + whereClause.append(")"); //$NON-NLS-1$ + numValuesWhere++; + } + if (selectValues[i].getSelection()) { + // String value = newValues[i].getText(); + if (numValuesSet > 0) + setClause.append(", "); //$NON-NLS-1$ + setClause.append(columnNames[i]); + // setClause.append(" = "); //$NON-NLS-1$ + // appendColumn(setClause, entity, columnNames[i], adapter, value); + numValuesSet++; + } + } + // String query = "UPDATE " + this.results.getEntity().getQuotedTableName(); + // //$NON-NLS-1$ + // query += " SET " + setClause.toString(); //$NON-NLS-1$ + // query += " WHERE " + whereClause.toString(); //$NON-NLS-1$ + // + String[] arguments = { setClause.toString(), + this.results.getEntity().getQuotedTableName(), whereClause.toString() }; + MessageFormat form = new MessageFormat(fStore + .getString("phpeclipse.sql.select.template")); + + String query = form.format(arguments); + // String query = "$results = mysql_query(\"SELECT " + setClause.toString(); + // query += " FROM " + row.getTable(); + // query += " WHERE " + whereClause.toString() + "\");"; + this.query.setText(query); + + } + + /* + * (non-Javadoc) + * + * @see com.quantum.wizards.BaseSQLPage#getQueryText() + */ + protected String getQueryText() { + return query.getText(); + } + + /* + * (non-Javadoc) + * + * @see com.quantum.wizards.SQLPage#performFinish() + */ + public boolean performFinish() { + QuantumPlugin.getDefault().getSysClip().setContents( + new Object[] { query.getText() }, + new Transfer[] { TextTransfer.getInstance() }); + return true; + } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPUpdateRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPUpdateRowPage.java new file mode 100644 index 0000000..81be825 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/php/wizards/PHPUpdateRowPage.java @@ -0,0 +1,185 @@ +package com.quantum.php.wizards; + +import java.text.MessageFormat; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.quantum.QuantumPlugin; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.Bookmark; +import com.quantum.model.Column; +import com.quantum.model.Entity; +import com.quantum.php.PHPMessages; +import com.quantum.wizards.BaseSQLPage; +import com.quantum.wizards.SQLPage; + +public class PHPUpdateRowPage extends BaseSQLPage implements SQLPage { + String[] columnNames; + Text[] oldValues; + Text[] newValues; + Button[] primaryKeys; + Button[] setValues; + Label query; + IPreferenceStore fStore; + public PHPUpdateRowPage(String pageName) { + super(pageName); + } + + public void createControl(Composite parent) { + System.out.println("page create control"); //$NON-NLS-1$ + Composite container = new Composite(parent, SWT.V_SCROLL); + fStore = QuantumPlugin.getDefault().getPreferenceStore(); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + Entity entity = this.results.getEntity(); + + int layoutColumns = 5; + layout.numColumns = layoutColumns; + + columnNames = this.results.getColumnNames(); + oldValues = new Text[columnNames.length]; + newValues = new Text[columnNames.length]; + primaryKeys = new Button[columnNames.length]; + setValues = new Button[columnNames.length]; + Label temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPUpdateRowPage.ColumnName")); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPUpdateRowPage.OldValue")); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(""); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPUpdateRowPage.NewValue")); //$NON-NLS-1$ + temp = new Label(container, SWT.NULL); + temp.setText(PHPMessages.getString("PHPUpdateRowPage._13")); //$NON-NLS-1$ + for (int i = 0; i < columnNames.length; i++) { + Label label = new Label(container, SWT.NULL); + label.setText(columnNames[i]); + oldValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); + GridData gridData = new GridData(); + gridData.widthHint = 100; + oldValues[i].setLayoutData(gridData); + Object data = this.row == null ? null : this.row.get(i+1); + oldValues[i].setText(data == null ? "" : '$'+columnNames[i]); + oldValues[i].addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + updateQuery(); + } + }); + primaryKeys[i] = new Button(container, SWT.CHECK); + primaryKeys[i].setText("Where"); //$NON-NLS-1$ + Column column = (entity == null) ? null : getColumn(entity, columnNames[i]); + if (column != null && column.isPrimaryKey()) + primaryKeys[i].setSelection(true); + primaryKeys[i].addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent e) { + } + public void widgetSelected(SelectionEvent e) { + updateQuery(); + } + }); + newValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); + newValues[i].setText(data == null ? "" : '$'+columnNames[i]); + gridData = new GridData(); + gridData.widthHint = 100; + newValues[i].setLayoutData(gridData); + newValues[i].addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + updateQuery(); + } + }); + setValues[i] = new Button(container, SWT.CHECK); + setValues[i].setText(PHPMessages.getString("PHPUpdateRowPage.SetValue")); //$NON-NLS-1$ + setValues[i].addSelectionListener(new SelectionListener() { + public void widgetDefaultSelected(SelectionEvent e) { + } + public void widgetSelected(SelectionEvent e) { + updateQuery(); + } + }); + } + query = new Label(container, SWT.WRAP | SWT.V_SCROLL); + GridData gridData = new GridData(); + gridData.horizontalSpan = layoutColumns; + gridData.horizontalAlignment = GridData.FILL; + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + query.setLayoutData(gridData); + + setControl(container); + updateQuery(); + + setPageComplete(true); + } + public void updateQuery() { + System.out.println("Updating query"); //$NON-NLS-1$ + StringBuffer setClause = new StringBuffer(); + StringBuffer whereClause = new StringBuffer(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); + DatabaseAdapter adapter = bookmark.getAdapter(); + + int numValuesSet = 0; + int numValuesWhere = 0; + for (int i = 0; i < columnNames.length; i++) { + if (primaryKeys[i].getSelection()) { + String value = oldValues[i].getText(); + if (numValuesWhere > 0) whereClause.append(" AND "); //$NON-NLS-1$ + whereClause.append("("); //$NON-NLS-1$ + whereClause.append(columnNames[i]); + whereClause.append(" = "); //$NON-NLS-1$ + appendColumn(whereClause, entity, columnNames[i], adapter, value); + whereClause.append(")"); //$NON-NLS-1$ + numValuesWhere++; + } + if (setValues[i].getSelection()) { + String value = newValues[i].getText(); + if (numValuesSet > 0) setClause.append(", "); //$NON-NLS-1$ + setClause.append(columnNames[i]); + setClause.append(" = "); //$NON-NLS-1$ + appendColumn(setClause, entity, columnNames[i], adapter, value); + numValuesSet++; + } + } +// String query = "UPDATE " + this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ +// query += " SET " + setClause.toString(); //$NON-NLS-1$ +// query += " WHERE " + whereClause.toString(); //$NON-NLS-1$ +// + String[] arguments = { this.results.getEntity().getQuotedTableName(), setClause.toString(), whereClause.toString()}; + MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.update.template")); + + String query = form.format(arguments); + this.query.setText(query); + + } + + /* (non-Javadoc) + * @see com.quantum.wizards.BaseSQLPage#getQueryText() + */ + protected String getQueryText() { + return query.getText(); + } + + /* (non-Javadoc) + * @see com.quantum.wizards.SQLPage#performFinish() + */ + public boolean performFinish() { + QuantumPlugin.getDefault().getSysClip().setContents( + new Object[] { query.getText() }, + new Transfer[] { TextTransfer.getInstance()}); + return true; + } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/SQLEditorPreferences.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/SQLEditorPreferences.java index b1697ba..daf8164 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/SQLEditorPreferences.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/SQLEditorPreferences.java @@ -11,6 +11,7 @@ import org.eclipse.jface.preference.ColorFieldEditor; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -150,7 +151,8 @@ public class SQLEditorPreferences extends PreferencePage public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { - fontData = null; + FontData[] temp = JFaceResources.getTextFont().getFontData(); + fontData = temp == null || temp.length == 0 ? null : temp[0]; updateFontDisplay(); } }); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLConnectionPreferencePage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLConnectionPreferencePage.java deleted file mode 100644 index 99f7918..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLConnectionPreferencePage.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.quantum.preferences.php; - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import com.quantum.QuantumPlugin; - -public class PHPSQLConnectionPreferencePage - extends PreferencePage - implements IWorkbenchPreferencePage { - - StringFieldEditor fUserNameSFE; - StringFieldEditor fConnectSFE; - StringFieldEditor fDriverSFE; - StringFieldEditor fTypeSFE; - StringFieldEditor fDriverFileFFE; - - public PHPSQLConnectionPreferencePage() { - super(); - setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); - } - public void init(IWorkbench workbench) { - setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); - } - protected void performDefaults() { - fUserNameSFE.loadDefault(); - fConnectSFE.loadDefault(); - fDriverSFE.loadDefault(); - fTypeSFE.loadDefault(); - fDriverFileFFE.loadDefault(); - super.performDefaults(); - } - - public boolean performOk() { - fUserNameSFE.store(); - fConnectSFE.store(); - fDriverSFE.store(); - fTypeSFE.store(); - fDriverFileFFE.store(); - return super.performOk(); - } - - protected Control createContents(Composite parent) { - initializeDialogUnits(parent); - // final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - Composite composite = new Composite(parent, SWT.LEFT); - GridLayout layout = new GridLayout(); - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - // layout.numColumns = 1; - - fUserNameSFE = - new StringFieldEditor( - "phpeclipse.sql.username.connect", - "Default User name:", - composite); - fUserNameSFE.setPreferencePage(this); - fUserNameSFE.setPreferenceStore(getPreferenceStore()); - fUserNameSFE.load(); - - fConnectSFE = - new StringFieldEditor( - "phpeclipse.sql.connect.connect", - "Connect:", - composite); - fConnectSFE.setPreferencePage(this); - fConnectSFE.setPreferenceStore(getPreferenceStore()); - fConnectSFE.load(); - - fDriverSFE = - new StringFieldEditor( - "phpeclipse.sql.driver.connect", - "Driver:", - composite); - fDriverSFE.setPreferencePage(this); - fDriverSFE.setPreferenceStore(getPreferenceStore()); - fDriverSFE.load(); - - fTypeSFE = - new StringFieldEditor("phpeclipse.sql.type.connect", "Type:", composite); - fTypeSFE.setPreferencePage(this); - fTypeSFE.setPreferenceStore(getPreferenceStore()); - fTypeSFE.load(); - - // fDriverFileFFE = - // new FileFieldEditor( - // "phpeclipse.sql.filename.connect", - // "Driver filename:", - // composite); - fDriverFileFFE = - new StringFieldEditor( - "phpeclipse.sql.filename.connect", - "Driver filename:", - composite); - fDriverFileFFE.setPreferencePage(this); - fDriverFileFFE.setPreferenceStore(getPreferenceStore()); - fDriverFileFFE.load(); - - return composite; - } -} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLTemplatesPreferencePage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLTemplatesPreferencePage.java deleted file mode 100644 index 6854ee5..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/preferences/php/PHPSQLTemplatesPreferencePage.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.quantum.preferences.php; - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import com.quantum.QuantumPlugin; - -public class PHPSQLTemplatesPreferencePage - extends PreferencePage - implements IWorkbenchPreferencePage { - - StringFieldEditor fPHPSelectSFE; - StringFieldEditor fPHPInsertSFE; - StringFieldEditor fPHPUpdateSFE; - StringFieldEditor fPHPDeleteSFE; - - public PHPSQLTemplatesPreferencePage() { - super(); - setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); - // setDescription("PHP SQL templates"); //$NON-NLS-1$ - } - - public void init(IWorkbench workbench) { - setPreferenceStore(QuantumPlugin.getDefault().getPreferenceStore()); - } - - protected void performDefaults() { - fPHPSelectSFE.loadDefault(); - fPHPInsertSFE.loadDefault(); - fPHPUpdateSFE.loadDefault(); - fPHPDeleteSFE.loadDefault(); - super.performDefaults(); - } - - public boolean performOk() { - fPHPSelectSFE.store(); - fPHPInsertSFE.store(); - fPHPUpdateSFE.store(); - fPHPDeleteSFE.store(); - return super.performOk(); - } - - protected Control createContents(Composite parent) { - initializeDialogUnits(parent); - // final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - Composite composite = new Composite(parent, SWT.LEFT); - composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - composite.setLayout(new GridLayout()); - - fPHPSelectSFE = - new StringFieldEditor( - "phpeclipse.sql.select.template", - "SELECT template:", - composite); - fPHPSelectSFE.setPreferencePage(this); - fPHPSelectSFE.setPreferenceStore(getPreferenceStore()); - fPHPSelectSFE.load(); - - fPHPInsertSFE = - new StringFieldEditor( - "phpeclipse.sql.insert.template", - "INSERT template:", - composite); - fPHPInsertSFE.setPreferencePage(this); - fPHPInsertSFE.setPreferenceStore(getPreferenceStore()); - fPHPInsertSFE.load(); - - fPHPUpdateSFE = - new StringFieldEditor( - "phpeclipse.sql.update.template", - "UPDATE template:", - composite); - fPHPUpdateSFE.setPreferencePage(this); - fPHPUpdateSFE.setPreferenceStore(getPreferenceStore()); - fPHPUpdateSFE.load(); - - fPHPDeleteSFE = - new StringFieldEditor( - "phpeclipse.sql.delete.template", - "DELETE template:", - composite); - fPHPDeleteSFE.setPreferencePage(this); - fPHPDeleteSFE.setPreferenceStore(getPreferenceStore()); - fPHPDeleteSFE.load(); - return composite; - } -} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/properties/BookmarkPropertyPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/properties/BookmarkPropertyPage.java index b4d53ea..6559347 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/properties/BookmarkPropertyPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/properties/BookmarkPropertyPage.java @@ -1,8 +1,22 @@ package com.quantum.properties; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import com.quantum.IQuantumConstants; +import com.quantum.adapters.AdapterFactory; +import com.quantum.model.Bookmark; +import com.quantum.model.BookmarkHolder; +import com.quantum.model.JDBCDriver; +import com.quantum.wizards.BookmarkWizard; +import com.quantum.wizards.JDBCDriverSelectionWizardPage; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -15,15 +29,38 @@ import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.PropertyPage; -import com.quantum.IQuantumConstants; -import com.quantum.adapters.AdapterFactory; -import com.quantum.adapters.DatabaseAdapter; -import com.quantum.model.Bookmark; -import com.quantum.model.BookmarkCollection; -import com.quantum.model.BookmarkHolder; -import com.quantum.model.JDBCDriver; - public class BookmarkPropertyPage extends PropertyPage { + + class ChooseDriverWizard extends Wizard { + + private JDBCDriver selection; + private JDBCDriverSelectionWizardPage page; + private PropertyChangeListener listener = new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent event) { + if ("driver".equals(event.getPropertyName())) { + ChooseDriverWizard.this.selection = (JDBCDriver) event.getNewValue(); + } + } + }; + + public void addPages() { + this.page = new JDBCDriverSelectionWizardPage("page1"); + this.page.addPropertyChangeListener(this.listener); + addPage(this.page); + } + + public void dispose() { + this.page.removePropertyChangeListener(this.listener); + super.dispose(); + } + public boolean performFinish() { + BookmarkPropertyPage.this.driver = this.selection; + BookmarkPropertyPage.this.setDriverDetails(); + return true; + } + + } + private Text password; private Text userid; @@ -32,10 +69,12 @@ public class BookmarkPropertyPage extends PropertyPage { private Text jdbcURL; private Text driverName; private Text driverPath; + private Text driverClassName; + private Text driverVersion; + private Text type; - private Combo type; private Combo autoCommit; - private DatabaseAdapter[] adapters = AdapterFactory.getInstance().getDriverList(); + private JDBCDriver driver; protected Control createContents(Composite parent) { @@ -64,7 +103,7 @@ public class BookmarkPropertyPage extends PropertyPage { data.horizontalSpan = 2; tabFolder.setLayoutData(data); - createUserTab(tabFolder); + createConnectionTab(tabFolder); createDriverTab(tabFolder); createOptionsTab(tabFolder); @@ -86,46 +125,67 @@ public class BookmarkPropertyPage extends PropertyPage { GridLayout layout = new GridLayout(); layout.numColumns = 2; composite.setLayout(layout); - GridData data = new GridData(GridData.FILL); - data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING; - data.grabExcessHorizontalSpace = true; - composite.setLayoutData(data); + composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label label = new Label(composite, SWT.NONE); label.setText("Driver Name:"); this.driverName = new Text(composite, SWT.BORDER); - data = new GridData(GridData.FILL); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - this.driverName.setLayoutData(data); + this.driverName.setLayoutData(createFillHorizontalGridData()); + this.driverName.setEditable(false); label = new Label(composite, SWT.NONE); - label.setText("Driver Location:"); + label.setText("Driver Class Name:"); + + this.driverClassName = new Text(composite, SWT.BORDER); + this.driverClassName.setLayoutData(createFillHorizontalGridData()); + this.driverClassName.setEditable(false); + + label = new Label(composite, SWT.NONE); + label.setText("Driver Version:"); + + this.driverVersion = new Text(composite, SWT.BORDER); + this.driverVersion.setLayoutData(createFillHorizontalGridData()); + this.driverVersion.setEditable(false); + + label = new Label(composite, SWT.NONE); + label.setText("Driver Path:"); this.driverPath = new Text(composite, SWT.BORDER); - data = new GridData(GridData.FILL); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - this.driverPath.setLayoutData(data); + this.driverPath.setLayoutData(createFillHorizontalGridData()); + this.driverPath.setEditable(false); label = new Label(composite, SWT.NULL); label.setText("Type:"); - this.type = new Combo(composite, SWT.SIMPLE | SWT.DROP_DOWN | SWT.READ_ONLY); - String adapterNames[] = new String[adapters.length]; - for (int i = 0; i < adapters.length; i++) { - adapterNames[i] = adapters[i].getDisplayName(); - } - this.type.setItems(adapterNames); - - data = new GridData(); - data.horizontalAlignment = GridData.FILL; - this.type.setLayoutData(data); + this.type = new Text(composite, SWT.BORDER); + this.type.setLayoutData(createFillHorizontalGridData()); + this.type.setEditable(false); driverTab.setControl(composite); + + Button button = new Button(composite, SWT.PUSH); + button.setText("Change"); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END); + data.horizontalSpan = 2; + button.setLayoutData(data); + button.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent event) { + WizardDialog dialog = + new WizardDialog(getShell(), new ChooseDriverWizard()); + dialog.open(); + } + public void widgetDefaultSelected(SelectionEvent event) { + } + }); + } + + private GridData createFillHorizontalGridData() { + GridData data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = 200; + return data; } - private void createUserTab(TabFolder tabFolder) { + private void createConnectionTab(TabFolder tabFolder) { TabItem userTab = new TabItem(tabFolder, SWT.NONE); userTab.setText("Connection"); @@ -218,7 +278,6 @@ public class BookmarkPropertyPage extends PropertyPage { this.autoCommit.setLayoutData(data); optionsTab.setControl(composite); - } @@ -235,12 +294,9 @@ public class BookmarkPropertyPage extends PropertyPage { } else { bookmark.setPassword(this.password.getText()); } - - int index = this.type.getSelectionIndex(); bookmark.setConnect(this.jdbcURL.getText()); - JDBCDriver jdbcDriver = BookmarkCollection.getInstance().findDriver( - this.driverName.getText(), this.driverPath.getText(), this.adapters[index].getType()); - bookmark.setJDBCDriver(jdbcDriver); + + bookmark.setJDBCDriver(this.driver); if (this.autoCommit.getSelectionIndex() >= 0) bookmark.setAutoCommitPreference(this.autoCommit.getItem(this.autoCommit.getSelectionIndex())); return super.performOk(); @@ -257,19 +313,12 @@ public class BookmarkPropertyPage extends PropertyPage { String password = bookmark.getPassword(); this.password.setText(password == null ? "" : password); this.userid.setText(bookmark.getUsername()); + this.jdbcURL.setText(bookmark.getConnect()); - this.type.select(0); - boolean done = false; - for (int i = 0, - length = (adapters == null) ? 0 : adapters.length; - !done && i < length; - i++) { - if (bookmark.getJDBCDriver().getType() != null && - bookmark.getJDBCDriver().getType().equals(adapters[i].getType())) { - this.type.select(i); - done = true; - } - } + this.driver = bookmark.getJDBCDriver(); + + setDriverDetails(); + if (bookmark.getAutoCommitPreference().equals(IQuantumConstants.autoCommitTrue)) this.autoCommit.select(0); else if (bookmark.getAutoCommitPreference().equals(IQuantumConstants.autoCommitFalse)) @@ -277,8 +326,18 @@ public class BookmarkPropertyPage extends PropertyPage { else if (bookmark.getAutoCommitPreference().equals(IQuantumConstants.autoCommitSaved)) this.autoCommit.select(2); - this.driverName.setText(bookmark.getJDBCDriver().getClassName()); - this.jdbcURL.setText(bookmark.getConnect()); - this.driverPath.setText(bookmark.getJDBCDriver().getJarFileName()); } + + /** + * + */ + private void setDriverDetails() { + this.driverName.setText(this.driver.getName()); + this.driverClassName.setText(this.driver.getClassName()); + String path = this.driver.getJarFilePath(); + this.driverPath.setText(path == null ? "" : path); + String version = this.driver.getVersion(); + this.driverVersion.setText(version == null ? "" : version); + this.type.setText(AdapterFactory.getInstance().getAdapter(this.driver.getType()).getDisplayName()); + } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/MultiSQLServer.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/MultiSQLServer.java index 97c1cc1..f5eb590 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/MultiSQLServer.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/MultiSQLServer.java @@ -1,29 +1,21 @@ package com.quantum.sql; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.Reader; -import java.io.UnsupportedEncodingException; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Driver; import java.sql.ResultSet; -import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; -import java.util.Vector; +import com.quantum.Messages; +import com.quantum.adapters.DatabaseAdapter; import com.quantum.model.Bookmark; import com.quantum.model.ConnectionException; import com.quantum.model.Entity; import com.quantum.model.JDBCDriver; import com.quantum.model.PasswordFinder; -import com.quantum.sql.metadata.MetaDataJDBCInterface; -import com.quantum.sql.metadata.ObjectMetaData; import com.quantum.view.LogProxy; -import com.quantum.view.bookmark.EntityNode; -import com.quantum.view.bookmark.TreeNode; /** @@ -31,11 +23,9 @@ import com.quantum.view.bookmark.TreeNode; * Use MultiSQLServer.getInstance() to get the object. */ public class MultiSQLServer implements ConnectionEstablisher { - private static final int STREAM = 1024 * 2; public static final String USERNAME = "user"; //$NON-NLS-1$ public static final String PASSWORD = "password"; //$NON-NLS-1$ private static MultiSQLServer instance = null; - boolean running = true; private MultiSQLServer() { } @@ -46,21 +36,23 @@ public class MultiSQLServer implements ConnectionEstablisher { return instance; } - public void commit(Connection con) { + public void commit(Connection con) throws SQLException { LogProxy log = LogProxy.getInstance(); try { con.commit(); } catch (SQLException e) { log.addText(LogProxy.ERROR, "Error commiting: " + e, e); //$NON-NLS-1$ + throw e; } } - public void rollback(Connection con) { + public void rollback(Connection con) throws SQLException { LogProxy log = LogProxy.getInstance(); try { con.rollback(); } catch (SQLException e) { log.addText(LogProxy.ERROR, "Error rolling back: " + e, e); //$NON-NLS-1$ + throw e; } } @@ -128,12 +120,11 @@ public class MultiSQLServer implements ConnectionEstablisher { try { JDBCDriver jdbcDriver = bookmark.getJDBCDriver(); Driver driver = jdbcDriver.getDriver(); - Connection connection = null; if (driver != null) { Properties props = new Properties(); props.put(USERNAME, bookmark.getUsername()); props.put(PASSWORD, password); - connection = + Connection connection = driver.connect(bookmark.getConnect(), props); if (connection == null) { throw new ConnectionException("Error: Driver returned a null connection: " + bookmark.toString()); //$NON-NLS-1$ @@ -144,252 +135,94 @@ public class MultiSQLServer implements ConnectionEstablisher { jdbcDriver.setVersion(metaData.getDriverVersion()); log.addText(LogProxy.RESULTS, "Connected to: " + bookmark.getName()); //$NON-NLS-1$ System.out.println("Connected"); //$NON-NLS-1$ + return connection; + } else { + throw new ConnectionException(Messages.getString( + ConnectionException.class, "couldNotInstaniateDriver", + new Object[] { jdbcDriver.getClassName(), bookmark.getName() })); } - return connection; } catch (SQLException e) { throw new ConnectionException(e); } } - public SQLResults execute(Connection con, String s) throws SQLException { - return execute(con, s, -1, -1); - } - public SQLResults execute(Connection con, String s, int startRow, int endRow) throws SQLException { - return execute(con, s, -1, -1, Integer.MAX_VALUE); + public SQLResults execute(Bookmark bookmark, Connection con, Entity entity, String s) + throws SQLException { + return execute(bookmark, con, entity, s, 200); } - public SQLResults execute(Connection con, String s, int startRow, int endRow, int maxLength) throws SQLException { - return execute(con, s, startRow, endRow, maxLength, ""); //$NON-NLS-1$ + public SQLResults execute(Bookmark bookmark, Connection con, String s) + throws SQLException { + return execute(bookmark, con, null, s, 200); } - public SQLResults execute( - Connection con, - String s, - int startRow, - int endRow, - int maxLength, - String encoding) - throws SQLException { + public SQLResultSetResults getMetaData(Entity entity, Connection connection) throws SQLException { + String query = "SELECT * FROM " + entity.getQuotedTableName() + " WHERE (1 = 0)"; //$NON-NLS-1$ //$NON-NLS-2$ + SQLResultSetResults results = null; + if (connection != null) { + Statement statement = connection.createStatement(); + try { + ResultSet set = statement.executeQuery(query); + try { + results = SQLMetaDataResults.create(entity.getBookmark(), set, query, entity); + } finally { + set.close(); + } + } finally { + statement.close(); + } + } + return results; + } + + public SQLResults execute(Bookmark bookmark, Connection con, String sql, + int numberOfRowsPerPage) throws SQLException { + return execute(bookmark, con, null, sql, numberOfRowsPerPage); + } - SQLResults results = new SQLResults(); + + public SQLResults execute( + Bookmark bookmark, + Connection con, + Entity entity, + String sql, + int numberOfRowsPerPage) + throws SQLException { long startTime = System.currentTimeMillis(); System.out.println("Executing"); //$NON-NLS-1$ LogProxy log = LogProxy.getInstance(); - log.addText(LogProxy.QUERY, "Executing Request [" + s + "]"); //$NON-NLS-1$ //$NON-NLS-2$ - boolean metadata = false; - if (s.startsWith("METADATA")) { //$NON-NLS-1$ - metadata = true; - } - if (metadata) { - results.setQuery(s); - String table = s.substring(s.indexOf(':') + 1); - String query = "SELECT * FROM " + table + " WHERE (1 = 0)"; //$NON-NLS-1$ //$NON-NLS-2$ - s = query; - log.addText(LogProxy.QUERY, "Metadata Request [" + s + "]"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - results.setQuery(s); - } - - Statement stmt = con.createStatement(); - boolean flag = stmt.execute(s); - results.setResultSet(flag); - if (metadata) { - genMetadataResultSet(results, stmt); - return results; - } - if (!flag) { - int updates = stmt.getUpdateCount(); - results.setUpdateCount(updates); - log.addText(LogProxy.RESULTS, "Success: " + updates + " records updated"); //$NON-NLS-1$ //$NON-NLS-2$ - - } else { - ResultSet set = stmt.getResultSet(); - ResultSetMetaData metaData = set.getMetaData(); - int columnCount = metaData.getColumnCount(); - Vector columnNames = new Vector(); - for (int i = 1; i <= columnCount; i++) { - columnNames.addElement(metaData.getColumnName(i)); - } - results.setColumnNames(columnNames); - Vector columnTypes = new Vector(); - for (int i = 1; i <= columnCount; i++) { - columnTypes.addElement(metaData.getColumnTypeName(i)); - } - results.setColumnTypes(columnTypes); - int columnSizes[] = new int[columnCount]; - for (int i = 1; i <= columnCount; i++) { - columnSizes[i - 1] = metaData.getColumnDisplaySize(i); - } - int rowCount = 1; - boolean exitEarly = false; - while (set.next()) { - boolean disable = startRow < 1 || endRow < 1; - boolean start = rowCount >= startRow; - boolean end = rowCount <= endRow; - if (disable || (start && end)) { - Vector row = new Vector(); - for (int i = 1; i <= columnCount; i++) { - String value; - if (columnSizes[i - 1] < STREAM - && columnSizes[i - 1] < maxLength) { - if (encoding.equals("")) { //$NON-NLS-1$ - value = set.getString(i); - } else { - try { - value = - new String(set.getBytes(i), encoding); - } catch (UnsupportedEncodingException e) { - log.addText(LogProxy.ERROR, "Error Unsupported encoding " + encoding.toString() + ":" + e.toString(), e); //$NON-NLS-1$ //$NON-NLS-2$ - value = new String(set.getBytes(i)); - } - } - } else { - try { - if (encoding.equals("")) { //$NON-NLS-1$ - Reader reader = set.getCharacterStream(i); - StringBuffer buffer = new StringBuffer(); - if (reader != null) { - int retVal = reader.read(); - int count = 0; - while (retVal >= 0) { - buffer.append((char) retVal); - retVal = reader.read(); - count++; - if (count > maxLength) { - buffer.append("...>>>"); //$NON-NLS-1$ - break; - } - } - reader.close(); - } - value = buffer.toString(); - } else { - InputStream binaryStream = - set.getBinaryStream(i); - ByteArrayOutputStream baos = - new ByteArrayOutputStream(); - if (binaryStream != null) { - int retVal = binaryStream.read(); - int count = 0; - while (retVal >= 0) { - baos.write(retVal); - retVal = binaryStream.read(); - count++; - if (count > maxLength) { - break; - } - } - binaryStream.close(); - } - value = - new String( - baos.toByteArray(), - encoding); - } - } catch (Throwable e) { - // hack for mysql which doesn't implement - // character streams - value = set.getString(i); - } - } - if (set.wasNull()) { - row.addElement(""); //$NON-NLS-1$ - } else { - row.addElement(value); - } - } - results.addRow(row); - } - rowCount++; - if (!disable && (rowCount > endRow)) { - exitEarly = true; - break; + log.addText(LogProxy.QUERY, "Executing Request [" + sql + "]"); //$NON-NLS-1$ //$NON-NLS-2$ + Statement statement = con.createStatement(); + try { + SQLResults results; + if (statement.execute(sql)) { + ResultSet set = statement.getResultSet(); + try { + results = SQLStandardResultSetResults.create(set, bookmark, sql, entity, numberOfRowsPerPage); + } finally { + set.close(); } - } - if (exitEarly) { - results.setHasMore(set.next()); } else { - results.setMaxSize(rowCount); - results.setHasMore(false); + int updates = statement.getUpdateCount(); + results = new SQLUpdateResults(updates); } - set.close(); - } - log.addText(LogProxy.RESULTS, "Success: result set displayed"); //$NON-NLS-1$ - stmt.close(); - results.setTime(System.currentTimeMillis() - startTime); - System.out.println("Executed"); //$NON-NLS-1$ - System.out.println(); - return results; - } - private void genMetadataResultSet(SQLResults results, Statement stmt) - throws SQLException { - ResultSet set = stmt.getResultSet(); - ResultSetMetaData metaData = set.getMetaData(); - int columnCount = metaData.getColumnCount(); - Vector columnNames = new Vector(); - columnNames.addElement("ColumnName"); //$NON-NLS-1$ - columnNames.addElement("Type"); //$NON-NLS-1$ - columnNames.addElement("Size"); //$NON-NLS-1$ - columnNames.addElement("Nullable"); //$NON-NLS-1$ - columnNames.addElement("AutoIncrement"); //$NON-NLS-1$ - results.setColumnNames(columnNames); - for (int i = 1; i <= columnCount; i++) { - Vector row = new Vector(); - row.addElement(metaData.getColumnName(i)); - row.addElement(metaData.getColumnTypeName(i)); - int textSize = metaData.getColumnDisplaySize(i); - int precision = metaData.getPrecision(i); - int scale = metaData.getScale(i); - if (scale == 0 && precision == 0) { - row.addElement(Integer.toString(precision)); - } else { - row.addElement(textSize + ", " + precision + ", " + scale); //$NON-NLS-1$ //$NON-NLS-2$ - } - int nullable = metaData.isNullable(i); - if (nullable == ResultSetMetaData.columnNoNulls) { - row.addElement("Not Null"); //$NON-NLS-1$ - } else if (nullable == ResultSetMetaData.columnNullable) { - row.addElement("Nullable"); //$NON-NLS-1$ - } else if ( - nullable == ResultSetMetaData.columnNullableUnknown) { - row.addElement("Nullable"); //$NON-NLS-1$ - } else { - row.addElement(""); //$NON-NLS-1$ + log.addText(LogProxy.RESULTS, "Success: result set displayed"); //$NON-NLS-1$ + if (results != null) { + results.setTime(System.currentTimeMillis() - startTime); } - row.addElement( - (metaData.isAutoIncrement(i) - ? Boolean.TRUE - : Boolean.FALSE) - .toString()); - results.addRow(row); - } - results.setHasMore(false); - set.close(); - } - - /** - * Returns an ObjectMetadata object got from the connection 'con' using the name and schema of the node. - * @param con - * @param node - * @return - * @throws SQLException - */ - public ObjectMetaData getObjectMetadata(Connection con, TreeNode node) throws SQLException { - ObjectMetaData metadata = new ObjectMetaData(); - if (!(node instanceof Entity)) return metadata; - - String schema = ((Entity)node).getSchema(); - String tableName = node.getName(); - - if (schema.length() == 0) schema = null; - metadata.setColumns(MetaDataJDBCInterface.getColumns(con, schema, tableName)); - if (node instanceof EntityNode && ((EntityNode) node).isTable()) { - metadata.setPrimaryKeys(MetaDataJDBCInterface.getPrimaryKeys(con, schema, tableName)); - metadata.setForeignKeys(MetaDataJDBCInterface.getForeignKeys(con, schema, tableName, true)); - metadata.setIndexInfo(MetaDataJDBCInterface.getIndexInfo(con, schema, tableName)); - metadata.setBestRowId(MetaDataJDBCInterface.getBestRowId(con, schema, tableName)); + return results; + } finally { + statement.close(); } - return metadata; } + public int getSize(Bookmark bookmark, Connection connection, String tableName, DatabaseAdapter adapter) throws SQLException { + SQLResultSetResults results = (SQLResultSetResults) execute( + bookmark, connection, adapter.getCountQuery(tableName)); + if (results.getRowCount() > 0 && results.getColumnCount() > 0) { + return Integer.parseInt(results.getElement(1, 1).toString()); + } else { + return -1; + } + } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLHelper.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLHelper.java deleted file mode 100644 index 144a170..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLHelper.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.quantum.sql; - -import java.sql.Connection; -import java.sql.SQLException; - -import com.quantum.adapters.DatabaseAdapter; -import com.quantum.view.LogProxy; - -public class SQLHelper { - - public static int getSize(Connection connection, String tableName, DatabaseAdapter adapter) throws SQLException { - SQLResults results = MultiSQLServer.getInstance().execute( - connection, adapter.getCountQuery(tableName)); - if (results.getRowCount() > 0 && results.getColumnCount() > 0) { - return Integer.parseInt(results.getElement(1, 1).toString()); - } else { - return -1; - } - } - - public static SQLResults getResults(Connection connection, String query, int start, int end, int maxLength, String encoding) { - try { - return MultiSQLServer.getInstance().execute(connection, - query, start, end, maxLength, encoding); - } catch (SQLException e) { - LogProxy log = LogProxy.getInstance(); - log.addText( - LogProxy.ERROR, - "Error Executing: " + query + ":" + e.toString(), e); //$NON-NLS-1$ //$NON-NLS-2$ - } - SQLResults results = new SQLResults(); - results.setIsError(true); - return results; - } - - /** - * True if the type is Real (numeric and with decimal part) according to java.sql.Types - * @param type - * @return - */ - public static boolean isReal(int type) { - return (type == java.sql.Types.DECIMAL || type == java.sql.Types.DOUBLE || type ==java.sql.Types.FLOAT || - type == java.sql.Types.NUMERIC || type == java.sql.Types.REAL ); - } - - /** - * True if the type is Numeric according to java.sql.Types - * @param type - * @return - */ - public static boolean isNumeric(int type) { - return (type == java.sql.Types.DECIMAL || type == java.sql.Types.DOUBLE || type ==java.sql.Types.FLOAT || - type == java.sql.Types.NUMERIC || type == java.sql.Types.REAL || type == java.sql.Types.BIGINT || - type == java.sql.Types.TINYINT || type == java.sql.Types.SMALLINT || type == java.sql.Types.INTEGER ); - } - /** - * True if the type is textual according to java.sql.Types - * @param type - * @return - */ - public static boolean isText(int type) { - return (type == java.sql.Types.CLOB || type == java.sql.Types.VARBINARY || type ==java.sql.Types.VARCHAR - || type == java.sql.Types.CHAR || type == java.sql.Types.LONGVARCHAR ); - } - - public static String getQualifiedName(String schema, String name) { - return (schema != null && schema.length() > 0) ? schema + "." + name : name; - } -} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLMetaDataResults.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLMetaDataResults.java new file mode 100644 index 0000000..61b3333 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLMetaDataResults.java @@ -0,0 +1,91 @@ +package com.quantum.sql; + +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; + +import com.quantum.model.Bookmark; +import com.quantum.model.Entity; + + +/** + * @author BC + */ +public class SQLMetaDataResults extends SQLResultSetResults { + + /** + * @param query + */ + private SQLMetaDataResults(String query, Bookmark bookmark, Entity entity) { + super(query, bookmark, entity); + } + + static SQLResultSetResults create(Bookmark bookmark, ResultSet set, String query, Entity entity) throws SQLException { + + SQLMetaDataResults results = new SQLMetaDataResults(query, bookmark, entity); + results.parseResultSet(set); + + return results; + } + + /** + * @param set + * @param results + * @param metaData + * @param columnCount + * @throws SQLException + */ + protected void parseResultSet(ResultSet set) throws SQLException { + + List columns = new ArrayList(); + columns.add(new Column("ColumnName", "", 0)); //$NON-NLS-1$ + columns.add(new Column("Type", "", 0)); //$NON-NLS-1$ + columns.add(new Column("Size", "", 0)); //$NON-NLS-1$ + columns.add(new Column("Nullable", "", 0)); //$NON-NLS-1$ + columns.add(new Column("AutoIncrement", "", 0)); //$NON-NLS-1$ + setColumns((Column[]) columns.toArray(new Column[columns.size()])); + + ResultSetMetaData metaData = set.getMetaData(); + + List rowList = new ArrayList(); + for (int i = 1; i <= metaData.getColumnCount(); i++) { + Vector row = new Vector(); + row.addElement(metaData.getColumnName(i)); + row.addElement(metaData.getColumnTypeName(i)); + int textSize = metaData.getColumnDisplaySize(i); + int precision = metaData.getPrecision(i); + int scale = metaData.getScale(i); + if (scale == 0 && precision == 0) { + row.addElement(Integer.toString(precision)); + } else { + row.addElement(textSize + ", " + precision + ", " + scale); //$NON-NLS-1$ //$NON-NLS-2$ + } + int nullable = metaData.isNullable(i); + if (nullable == ResultSetMetaData.columnNoNulls) { + row.addElement("Not Null"); //$NON-NLS-1$ + } else if (nullable == ResultSetMetaData.columnNullable) { + row.addElement("Nullable"); //$NON-NLS-1$ + } else if ( + nullable == ResultSetMetaData.columnNullableUnknown) { + row.addElement("Nullable"); //$NON-NLS-1$ + } else { + row.addElement(""); //$NON-NLS-1$ + } + row.addElement( + (metaData.isAutoIncrement(i) + ? Boolean.TRUE + : Boolean.FALSE) + .toString()); + rowList.add(new Row(row)); + } + setRows((Row[]) rowList.toArray(new Row[rowList.size()])); + set.close(); + } + + public boolean isMetaData() { + return true; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetCollection.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetCollection.java new file mode 100644 index 0000000..09aa993 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetCollection.java @@ -0,0 +1,56 @@ +package com.quantum.sql; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + + +/** + * @author BC + */ +public class SQLResultSetCollection { + + private static final SQLResultSetCollection instance = new SQLResultSetCollection(); + + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + + private List results = Collections.synchronizedList(new ArrayList()); + + private SQLResultSetCollection() { + } + public static SQLResultSetCollection getInstance() { + return SQLResultSetCollection.instance; + } + + public void addPropertyChangeListener(PropertyChangeListener arg0) { + this.propertyChangeSupport.addPropertyChangeListener(arg0); + } + public void removePropertyChangeListener(PropertyChangeListener arg0) { + this.propertyChangeSupport.removePropertyChangeListener(arg0); + } + + public void addSQLResultSet(SQLResultSetResults resultSet) { + this.results.add(resultSet); + this.propertyChangeSupport.firePropertyChange("resultSets", null, resultSet); + } + + public void removeSQLResultSet(SQLResultSetResults resultSet) { + if (this.results.remove(resultSet)) { + this.propertyChangeSupport.firePropertyChange("resultSets", resultSet, null); + } + } + + public void removeAllSQLResultSet() { + if (this.results.size() > 0) { + this.results.clear(); + } + this.propertyChangeSupport.firePropertyChange("resultSets", null, null); + } + + public SQLResultSetResults[] getResultSets() { + return (SQLResultSetResults[]) this.results.toArray( + new SQLResultSetResults[this.results.size()]); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetResults.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetResults.java new file mode 100644 index 0000000..65716d0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResultSetResults.java @@ -0,0 +1,271 @@ +package com.quantum.sql; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; + +import com.quantum.model.Bookmark; +import com.quantum.model.Entity; + +/** + * @author Tom Schneider + * @author BC Holmes + */ +public abstract class SQLResultSetResults extends SQLResults { + + + class ColumnArrayComparator implements Comparator { + + public int compare(Object arg0, Object arg1) { + return compare((Column[]) arg0, (Column[]) arg1); + } + public int compare(Column[] columns0, Column[] columns1) { + + if (columns0 == null && columns1 == null) { + return 0; + } else if (columns0 == null) { + return -1; + } else if (columns1 == null) { + return 1; + } else if (columns0.length < columns1.length) { + return -1; + } else if (columns0.length > columns1.length) { + return 1; + } else { + int result = 0; + for (int i = 0, length = columns1 == null ? 0 : columns1.length; + result == 0 && i < length; i++) { + result = compare(columns0[i], columns1[i]); + } + return result; + } + } + /** + * @param columns0 + * @param columns1 + * @param result + * @param i + * @return + */ + private int compare(Column column0, Column column1) { + + if (column0 == null && column1 == null) { + return 0; + } else if (column0 == null) { + return -1; + } else if (column1 == null) { + return 1; + } else if (column0.getName() == null) { + return -1; + } else if (column1.getName() == null) { + return 1; + } else if (column0.getName() != null && column1.getName() != null + && column0.getName().compareTo(column1.getName()) != 0) { + return column0.getName().compareTo(column1.getName()); + } else if (column0.getType() == null) { + return -1; + } else if (column1.getType() == null) { + return 1; + } else if (column0.getType() != null && column1.getType() != null + && column0.getType().compareTo(column1.getType()) != 0) { + return column0.getType().compareTo(column1.getType()); + } else { + return column0.getSize() - column1.getSize(); + } + } + } + + public class Row { + private final List elements; + + Row(List elements) { + this.elements = elements; + } + + public Object get(int columnNumber) { + return (columnNumber > this.elements.size() || columnNumber <= 0) + ? null + : this.elements.get(columnNumber - 1); + } + + public SQLResultSetResults getResultSet() { + return SQLResultSetResults.this; + } + } + + public class Column { + private final String name; + private final String type; + private final int size; + + Column(String name, String type, int size) { + this.name = name; + this.type = type; + this.size = size; + } + public String getName() { + return this.name; + } + public int getSize() { + return this.size; + } + public String getType() { + return this.type; + } + } + + private List rows = Collections.synchronizedList(new ArrayList()); + private List columns = Collections.synchronizedList(new ArrayList()); + private String query; + private Bookmark bookmark; + private final Entity entity; + private String encoding = ""; + + private FilterSort filterSort = null; + + /** + * @param entity + * @param query2 + */ + public SQLResultSetResults(String query, Bookmark bookmark, Entity entity) { + this.query = query; + this.bookmark = bookmark; + this.entity = entity; + } + public String getColumnName(int columnNumber) { + Column column = getColumn(columnNumber); + return column == null ? "" : column.getName(); + + } + /** + * @param columnNumber + * @return + */ + protected Column getColumn(int columnNumber) { + return columnNumber <= this.columns.size() + ? (Column) this.columns.get(columnNumber-1) + : null; + } + public Column[] getColumns() { + return (Column[]) this.columns.toArray(new Column[this.columns.size()]); + } + protected void setColumns(Column[] columns) { + Column[] original = getColumns(); + if (new ColumnArrayComparator().compare(original, columns) != 0) { + this.columns.clear(); + this.columns.addAll(Arrays.asList(columns)); + this.propertyChangeSupport.firePropertyChange("columns", original, columns); + } + } + public Object getElement(int column, int row) { + return ((Row) rows.get(row - 1)).get(column); + } + public int getColumnCount() { + if (columns.size() > 0) { + return columns.size(); + } + return 0; + } + public int getRowCount() { + return rows.size(); + } + public String[] getColumnNames() { + List names = new ArrayList(); + for (Iterator i = this.columns.iterator(); i.hasNext();) { + Column column = (Column) i.next(); + names.add(column.getName()); + } + return (String[]) names.toArray(new String[names.size()]); + } + /** + * Returns the resultSet. + * @return boolean + */ + public boolean isResultSet() { + return true; + } + public Row[] getRows() { + return (Row[]) rows.toArray(new Row[this.rows.size()]); + } + /** + * Returns the query. + * @return String + */ + public String getQuery() { + return this.query; + } + public String getFilteredQuery() { + if (this.filterSort == null) { + return this.query; + } else { + return this.query + this.filterSort.toString(); + } + } + public Bookmark getBookmark() { + return this.bookmark; + } + + public Entity getEntity() { + return this.entity; + } + /** + * Returns the resultSet. + * @return boolean + */ + public boolean isMetaData() { + return false; + } + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + + public void addPropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.addPropertyChangeListener(listener); + } + public void removePropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.removePropertyChangeListener(listener); + } + protected abstract void parseResultSet(ResultSet set) throws SQLException; + + public void refresh(Connection connection) throws SQLException { + Statement statement = connection.createStatement(); + try { + ResultSet resultSet = statement.executeQuery(getFilteredQuery()); + try { + parseResultSet(resultSet); + } finally { + resultSet.close(); + } + } finally { + statement.close(); + } + } + + protected void setRows(Row[] rows) { + Row[] original = getRows(); + this.rows.clear(); + if (rows != null) { + this.rows.addAll(Arrays.asList(rows)); + } + this.propertyChangeSupport.firePropertyChange("rows", original, getRows()); + } + public String getEncoding() { + return this.encoding; + } + public void setEncoding(String encoding) { + this.encoding = encoding; + } + public FilterSort getFilterSort() { + return this.filterSort; + } + public void setFilterSort(FilterSort filterSort) { + this.filterSort = filterSort; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResults.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResults.java index 44b67ed..28325e7 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResults.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLResults.java @@ -1,145 +1,19 @@ package com.quantum.sql; -import java.util.ArrayList; -import java.util.Vector; -/** - * com.quantum project - * @author root - * -*/ -public class SQLResults { - private String query; - private String table; - private ArrayList rows = new ArrayList(); - private Vector columns; - private Vector columnTypes; - private int[] columnSizes; - private int updateCount = 0; - private boolean resultSet = false; - private boolean hasMore = false; - private boolean isError = false; - private int maxSize = -1; - private long time; - - public void setColumnNames(Vector columns) { - this.columns = columns; - } - public String getColumnName(int column) { - if (columns.size() < column) return ""; //$NON-NLS-1$ - return columns.elementAt(column - 1).toString(); - - } - public void setColumnTypes(Vector columnsTypes) { - this.columnTypes = columnsTypes; - } - public String getColumnType(int column) { - if (columnTypes.size() < column) return ""; //$NON-NLS-1$ - return columnTypes.elementAt(column - 1).toString(); - } - public void setColumnSizes(int[] columnSizes) { - this.columnSizes = columnSizes; - } - public int getColumnSize(int column) { - if (columnSizes.length < column) return 0; - return columnSizes[column - 1]; - } - public void addRow(Vector row) { - rows.add(row); - } - public Object getElement(int column, int row) { - return ((Vector) rows.get(row - 1)).elementAt(column - 1); - } - public int getColumnCount() { - if (columns.size() > 0) { - return columns.size(); - } - return 0; - } - public int getRowCount() { - return rows.size(); - } - /** - * Returns the query. - * @return String - */ - public String getQuery() { - return query; - } - - /** - * Sets the query. - * @param query The query to set - */ - public void setQuery(String query) { - this.query = query; - } - - /** - * Returns the resultSet. - * @return boolean - */ - public boolean isResultSet() { - return resultSet; - } - - /** - * Sets the resultSet. - * @param resultSet The resultSet to set - */ - public void setResultSet(boolean resultSet) { - this.resultSet = resultSet; - } - - public int getUpdateCount() { - return updateCount; - } - public void setUpdateCount(int updateCount) { - this.updateCount = updateCount; - } - - public String getTable() { - return table; - } - - public void setTable(String table) { - this.table = table; - } - - public boolean hasMore() { - return hasMore; - } - - public void setHasMore(boolean hasMore) { - this.hasMore = hasMore; - } - - public int getMaxSize() { - return maxSize; - } - - public void setMaxSize(int maxSize) { - this.maxSize = maxSize; - } - - public boolean isError() { - return isError; - } +/** + * @author BC + */ +public abstract class SQLResults { + public abstract boolean isResultSet(); - public void setIsError(boolean isError) { - this.isError = isError; - } - /** - * - */ - public Object[] getRows() { - return rows.toArray(); - } + private long time; public long getTime() { return this.time; } + public void setTime(long time) { this.time = time; } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLStandardResultSetResults.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLStandardResultSetResults.java new file mode 100644 index 0000000..7358b26 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLStandardResultSetResults.java @@ -0,0 +1,284 @@ +package com.quantum.sql; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.io.UnsupportedEncodingException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import com.quantum.model.Bookmark; +import com.quantum.model.Entity; + + +/** + * @author BC + */ +public class SQLStandardResultSetResults extends SQLResultSetResults implements Scrollable { + + /** + * Some columns -- especially BLOBS and CLOBS can be very wide. This variable + * sets the maximum width of the column. + */ + private static final int MAX_COLUMN_WIDTH = 1024 * 2; + + private boolean hasMore = false; + private int start = 1; + private int numberOfRowsPerPage; + private int totalNumberOfRows = -1; + + private boolean fullMode = false; + + /** + * @param bookmark + * @param query + * @param encoding + * @param numberOfRowsPerPage + */ + protected SQLStandardResultSetResults( + Bookmark bookmark, String query, Entity entity, + int numberOfRowsPerPage) { + super(query, bookmark, entity); + this.numberOfRowsPerPage = numberOfRowsPerPage; + } + + static SQLResultSetResults create( + ResultSet set, Bookmark bookmark, + String query, Entity entity, int numberOfRows) throws SQLException { + + SQLStandardResultSetResults results = new SQLStandardResultSetResults( + bookmark, query, entity, numberOfRows); + + results.parseResultSet(set); + + return results; + } + + /** + * @param set + * @param encoding + * @param numberOfRows + * @param results + * @param columnCount + * @throws SQLException + */ + protected void parseResultSet(ResultSet set) throws SQLException { + int rowCount = 1; + + ResultSetMetaData metaData = set.getMetaData(); + int columnCount = metaData.getColumnCount(); + List columns = new ArrayList(); + for (int i = 1; i <= columnCount; i++) { + columns.add(new Column( + metaData.getColumnName(i), + metaData.getColumnTypeName(i), + metaData.getColumnDisplaySize(i))); + } + setColumns((Column[]) columns.toArray(new Column[columns.size()])); + + boolean exitEarly = false; + int firstRow = (this.fullMode) ? 0 : this.start; + int lastRow = (this.fullMode) ? Integer.MAX_VALUE : this.start + this.numberOfRowsPerPage - 1; + List rowList = new ArrayList(); + while (set.next()) { + boolean disable = this.start < 1 || lastRow < 1; + if (disable || ((rowCount >= firstRow) && (rowCount <= lastRow))) { + List row = new ArrayList(); + for (int i = 1, length = columns.size(); i <= length; i++) { + String value = null; + if (getColumn(i).getSize() < MAX_COLUMN_WIDTH) { + value = getEncodedString(set, getEncoding(), i); + } else { + try { + if ("".equals(getEncoding())) { //$NON-NLS-1$ + value = getStringFromCharacterSteam(set, i); + } else { + value = getEncodedStringFromBinaryStream(set, getEncoding(), i); + } + } catch (IOException e) { + value = set.getString(i); + } catch (RuntimeException e) { + // hack for mysql which doesn't implement + // character streams + value = set.getString(i); + } + } + if (value == null) { + value = set.getString(i); + } + row.add(value == null || set.wasNull() ? "" : value); //$NON-NLS-1$ + } + rowList.add(new Row(row)); + } + rowCount++; + if (!disable && (rowCount > lastRow)) { + exitEarly = true; + break; + } + } + if (exitEarly) { + this.hasMore = set.next(); + } else { + this.totalNumberOfRows = Math.max(0, rowCount-1); + this.hasMore = false; + } + setRows((Row[]) rowList.toArray(new Row[rowList.size()])); + } + + + /** + * @param set + * @param encoding + * @param columnNumber + * @throws SQLException + * @throws IOException + * @throws UnsupportedEncodingException + */ + private String getEncodedStringFromBinaryStream(ResultSet set, String encoding, int columnNumber) + throws SQLException, IOException, UnsupportedEncodingException { + InputStream binaryStream = set.getBinaryStream(columnNumber); + if (binaryStream != null) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + for (int c = binaryStream.read(), count = 0; + c >= 0 && count <= MAX_COLUMN_WIDTH; + c = binaryStream.read(), count++) { + baos.write(c); + } + } finally { + binaryStream.close(); + } + return new String(baos.toByteArray(), encoding); + } else { + return null; + } + } + + + /** + * @param set + * @param columnNumber + * @throws SQLException + * @throws IOException + */ + private String getStringFromCharacterSteam(ResultSet set, int columnNumber) + throws SQLException, IOException { + Reader reader = set.getCharacterStream(columnNumber); + if (reader != null) { + StringBuffer buffer = new StringBuffer(); + int retVal = reader.read(); + int count = 0; + while (retVal >= 0) { + buffer.append((char) retVal); + retVal = reader.read(); + count++; + if (count > MAX_COLUMN_WIDTH) { + buffer.append("...>>>"); //$NON-NLS-1$ + break; + } + } + reader.close(); + return buffer.toString(); + } else { + return null; + } + } + + + /** + * @param set + * @param encoding + * @param index + * @return + * @throws SQLException + */ + private String getEncodedString(ResultSet set, String encoding, int index) + throws SQLException { + try { + return encoding == null || encoding.trim().length() == 0 + ? set.getString(index) + : new String(set.getBytes(index), encoding); + } catch (UnsupportedEncodingException e) { + return set.getString(index); + } + } + + public boolean hasMore() { + return this.hasMore; + } + + public int getTotalNumberOfRows() { + return this.totalNumberOfRows; + } + public void nextPage(Connection connection) throws SQLException { + if (hasNextPage()) { + this.start += this.numberOfRowsPerPage; + refresh(connection); + } + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#previousPage(java.sql.Connection) + */ + public void previousPage(Connection connection) throws SQLException { + if (hasPreviousPage()) { + this.start = Math.max(1, this.start - this.numberOfRowsPerPage); + refresh(connection); + } + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#hasNextPage() + */ + public boolean hasNextPage() { + return this.hasMore; + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#hasPreviousPage() + */ + public boolean hasPreviousPage() { + return this.start > 1; + } + + public void setFullMode(boolean fullMode) { + this.fullMode = fullMode; + } + public boolean isFullMode() { + return this.fullMode; + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#getStart() + */ + public int getStart() { + return getRowCount() == 0 ? 0 : (this.fullMode ? 1 : this.start); + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#getEnd() + */ + public int getEnd() { + return this.fullMode + ? getRowCount() + : this.start + getRowCount() - 1; + } + + /* (non-Javadoc) + * @see com.quantum.sql.Scrollable#getLast() + */ + public int getLast() { + return this.totalNumberOfRows; + } + + + public void setFilterSort(FilterSort filterSort) { + super.setFilterSort(filterSort); + this.start = 1; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLUpdateResults.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLUpdateResults.java new file mode 100644 index 0000000..4ba3f52 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/SQLUpdateResults.java @@ -0,0 +1,21 @@ +package com.quantum.sql; + + +/** + * @author BC + */ +public class SQLUpdateResults extends SQLResults { + private int updateCount = 0; + + public SQLUpdateResults(int updateCount) { + this.updateCount = updateCount; + } + + public int getUpdateCount() { + return this.updateCount; + } + + public boolean isResultSet() { + return false; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/Scrollable.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/Scrollable.java new file mode 100644 index 0000000..6068ca0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/Scrollable.java @@ -0,0 +1,20 @@ +package com.quantum.sql; + +import java.sql.Connection; +import java.sql.SQLException; + + +/** + * @author BC + */ +public interface Scrollable { + public void nextPage(Connection connection) throws SQLException; + public void previousPage(Connection connection) throws SQLException; + public boolean hasNextPage(); + public boolean hasPreviousPage(); + public void setFullMode(boolean fullMode); + public boolean isFullMode(); + public int getStart(); + public int getEnd(); + public int getLast(); +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQL.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQL.java new file mode 100644 index 0000000..99972eb --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQL.java @@ -0,0 +1,16 @@ +package com.quantum.sql.parser; + + +/** + * @author BC + */ +public interface SQL { + + /** + * The command describes the type of SQL statement that is represented. The command + * might be "SELECT" or "ALTER TABLE" or "GRANT" + * + * @return + */ + public String getCommand(); +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLParser.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLParser.java new file mode 100644 index 0000000..4bb97cb --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLParser.java @@ -0,0 +1,59 @@ +package com.quantum.sql.parser; + +import java.util.Vector; + + +public class SQLParser { + + /** + * Parses a query string into executable units. + * @param query + * @return a Vector of Strings, with the individual executable units. + */ + public static Vector parse(String query) { + Vector commands = new Vector(); + Vector groups = new Vector(); + try { + Vector tokens = SQLLexx.parse(query); + StringBuffer buffer = new StringBuffer(); + StringBuffer groupBuffer = new StringBuffer(); + for (int i = 0; i < tokens.size(); i++) { + Token t = (Token) tokens.elementAt(i); + if (t.getType() == Token.COMMENT) { + // ignore comments + } else if (t.getType() == Token.SEPARATOR) { + groupBuffer.append(t.getValue()); + String newCommand = buffer.toString().trim(); + if (!newCommand.equals("")) { //$NON-NLS-1$ + commands.addElement(newCommand); + } + buffer = new StringBuffer(); + } else if (t.getType() == Token.GROUP) { + // We don't append the group token because it may be misinterpreted + //groupBuffer.append(t.getValue()); + String newGroup = groupBuffer.toString().trim(); + if (!newGroup.equals("")) { //$NON-NLS-1$ + groups.addElement(newGroup); + //Groups have precedence over commands, so the preceding commands are erased + commands.clear(); + } + groupBuffer = new StringBuffer(); + } else { + // We append the tokens to the buffer until it's a separator or group. + buffer.append(t.getValue()); + groupBuffer.append(t.getValue()); + } + } + String newCommand = buffer.toString().trim(); + if (!newCommand.equals("")) { //$NON-NLS-1$ + commands.addElement(newCommand); + } + } catch (Throwable e) { + e.printStackTrace(); + } + Vector result = new Vector(); + result.addAll(groups); + result.addAll(commands); + return result; + } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLScript.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLScript.java new file mode 100644 index 0000000..a6b397a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/sql/parser/SQLScript.java @@ -0,0 +1,12 @@ +package com.quantum.sql.parser; + + +/** + * @author BC + */ +public class SQLScript { + + public SQL[] getSQLStatements() { + return null; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ui/dialog/SimpleSelectionDialog.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ui/dialog/SimpleSelectionDialog.java index ad76c71..6b569d7 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ui/dialog/SimpleSelectionDialog.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/ui/dialog/SimpleSelectionDialog.java @@ -119,9 +119,9 @@ public class SimpleSelectionDialog extends Dialog { style |= SWT.MULTI; } this.viewer = new TableViewer(composite, style); - GridData full = new GridData(GridData.FILL_HORIZONTAL); - full.widthHint = 200; - full.heightHint = 50; + GridData full = new GridData(GridData.FILL_BOTH); + full.widthHint = 300; + full.heightHint = 100; this.viewer.getControl().setLayoutData(full); this.viewer.setLabelProvider(new LabelProvider()); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/JarUtil.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/JarUtil.java index 2519891..528221e 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/JarUtil.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/JarUtil.java @@ -21,10 +21,10 @@ public class JarUtil { private static Hashtable classLoaderCache = new Hashtable(); - public static Driver loadDriver(String driverFile, String className) { + public static Driver loadDriver(String[] driverFiles, String className) { Driver result = null; try { - Class driverClass = loadDriverClass(driverFile, className); + Class driverClass = loadDriverClass(driverFiles, className); if (driverClass != null) { try { result = (Driver) driverClass.newInstance(); @@ -33,51 +33,100 @@ public class JarUtil { } } catch (InstantiationException e) { } catch (IllegalAccessException e) { + } catch (NoClassDefFoundError e) { + } catch (RuntimeException e) { } return result; } - public static Class loadDriverClass(String driverFile, String className) { + public static Class loadDriverClass(String[] driverFiles, String className) { Class result = null; - if (driverFile != null && className != null) { + if (driverFiles != null && driverFiles.length > 0 + && driverFiles[0].trim().length() > 0 && className != null) { try { - File file = new File(driverFile); - if (file.exists() && file.isFile()) { - URLClassLoader loader = getURLClassLoader(file); - Class driverClass = loader.loadClass(className); - result = Driver.class.isAssignableFrom(driverClass) ? driverClass : null; - } + File[] files = getFiles(driverFiles); + URLClassLoader loader = getURLClassLoader(files); + result = loadDriverClass(className, loader); } catch (MalformedURLException e) { } catch (ClassNotFoundException e) { + } catch (NoClassDefFoundError e) { + } catch (RuntimeException e) { + } + } else if (className != null) { + try { + result = loadDriverClass(className, JarUtil.class.getClassLoader()); + } catch (ClassNotFoundException e) { + } catch (NoClassDefFoundError e) { + } catch (RuntimeException e) { } } return result; } - public static String[] getAllDriverNames(String driverFile) { + /** + * @param driverFiles + * @return + */ + private static File[] getFiles(String[] driverFiles) { + List list = new ArrayList(); + + for (int i = 0, length = driverFiles == null ? 0 : driverFiles.length; i < length; i++) { + File file = new File(driverFiles[i]); + if (file.exists() && file.isFile()) { + list.add(file); + } + } + return (File[]) list.toArray(new File[list.size()]); + } + + /** + * @param className + * @param loader + * @return + * @throws ClassNotFoundException + */ + private static Class loadDriverClass(String className, ClassLoader loader) throws ClassNotFoundException { + Class driverClass = loader.loadClass(className); + return Driver.class.isAssignableFrom(driverClass) ? driverClass : null; + } + + public static String[] getAllDriverNames(String[] driverFile) { List list = new ArrayList(); try { - File file = new File(driverFile); - URLClassLoader loader = getURLClassLoader(file); - JarFile jar = new JarFile(file); - for (Enumeration e = jar.entries(); e.hasMoreElements(); ) { - JarEntry entry = (JarEntry) e.nextElement(); - String className = getClassNameFromFileName(entry.getName()); - if (className != null) { - try { - Class driverClass = loader.loadClass(className); - if (Driver.class.isAssignableFrom(driverClass)) { - list.add(className); - } - } catch (ClassNotFoundException ex) { - } - } + File[] files = getFiles(driverFile); + URLClassLoader loader = getURLClassLoader(files); + for (int i = 0, length = files == null ? 0 : files.length; i < length; i++) { + JarFile jar = new JarFile(files[i]); + addCandidateDriversToList(list, loader, jar); } } catch (IOException e) { } return (String[]) list.toArray(new String[list.size()]); } + /** + * @param list + * @param loader + * @param jar + */ + private static void addCandidateDriversToList(List list, URLClassLoader loader, JarFile jar) { + for (Enumeration e = jar.entries(); e.hasMoreElements(); ) { + JarEntry entry = (JarEntry) e.nextElement(); + String className = getClassNameFromFileName(entry.getName()); + if (className != null) { + try { + Class driverClass = loadDriverClass(className, loader); + if (driverClass != null) { + list.add(className); + } + } catch (NoClassDefFoundError ex) { + } catch (ClassNotFoundException ex) { + } catch (RuntimeException ex) { + } + } + } + } + private static String getClassNameFromFileName(String name) { String result = null; if (name.endsWith(".class")) { @@ -91,16 +140,36 @@ public class JarUtil { * @return * @throws MalformedURLException */ - private static URLClassLoader getURLClassLoader(File file) throws MalformedURLException { - String driverFile = file.getAbsolutePath(); + private static URLClassLoader getURLClassLoader(File[] files) throws MalformedURLException { + + String driverPath = getFilePath(files); URLClassLoader loader = - (URLClassLoader) classLoaderCache.get(driverFile); + (URLClassLoader) classLoaderCache.get(driverPath); if (loader == null) { - URL urls[] = new URL[1]; - urls[0] = file.toURL(); - loader = new URLClassLoader(urls); - classLoaderCache.put(driverFile, loader); + URL urls[] = new URL[files == null ? 0 : files.length]; + for (int i = 0, length = urls.length; i < length; i++) { + urls[i] = files[i].toURL(); + } + loader = urls.length > 0 ? new URLClassLoader(urls) : null; + if (loader != null) { + classLoaderCache.put(driverPath, loader); + } } return loader; } + + /** + * @param files + * @return + */ + private static String getFilePath(File[] files) { + StringBuffer buffer = new StringBuffer(); + for (int i = 0, length = files == null ? 0 : files.length; i < length; i++) { + buffer.append(files[i].getAbsolutePath()); + if (i < length-1) { + buffer.append(File.pathSeparator); + } + } + return buffer.toString(); + } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/StringArrayComparator.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/StringArrayComparator.java new file mode 100644 index 0000000..951285f --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/StringArrayComparator.java @@ -0,0 +1,45 @@ +package com.quantum.util; + +import java.util.Comparator; + + +/** + * @author BC + */ +public class StringArrayComparator implements Comparator { + + public int compare(Object arg0, Object arg1) { + return compare((String[]) arg0, (String[]) arg1); + } + + public int compare(String[] arg0, String[] arg1) { + if (arg0 == null && arg1 == null) { + return 0; + } else if (arg0 == null) { + return -1; + } else if (arg1 == null) { + return 1; + } else if (arg0.length != arg1.length) { + return arg0.length - arg1.length; + } else { + int result = 0; + for (int i = 0, length = arg0 == null ? 0 : arg0.length; + result == 0 && i < length; i++) { + result = compare(arg0[i], arg1[i]); + } + return result; + } + } + + private int compare(String arg0, String arg1) { + if (arg0 == null && arg1 == null) { + return 0; + } else if (arg0 == null) { + return -1; + } else if (arg1 == null) { + return 1; + } else { + return arg0.compareTo(arg1); + } + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java index feed61e..2b39182 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/util/sql/TypesHelper.java @@ -87,4 +87,34 @@ public class TypesHelper { return name; } + /** + * True if the type is Real (numeric and with decimal part) according to java.sql.Types + * @param type + * @return + */ + public static boolean isReal(int type) { + return (type == DECIMAL || type == DOUBLE || type == FLOAT || + type == NUMERIC || type == REAL ); + } + + /** + * True if the type is Numeric according to java.sql.Types + * @param type + * @return + */ + public static boolean isNumeric(int type) { + return (type == DECIMAL || type == DOUBLE || type ==FLOAT || + type == NUMERIC || type == REAL || type == BIGINT || + type == TINYINT || type == SMALLINT || type == INTEGER ); + } + + /** + * True if the type is textual according to java.sql.Types + * @param type + * @return + */ + public static boolean isText(int type) { + return (type == CLOB || type == VARBINARY || type ==VARCHAR + || type == CHAR || type == LONGVARCHAR ); + } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/JDBCDriverTableViewer.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/JDBCDriverTableViewer.java index 8eb4bf1..63014c0 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/JDBCDriverTableViewer.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/JDBCDriverTableViewer.java @@ -60,7 +60,7 @@ public class JDBCDriverTableViewer implements PropertyChangeListener, ISelection result = ((JDBCDriver) element).getVersion(); break; case 4: - result = ((JDBCDriver) element).getJarFileName(); + result = ((JDBCDriver) element).getJarFilePath(); break; default: } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/ViewHelper.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/ViewHelper.java index e460e44..252c0a8 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/ViewHelper.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/ViewHelper.java @@ -12,6 +12,7 @@ import java.sql.SQLException; import com.quantum.Messages; import com.quantum.QuantumPlugin; +import com.quantum.model.Bookmark; import com.quantum.sql.MultiSQLServer; import com.quantum.sql.SQLResults; @@ -27,23 +28,22 @@ import org.eclipse.ui.IViewPart; */ public class ViewHelper { - public static SQLResults tryGetResults(IViewPart view, Connection con, String query) { - return tryGetResults(view.getSite().getShell(), con, query); + /** @deprecated */ + public static SQLResults tryGetResults(IViewPart view, Bookmark bookmark, Connection con, String query) { + return tryGetResults(view.getSite().getShell(), bookmark, con, query); } - public static SQLResults tryGetResults(Shell shell, Connection con, String query) { - SQLResults results = null; - MultiSQLServer server = MultiSQLServer.getInstance(); + /** @deprecated */ + public static SQLResults tryGetResults(Shell shell, Bookmark bookmark, Connection con, String query) { try { - results = server.execute(con, query); + MultiSQLServer server = MultiSQLServer.getInstance(); + return server.execute(bookmark, con, query); } catch (SQLException e) { LogProxy log = LogProxy.getInstance(); log.addText(LogProxy.ERROR, e.getLocalizedMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$ - results = new SQLResults(); - results.setIsError(true); MessageDialog.openConfirm(shell, "Database returned error", e.getLocalizedMessage()); //$NON-NLS-1$ + return null; } - return results; } public static FileOutputStream askSaveFile(String key, Shell shell) { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java index 8b9825e..e3bf412 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/bookmark/TreeNode.java @@ -61,7 +61,7 @@ public abstract class TreeNode */ public int compareTo(Object object) { TreeNode that = (TreeNode) object; - return this.getLabelName().compareTo(that.getLabelName()); + return this.getLabelName().toLowerCase().compareTo(that.getLabelName().toLowerCase()); } public String toString() { diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/DeleteDriverAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/DeleteDriverAction.java new file mode 100644 index 0000000..324ff6d --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/DeleteDriverAction.java @@ -0,0 +1,86 @@ +package com.quantum.view.driver; + +import java.util.List; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.model.Bookmark; +import com.quantum.model.BookmarkCollection; +import com.quantum.model.JDBCDriver; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.actions.SelectionListenerAction; + +/** + * This action deletes JDBC Drivers from the JDBC Driver collection. + * + * @author BC Holmes + */ +public class DeleteDriverAction extends SelectionListenerAction { + + private final IViewPart viewPart; + + /** + * @param text + */ + protected DeleteDriverAction(IViewPart viewPart, ISelectionProvider selectionProvider) { + super(Messages.getString(DeleteDriverAction.class, "text")); + this.viewPart = viewPart; + selectionProvider.addSelectionChangedListener(this); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.DELETE)); + } + + public void run() { + JDBCDriver driver = getJDBCDriver(); + + if (driver != null) { + Bookmark[] bookmarks = BookmarkCollection.getInstance().getBookmarks(); + boolean found = false; + for (int i = 0, length = bookmarks == null ? 0 : bookmarks.length; + driver != null && !found && i < length; i++) { + found |= driver.equals(bookmarks[i].getJDBCDriver()); + } + + if (found) { + MessageDialog.openWarning(getShell(), + Messages.getString(DeleteDriverAction.class, "failed"), + Messages.getString(DeleteDriverAction.class, "inUse")); + } else { + if (MessageDialog.openConfirm(getShell(), + Messages.getString(DeleteDriverAction.class, "confirm"), + Messages.getString(DeleteDriverAction.class, "confirmText", + new Object[] { driver.getName() }))) { + + if (!BookmarkCollection.getInstance().removeDriver(driver)) { + MessageDialog.openWarning(getShell(), + Messages.getString(DeleteDriverAction.class, "failed"), + Messages.getString(DeleteDriverAction.class, "cant")); + } + } + } + } + } + + /** + * @return + */ + private Shell getShell() { + return this.viewPart.getViewSite().getShell(); + } + + /** + * @return + */ + private JDBCDriver getJDBCDriver() { + List list = getSelectedNonResources(); + return list == null || list.size() == 0 ? null : (JDBCDriver) list.get(0); + } + + protected boolean updateSelection(IStructuredSelection selection) { + return selection != null && !selection.isEmpty(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverView.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverView.java new file mode 100644 index 0000000..c5210f0 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverView.java @@ -0,0 +1,45 @@ +package com.quantum.view.driver; + + +import com.quantum.view.JDBCDriverTableViewer; + +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.part.ViewPart; + + +/** + * @author BC + */ +public class JDBCDriverView extends ViewPart { + + private JDBCDriverTableViewer viewer; + private JDBCDriverViewActionGroup actionGroup; + + public void createPartControl(Composite parent) { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + parent.setLayout(layout); + this.viewer = new JDBCDriverTableViewer(parent); + this.viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); + + initActions(); + } + + public void initActions() { + + this.actionGroup = new JDBCDriverViewActionGroup(this, this.viewer); + + IActionBars actionBars = getViewSite().getActionBars(); + this.actionGroup.fillActionBars(actionBars); + } + + public void setFocus() { + } + public void dispose() { + this.viewer.dispose(); + super.dispose(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverViewActionGroup.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverViewActionGroup.java new file mode 100644 index 0000000..a9b4590 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/driver/JDBCDriverViewActionGroup.java @@ -0,0 +1,25 @@ +package com.quantum.view.driver; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.actions.ActionGroup; +import org.eclipse.ui.actions.SelectionListenerAction; + + +/** + * @author BC Holmes + */ +class JDBCDriverViewActionGroup extends ActionGroup { + + private SelectionListenerAction deleteAction; + + public JDBCDriverViewActionGroup(JDBCDriverView view, ISelectionProvider selectionProvider) { + this.deleteAction = new DeleteDriverAction(view, selectionProvider); + } + + public void fillActionBars(IActionBars actionBars) { + actionBars.setGlobalActionHandler( + IWorkbenchActionConstants.DELETE, this.deleteAction); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ChangeEncodingAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ChangeEncodingAction.java new file mode 100644 index 0000000..713f980 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ChangeEncodingAction.java @@ -0,0 +1,39 @@ +package com.quantum.view.tableview; + +import java.sql.SQLException; + +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.ui.IViewPart; + + +/** + * @author BC + */ +public class ChangeEncodingAction extends ResultSetAction { + + private final String encoding; + + /** + * @param view + * @param selectionProvider + */ + public ChangeEncodingAction(IViewPart view, ISelectionProvider selectionProvider, String encoding, String key) { + super(view, selectionProvider); + this.encoding = encoding; + setText(Messages.getString(getClass(), key)); + setToolTipText(Messages.getString(getClass(), key)); + } + + /* (non-Javadoc) + * @see com.quantum.view.tableview.ResultSetAction#executeResultSetAction(com.quantum.sql.SQLResultSetResults) + */ + protected void executeResultSetAction(SQLResultSetResults results) + throws SQLException { + results.setEncoding(this.encoding); + results.refresh(getConnection(results)); + } + +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseAllResultSetsAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseAllResultSetsAction.java new file mode 100644 index 0000000..af300bf --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseAllResultSetsAction.java @@ -0,0 +1,44 @@ +package com.quantum.view.tableview; + + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.util.versioning.VersioningHelper; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.actions.SelectionListenerAction; + +/** + * @author root + * + */ +public class CloseAllResultSetsAction extends SelectionListenerAction { + private final ISelectionProvider selectionProvider; + /** + * @param text + */ + public CloseAllResultSetsAction(IViewPart view, ISelectionProvider selectionProvider) { + super("Close All"); + this.selectionProvider = selectionProvider; + this.selectionProvider.addSelectionChangedListener(this); + setEnabled(!this.selectionProvider.getSelection().isEmpty()); + + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.CLOSE_ALL)); + if (VersioningHelper.isEclipse30()) { + setDisabledImageDescriptor(ImageStore.getImageDescriptor(ImageStore.CLOSE_ALL_DISABLED)); + } + setText(Messages.getString(getClass(), "text")); + setToolTipText(Messages.getString(getClass(), "text")); + } + + public void run() { + SQLResultSetCollection.getInstance().removeAllSQLResultSet(); + } + + public boolean updateSelection(IStructuredSelection selection) { + return !selection.isEmpty(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseResultSetAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseResultSetAction.java new file mode 100644 index 0000000..facbea1 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CloseResultSetAction.java @@ -0,0 +1,54 @@ +package com.quantum.view.tableview; + + +import java.util.Iterator; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.util.versioning.VersioningHelper; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.actions.SelectionListenerAction; + +/** + * @author root + * @author BC Holmes + */ +public class CloseResultSetAction extends SelectionListenerAction { + + private final ISelectionProvider selectionProvider; + + /** + * @param text + */ + public CloseResultSetAction(IViewPart view, ISelectionProvider selectionProvider) { + super(""); + this.selectionProvider = selectionProvider; + this.selectionProvider.addSelectionChangedListener(this); + setEnabled(!this.selectionProvider.getSelection().isEmpty()); + + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.CLOSE)); + if (VersioningHelper.isEclipse30()) { + setDisabledImageDescriptor(ImageStore.getImageDescriptor(ImageStore.CLOSE_DISABLED)); + } + setToolTipText(Messages.getString(getClass(), "text")); + } + + public void run() { + IStructuredSelection selection = + (IStructuredSelection) this.selectionProvider.getSelection(); + if (!selection.isEmpty()) { + for (Iterator i = selection.iterator(); i.hasNext(); ) { + SQLResultSetCollection.getInstance().removeSQLResultSet((SQLResultSetResults) i.next()); + } + } + } + + public boolean updateSelection(IStructuredSelection selection) { + return !selection.isEmpty(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CopyAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CopyAction.java new file mode 100644 index 0000000..3de9c5c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/CopyAction.java @@ -0,0 +1,54 @@ +/* + * Created on 28-jul-2003 + * + */ +package com.quantum.view.tableview; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.QuantumPlugin; + +import org.eclipse.jface.action.Action; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; + + +public final class CopyAction extends Action { + + private static final String LINE_SEPARATOR = System.getProperty("line.separator"); + + private final TableView view; + + public CopyAction(TableView view) { + super(); + this.view = view; + setText(Messages.getString(getClass(), "text")); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.COPY)); + } + + public void run() { + Table table = getTable(); + if (table != null) { + TableItem items[] = table.getSelection(); + StringBuffer text = new StringBuffer(); + for (int i = 0; i < items.length; i++) { + int columns = table.getColumnCount(); + for (int col = 0; col < columns; col++) { + text.append(items[i].getText(col)); + text.append('\t'); + } + text.append(LINE_SEPARATOR); + } + QuantumPlugin.getDefault().getSysClip().setContents( + new Object[] { text.toString()}, + new Transfer[] { TextTransfer.getInstance()}); + } + } + + private Table getTable() { + ResultSetViewer viewer = this.view.getSelectedResultSetViewer(); + return viewer == null ? null : viewer.getTable(); + } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/FullModeAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/FullModeAction.java new file mode 100644 index 0000000..9c3c26c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/FullModeAction.java @@ -0,0 +1,41 @@ +package com.quantum.view.tableview; + +import java.sql.SQLException; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.Scrollable; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; + + +/** + * @author BC + */ +public class FullModeAction extends ResultSetAction { + + /** + * @param view + * @param selectionProvider + */ + public FullModeAction(IViewPart view, ISelectionProvider selectionProvider) { + super(view, selectionProvider); + setText(Messages.getString(getClass(), "text")); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.FULLDATA)); + setToolTipText(Messages.getString(getClass(), "text")); + } + + protected void executeResultSetAction(SQLResultSetResults results) throws SQLException { + ((Scrollable) results).setFullMode(!((Scrollable) results).isFullMode()); + results.refresh(getConnection(results)); + } + + + protected boolean updateSelection(IStructuredSelection selection) { + return super.updateSelection(selection) + && (selection.getFirstElement() instanceof Scrollable); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/NextPageAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/NextPageAction.java new file mode 100644 index 0000000..75693d9 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/NextPageAction.java @@ -0,0 +1,81 @@ +package com.quantum.view.tableview; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.sql.SQLException; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.Scrollable; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; + + +/** + * @author BC + */ +public class NextPageAction extends ResultSetAction implements PropertyChangeListener { + + private SQLResultSetResults resultSet; + + public NextPageAction(IViewPart view, ISelectionProvider selectionProvider) { + super(view, selectionProvider); + setText(Messages.getString(getClass(), "text")); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.NEXT)); + setToolTipText(Messages.getString(getClass(), "text")); + setEnabled(hasNextPage((IStructuredSelection) selectionProvider.getSelection())); + } + + protected void executeResultSetAction(SQLResultSetResults results) throws SQLException { + if (results instanceof Scrollable) { + ((Scrollable) results).nextPage(getConnection(results)); + } + } + protected boolean updateSelection(IStructuredSelection selection) { + setResultSet(getResultSet(selection)); + return hasNextPage(selection); + } + + /** + * @param srollable + */ + private void setResultSet(SQLResultSetResults results) { + if (this.resultSet != null) { + this.resultSet.removePropertyChangeListener(this); + } + + this.resultSet = results; + if (results != null) { + this.resultSet.addPropertyChangeListener(this); + } + } + + /** + * @param selection + */ + private SQLResultSetResults getResultSet(IStructuredSelection selection) { + return (selection != null && !selection.isEmpty() && + (selection.getFirstElement() instanceof SQLResultSetResults)) + ? (SQLResultSetResults) selection.getFirstElement() + : null; + } + + /** + * @param selection + * @return + */ + private boolean hasNextPage(IStructuredSelection selection) { + return !selection.isEmpty() && + (selection.getFirstElement() instanceof Scrollable) && + ((Scrollable) selection.getFirstElement()).hasNextPage(); + } + + public void propertyChange(PropertyChangeEvent event) { + if ("rows".equals(event.getPropertyName())) { + setEnabled(hasNextPage(getStructuredSelection())); + } + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/PreviousPageAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/PreviousPageAction.java new file mode 100644 index 0000000..25ebe0a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/PreviousPageAction.java @@ -0,0 +1,82 @@ +package com.quantum.view.tableview; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.sql.SQLException; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.Scrollable; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.IViewPart; + + +/** + * @author BC + */ +public class PreviousPageAction extends ResultSetAction implements PropertyChangeListener { + + private SQLResultSetResults resultSet; + + public PreviousPageAction(IViewPart view, ISelectionProvider selectionProvider) { + super(view, selectionProvider); + setText(Messages.getString(getClass(), "text")); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.PREVIOUS)); + setToolTipText(Messages.getString(getClass(), "text")); + setEnabled(hasPreviousPage((IStructuredSelection) selectionProvider.getSelection())); + } + + protected void executeResultSetAction(SQLResultSetResults results) throws SQLException { + if (results instanceof Scrollable) { + ((Scrollable) results).previousPage(getConnection(results)); + } + } + protected boolean updateSelection(IStructuredSelection selection) { + setResultSet(getResultSet(selection)); + return hasPreviousPage(selection); + } + + /** + * @param srollable + */ + private void setResultSet(SQLResultSetResults results) { + if (this.resultSet != null) { + this.resultSet.removePropertyChangeListener(this); + } + + this.resultSet = results; + if (results != null) { + this.resultSet.addPropertyChangeListener(this); + } + } + + /** + * @param selection + */ + private SQLResultSetResults getResultSet(IStructuredSelection selection) { + return (selection != null && !selection.isEmpty() && + (selection.getFirstElement() instanceof SQLResultSetResults)) + ? (SQLResultSetResults) selection.getFirstElement() + : null; + } + + /** + * @param selection + * @return + */ + private boolean hasPreviousPage(IStructuredSelection selection) { + return !selection.isEmpty() && + (selection.getFirstElement() instanceof Scrollable) && + ((Scrollable) selection.getFirstElement()).hasPreviousPage(); + } + + public void propertyChange(PropertyChangeEvent event) { + if ("rows".equals(event.getPropertyName())) { + setEnabled(hasPreviousPage(getStructuredSelection())); + } + } + +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/RefreshTableAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/RefreshTableAction.java new file mode 100644 index 0000000..1a8e2d4 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/RefreshTableAction.java @@ -0,0 +1,33 @@ +package com.quantum.view.tableview; + +import java.sql.SQLException; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.ui.IViewPart; + +/** + * Implements the "Refresh Table" action for the TableView view + * + * @author root + */ +public class RefreshTableAction extends ResultSetAction { + + /** + * @param view + * @param selectionProvider + */ + public RefreshTableAction(IViewPart view, ISelectionProvider selectionProvider) { + super(view, selectionProvider); + setText(Messages.getString(getClass(), "text")); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.REFRESH)); + setToolTipText(Messages.getString(getClass(), "text")); + } + + protected void executeResultSetAction(SQLResultSetResults results) throws SQLException { + results.refresh(getConnection(results)); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetAction.java new file mode 100644 index 0000000..03a7f55 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetAction.java @@ -0,0 +1,72 @@ +package com.quantum.view.tableview; + +import java.sql.Connection; +import java.sql.SQLException; + +import com.quantum.sql.SQLResultSetResults; +import com.quantum.ui.dialog.ExceptionDisplayDialog; +import com.quantum.util.connection.ConnectionUtil; + +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.actions.SelectionListenerAction; + +/** + * @author BC Holmes + */ +public abstract class ResultSetAction extends SelectionListenerAction { + private IViewPart view; + private ConnectionUtil connectionUtil = new ConnectionUtil(); + private final ISelectionProvider selectionProvider; + + /** + * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart) + */ + public ResultSetAction(IViewPart view, ISelectionProvider selectionProvider) { + super(""); + this.selectionProvider = selectionProvider; + this.view = view; + this.selectionProvider.addSelectionChangedListener(this); + } + + public void run() { + try { + IStructuredSelection selection = + (IStructuredSelection) this.selectionProvider.getSelection(); + if (!selection.isEmpty()) { + SQLResultSetResults results = (SQLResultSetResults) selection.getFirstElement(); + executeResultSetAction(results); + } + } catch (SQLException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); + } catch (RuntimeException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); + } + } + + protected boolean updateSelection(IStructuredSelection selection) { + return selection != null && !selection.isEmpty(); + } + /** + * @param results + * @throws SQLException + */ + protected abstract void executeResultSetAction(SQLResultSetResults results) throws SQLException; + + /** + * @param results + * @return + */ + protected Connection getConnection(SQLResultSetResults results) { + return this.connectionUtil.connect(results.getBookmark(), getShell()); + } + + /** + * @return + */ + private Shell getShell() { + return this.view.getSite().getShell(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetViewer.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetViewer.java new file mode 100644 index 0000000..fccbc9c --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/ResultSetViewer.java @@ -0,0 +1,246 @@ +package com.quantum.view.tableview; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.Scrollable; + +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; + +/** + * @author BC + */ +class ResultSetViewer implements PropertyChangeListener { + + class LabelProviderImpl implements ITableLabelProvider { + public Image getColumnImage(Object element, int columnIndex) { + return null; + } + public String getColumnText(Object element, int columnIndex) { + Object value = null; + if (element instanceof SQLResultSetResults.Row) { + value = ((SQLResultSetResults.Row) element).get(columnIndex+1); + } + return value == null ? "" : value.toString(); + } + public void addListener(ILabelProviderListener listener) { + } + public void dispose() { + } + public boolean isLabelProperty(Object element, String property) { + return false; + } + public void removeListener(ILabelProviderListener listener) { + } + } + + class ContentProviderImpl implements IStructuredContentProvider { + public Object[] getElements(Object inputElement) { + if (inputElement instanceof SQLResultSetResults) { + return ((SQLResultSetResults) inputElement).getRows(); + } else { + return null; + } + } + + public void dispose() { + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + } + + + private final SQLResultSetResults resultSet; + private TableViewer tableViewer; + private TabItem tabItem; + private final TableView tableView; + + public ResultSetViewer(TableView tableView, SQLResultSetResults resultSet) { + this.tableView = tableView; + this.resultSet = resultSet; + + createControl(); + + this.resultSet.addPropertyChangeListener(this); + } + + protected TabItem getTabItem() { + return this.tabItem; + } + + public Table getTable() { + return this.tableViewer.getTable(); + } + + protected void createControl() { + this.tabItem = new TabItem(this.tableView.tabs, SWT.NONE); + + int index = this.tableView.tabs.getItems().length; + Composite composite = new Composite(this.tableView.tabs, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 5; + layout.marginHeight = 5; + composite.setLayout(layout); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); + + if (this.resultSet.getEntity() == null) { + this.tabItem.setImage(ImageStore.getImage(ImageStore.SCRIPT)); + this.tabItem.setText(this.resultSet.getBookmark().getName()); + this.tabItem.setToolTipText(this.resultSet.getQuery()); + } else if (this.resultSet.isMetaData()) { + this.tabItem.setImage(ImageStore.getImage(ImageStore.TABLE_DETAILS)); + this.tabItem.setText(this.resultSet.getBookmark().getName() + ":" + + this.resultSet.getEntity().getQualifiedName()); + tabItem.setToolTipText(this.resultSet.getEntity().getQualifiedName()); + } else { + this.tabItem.setImage(ImageStore.getImage(ImageStore.TABLE)); + this.tabItem.setText(this.resultSet.getBookmark().getName() + ":" + + this.resultSet.getEntity().getQualifiedName()); + this.tabItem.setToolTipText(this.resultSet.getEntity().getQualifiedName()); + } + + createTable(composite); + this.tabItem.setControl(composite); + initializePopUpMenu(); + + this.tableView.tabs.setSelection(index-1); + } + + + /** + * @param tabItem + * @param composite + */ + private void createTable(Composite composite) { + final Table table = new Table(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER); + table.setLayout(new GridLayout()); + table.setLayoutData(new GridData(GridData.FILL_BOTH)); + + addColumnsToTable(table); + this.tableViewer = new TableViewer(table); + this.tableViewer.setLabelProvider(new LabelProviderImpl()); + this.tableViewer.setContentProvider(new ContentProviderImpl()); + this.tableViewer.setInput(this.resultSet); + + packColumns(table); + } + + /** + * @param table + */ + private void packColumns(final Table table) { + for (int i = 0; i < table.getColumnCount(); i++) { + table.getColumn(i).pack(); + } + } + + /** + * @param table + * @return + */ + private int addColumnsToTable(final Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(true); + int columnCount = this.resultSet.getColumnCount(); + for (int i = 0; i < columnCount; i++) { + TableColumn column = new TableColumn(table, SWT.NONE); + column.setText(this.resultSet.getColumnName(i+1).toString()); + } + return columnCount; + } + + public void propertyChange(PropertyChangeEvent event) { + if ("rows".equals(event.getPropertyName())) { + this.tableViewer.refresh(); + } else if ("columns".equals(event.getPropertyName())) { + Table table = this.tableViewer.getTable(); + TableColumn[] columns = table.getColumns(); + for (int i = 0, length = columns == null ? 0 : columns.length; i < length; i++) { + columns[i].dispose(); + } + addColumnsToTable(table); + this.tableViewer.setInput(this.resultSet); + packColumns(table); + table.layout(); + } + updateStatusLine(); + } + + public void dispose() { + this.resultSet.removePropertyChangeListener(this); + this.tabItem.dispose(); + } + + protected SQLResultSetResults getResultSet() { + return this.resultSet; + } + + private void initializePopUpMenu() { + MenuManager manager = new MenuManager(); + manager.setRemoveAllWhenShown(true); + manager.addMenuListener(new IMenuListener() { + public void menuAboutToShow(IMenuManager menuManager) { + ResultSetViewer.this.tableView.actionGroup.fillContextMenu(menuManager); + } + }); + Menu contextMenu = manager.createContextMenu(this.tableViewer.getControl()); + this.tableViewer.getControl().setMenu(contextMenu); + // register the menu to the site so that we can allow + // actions to be plugged in + this.tableView.getSite().registerContextMenu(manager, this.tableView); + } + + /** + * + */ + protected void updateStatusLine() { + + if (this == this.tableView.getSelectedResultSetViewer()) { + IStatusLineManager statusLine = this.tableView.getViewSite().getActionBars().getStatusLineManager(); + if (this.resultSet != null && this.resultSet instanceof Scrollable) { + Scrollable scrollable = (Scrollable) this.resultSet; + int start = scrollable.getStart(); + int end = scrollable.getEnd(); + int last = scrollable.getLast(); + + statusLine.setMessage( + Messages.getString(getClass(), "position", + new String[] { + String.valueOf(start), + String.valueOf(end), + last < 0 + ? Messages.getString(getClass(), "unknown") + : String.valueOf(last)})); + } else { + statusLine.setMessage(""); + } + } + } + + protected ISelection getSelection() { + return this.tableViewer.getSelection(); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/SelectAllAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/SelectAllAction.java new file mode 100644 index 0000000..b95208a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/SelectAllAction.java @@ -0,0 +1,33 @@ +/* + * Created on 28-jul-2003 + * + */ +package com.quantum.view.tableview; + +import com.quantum.Messages; + +import org.eclipse.jface.action.Action; +import org.eclipse.swt.widgets.Table; + + +public final class SelectAllAction extends Action { + + private final TableView view; + + public SelectAllAction(TableView view) { + super(); + this.view = view; + setText(Messages.getString(getClass(), "text")); + } + public void run() { + Table table = getTable(); + if (table != null) { + table.selectAll(); + } + } + + private Table getTable() { + ResultSetViewer viewer = this.view.getSelectedResultSetViewer(); + return viewer == null ? null : viewer.getTable(); + } +} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableAdapter.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableAdapter.java deleted file mode 100644 index e65c9d0..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableAdapter.java +++ /dev/null @@ -1,265 +0,0 @@ -package com.quantum.view.tableview; - -import java.sql.SQLException; -import java.util.Vector; - -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TextCellEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; - -import com.quantum.Messages; -import com.quantum.adapters.DatabaseAdapter; -import com.quantum.model.Bookmark; -import com.quantum.model.Entity; -import com.quantum.model.NotConnectedException; -import com.quantum.sql.FilterSort; -import com.quantum.sql.SQLHelper; -import com.quantum.sql.SQLResults; - -public class TableAdapter { - - public static final String DEFAULT = ""; //$NON-NLS-1$ - public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$ - public static final String UTF_16 = "UTF-16"; //$NON-NLS-1$ - - private int pageSize = DefaultSizes.PAGE_SIZE; - private int maxColumnSize = DefaultSizes.MAX_COLUMN_SIZE; - private FilterSort extra = new FilterSort(); - private int offset = 1; - private int totalSize = -1; - private Vector rows = new Vector(); - private Vector columnNames = new Vector(); - private boolean hasMore = false; - - private Bookmark bookmark = null; - private Entity entity = null; - private String query; - - private String encoding = ""; //$NON-NLS-1$ - - private TableAdapter(Entity entity) { - this.entity = entity; - this.bookmark = entity.getBookmark(); - } - private TableAdapter(Bookmark bookmark) { - this.bookmark = bookmark; - } - public void fullMode() { - offset = 1; - pageSize = Integer.MAX_VALUE; - } - public void resetMode() { - offset = 1; - pageSize = DefaultSizes.PAGE_SIZE; - } - public static TableAdapter createFromQuery(Bookmark bookmark, SQLResults results) throws NotConnectedException { - TableAdapter retVal = new TableAdapter(bookmark); - retVal.setQuery(results.getQuery()); - retVal.setData(results); - return retVal; - } - public static TableAdapter createFromTable(Entity entity) { - TableAdapter retVal = new TableAdapter(entity); - return retVal; - } - private void loadSize() { - try { - if (entity != null) { - totalSize = SQLHelper.getSize( - bookmark.getConnection(), entity.getQualifiedName(), - bookmark.getAdapter()); - } - } catch (SQLException e) { - e.printStackTrace(); - } catch (NotConnectedException e) { - e.printStackTrace(); - } - } - public int getStartIndex() { - if (totalSize == 0) { - return 0; - } - return offset; - } - public int getEndIndex() { - return offset + rows.size() - 1; - } - public int getTotalSize() { - return totalSize; - } - public void nextPage() { - loadSize(); - offset = offset + pageSize; - if (totalSize >= 0 && offset > totalSize) { - offset = offset - pageSize; - } - } - public void previousPage() { - offset = offset - pageSize; - if (offset < 1) { - offset = 1; - } - } - public boolean hasNextPage() { - if (entity != null) { - if (offset + pageSize <= totalSize) { - return true; - } - return false; - } - return hasMore; - } - public boolean hasPreviousPage() { - if (offset > 1) { - return true; - } - return false; - } - - public String getQuery() { - if (entity != null) { - DatabaseAdapter adapter = bookmark.getAdapter(); - if (adapter == null) throw new RuntimeException(); - else return adapter.getTableQuery((entity).getQualifiedName()) + extra.toString(); - } - return query; - } - public void loadData() throws NotConnectedException { - loadSize(); - if (entity != null) { - if (offset > totalSize) { - offset = 1; - } - } - String query = getQuery(); - System.out.println(offset + Messages.getString("TableAdapter.to") + (offset + pageSize - 1)); //$NON-NLS-1$ - SQLResults results = SQLHelper.getResults(bookmark.getConnection(), query, offset, offset + pageSize - 1, maxColumnSize, encoding); - setData(results); - } - public void resetOffset() { - offset = 1; - } - public void setData(SQLResults results) throws NotConnectedException { - if (results.isError()) return; - int rowCount = results.getRowCount(); - int columnCount = results.getColumnCount(); - rows = new Vector(); - columnNames = new Vector(); - for (int col = 1; col <= columnCount; col++) { - columnNames.addElement(results.getColumnName(col)); - } - for (int row = 1; row <= rowCount; row++) { - String rowData[] = new String[columnCount]; - for (int col = 1; col <= columnCount; col++) { - rowData[col - 1] = results.getElement(col, row).toString(); - } - rows.addElement(rowData); - } - hasMore = results.hasMore(); - if (entity == null && results.getMaxSize() >= 0) { - if (offset > results.getMaxSize()) { - offset = 1; - loadData(); - } - } - } - public void loadTable(Table table) { - table.setHeaderVisible(true); - for (int i = 0; i < columnNames.size(); i++) { - TableColumn column = new TableColumn(table, SWT.NONE); - column.setText(columnNames.elementAt(i).toString()); - } - for (int i = 0; i < columnNames.size(); i++) { - table.getColumn(i).pack(); - } - for (int row = 0; row < rows.size(); row++) { - TableItem item = new TableItem(table, SWT.NONE); - String itemData[] = (String[]) rows.elementAt(row); - item.setText(itemData); - } - for (int i = 0; i < columnNames.size(); i++) { - table.getColumn(i).pack(); - } - } - -// public TableViewer addTableViewer(Table table) { -// TableViewer tableViewer = new TableViewer(table); -// tableViewer.setUseHashlookup(true); -// String[] colNams = new String[columnNames.size()]; -// for (int i = 0; i < columnNames.size(); i++) { -// colNams[i] = (String) columnNames.get(i); -// } -// tableViewer.setColumnProperties(colNams); -// -// // Create the cell editors -// CellEditor[] editors = new CellEditor[columnNames.size()]; -// for (int i = 0; i < columnNames.size(); i++) { -// TextCellEditor textEditor = new TextCellEditor(table); -// ((Text) textEditor.getControl()).setTextLimit(60); -// editors[i] = textEditor; -// } -// // Assign the cell editors to the viewer -// tableViewer.setCellEditors(editors); -// // Set the cell modifier for the viewer -// //tableViewer.setCellModifier(new MetaDataModifier(this)); -// // Set the default sorter for the viewer -// //tableViewer.setSorter(new ExampleTaskSorter(ExampleTaskSorter.DESCRIPTION)); -// -// return tableViewer; -// } - - public int getPageSize() { - return pageSize; - } - - public void setFilterSort(FilterSort extra) { - this.extra = extra; - } - public String getTable() { - return (entity != null) ? entity.getQualifiedName() : null; - } - - public void setQuery(String query) { - this.query = query; - } - public String getEncoding() { - return encoding; - } - - public void setEncoding(String encoding) { - this.encoding = encoding; - } - public String getStatusString() { - String status = getStartIndex() + Messages.getString("TableAdapter.to") + getEndIndex() + Messages.getString("TableAdapter.of") + //$NON-NLS-1$ //$NON-NLS-2$ - getTotalSize(); - if (!encoding.equals(DEFAULT)) { - status += " (" + encoding + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - String filterText = extra.toString(); - if (!filterText.equals("")) { //$NON-NLS-1$ - status += " (" + filterText + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - if (pageSize == Integer.MAX_VALUE) { - status += Messages.getString("TableAdapter.full"); //$NON-NLS-1$ - } - return status; - } - /** - * @return - */ - public Bookmark getBookmark() { - return this.bookmark; - } - /** - * @return - */ - public Entity getEntity() { - return entity; - } - -} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableView.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableView.java index c9b151a..9351717 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableView.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableView.java @@ -1,66 +1,60 @@ package com.quantum.view.tableview; -import java.util.Vector; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; -import com.quantum.Messages; import com.quantum.QuantumPlugin; -import com.quantum.extensions.ProcessServiceMembers; -import com.quantum.model.Bookmark; -import com.quantum.model.Entity; -import com.quantum.model.NotConnectedException; -import com.quantum.sql.SQLResults; -import com.quantum.ui.dialog.ExceptionDisplayDialog; -import com.quantum.view.LogProxy; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.ToolBar; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.WorkbenchException; +import org.eclipse.ui.IActionBars; import org.eclipse.ui.part.ViewPart; /** * The Table View. Displays tables and Queries. */ -public class TableView extends ViewPart implements ISelectionListener { +public class TableView extends ViewPart implements ISelectionProvider, PropertyChangeListener { - private class DefaultEncodingAction extends Action { - private final TableAdapter ta; - private DefaultEncodingAction(TableAdapter ta) { - super(); - this.ta = ta; - } - public void run() { - ta.setEncoding(TableAdapter.DEFAULT); - } - } - private TabFolder tabs = null; - private Composite parent; - private Vector extensionVector; + protected TabFolder tabs = null; + + private Set listeners = Collections.synchronizedSet(new HashSet()); + + protected List resultSetViewers = Collections.synchronizedList(new ArrayList()); + protected TableViewActionGroup actionGroup; /** * Generic contructor */ public TableView() { + SQLResultSetCollection.getInstance().addPropertyChangeListener(this); } public void setFocus() { - setQualifiedTitle(); + } + + public void dispose() { + SQLResultSetCollection.getInstance().removePropertyChangeListener(this); + super.dispose(); } /** @@ -74,212 +68,157 @@ public class TableView extends ViewPart implements ISelectionListener { return (TableView) QuantumPlugin.getDefault().getView("com.quantum.view.tableview.TableView"); } - /** - * Close the current tab, disposing of it - */ - public void closeCurrent() { - if (tabs == null) return; - - if (tabs.getSelectionIndex() >= 0) { - try { - TabItem item = tabs.getItem(tabs.getSelectionIndex()); - item.dispose(); - } catch (Throwable e) { - LogProxy.getInstance().addText(LogProxy.ERROR, "Error Closing Current: " + e.toString()); //$NON-NLS-1$ - e.printStackTrace(); + public void createPartControl(Composite parent) { + this.tabs = new TabFolder(parent, SWT.NONE); + this.tabs.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + fireSelectionChangedEvent(); } - } - if (tabs.getItemCount() == 0) { - setTitle(Messages.getString("tableview.QuantumTableViewName")); //$NON-NLS-1$ + }); + + SQLResultSetResults[] resultSets = SQLResultSetCollection.getInstance().getResultSets(); + for (int i = 0, length = resultSets == null ? 0 : resultSets.length; i < length; i++) { + this.resultSetViewers.add(new ResultSetViewer(this, resultSets[i])); } + + initActions(); + } + + public void initActions() { + + this.actionGroup = new TableViewActionGroup(this); + + IActionBars actionBars = getViewSite().getActionBars(); + this.actionGroup.fillActionBars(actionBars); + } + + public void addSelectionChangedListener(ISelectionChangedListener listener) { + this.listeners.add(listener); } + protected void fireSelectionChangedEvent() { + ISelection selection = getSelection(); + for (Iterator i = this.listeners.iterator(); i.hasNext();) { + ISelectionChangedListener listener = (ISelectionChangedListener) i.next(); + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + + ResultSetViewer results = getSelectedResultSetViewer(); + if (results != null) { + results.updateStatusLine(); + } else { + getViewSite().getActionBars().getStatusLineManager().setMessage(""); + } + } + + public ISelection getSelection() { + SQLResultSetResults selection = getSelectedResultSet(); + return selection == null + ? new StructuredSelection() + : new StructuredSelection(selection); + } + /** - * Reload table or query data into the selected tab + * @return */ - public void refreshCurrent() { -System.out.println("Refresh?"); - if (tabs.getSelectionIndex() >= 0) { -System.out.println("Refresh!"); - TabItem item = tabs.getItem(tabs.getSelectionIndex()); - TableAdapter adapter = (TableAdapter) item.getData(); - Bookmark bookmark = adapter.getBookmark(); - String table = adapter.getTable(); - if (table == null) { - loadTable(bookmark, item, null, null, true, true); - } else { - loadTable(bookmark, item, null, null, true, true); + protected SQLResultSetResults getSelectedResultSet() { + ResultSetViewer viewer = getSelectedResultSetViewer(); + return viewer == null ? null : viewer.getResultSet(); + } + + protected ResultSetViewer getSelectedResultSetViewer() { + ResultSetViewer selection = null; + int index = this.tabs.getSelectionIndex(); + if (index >= 0) { + TabItem item = this.tabs.getItem(index); + for (Iterator i = this.resultSetViewers.iterator(); + selection == null && i.hasNext();) { + ResultSetViewer viewer = (ResultSetViewer) i.next(); + if (item == viewer.getTabItem()) { + selection = viewer; + } } - String title = Messages.getString("tableview.QuantumTableViewName"); //$NON-NLS-1$ - if (bookmark != null) - title = bookmark.getName() + Messages.getString("tableview.ViewNameInitialDecoration") + title + Messages.getString("tableview.ViewNameFinalDecoration"); //$NON-NLS-1$ //$NON-NLS-2$ - setTitle(title); } + return selection; } - - public void loadQuery(Bookmark bookmark, SQLResults results) { - loadTable(bookmark, null, null, results, true, false); - } - public void loadTable(Entity entity) { - loadTable(entity.getBookmark(), null, entity, null, false, true); + + + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + this.listeners.remove(listener); } - public void loadTable(Bookmark bookmark, TabItem tabItem, Entity entity, SQLResults results, boolean query, boolean reload) { - try { - TableAdapter adapter; - // If no TabItem is given we have to create a new one, with the info of the table or view. - if (tabItem == null) { - tabItem = new TabItem(tabs, SWT.NONE); - // Data is stored in a TableAdapter object - if (query) { - adapter = TableAdapter.createFromQuery(bookmark, results); - } else { - adapter = TableAdapter.createFromTable(entity); - } - // That is stored in the tabItem, so it won't get lost - tabItem.setData(adapter); - // This does not really belong here, but it'll fail if done before the creation of the - // first TabItem, so it remains here till a better place found. - // We set a function to change the Title of the window depending on the selected tab. - tabs.addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - setQualifiedTitle(); - } - }); - } else { - // If there is already a TabItem, we take its TableAdapter object - adapter = (TableAdapter) tabItem.getData(); - } - - // We create a Composite widget (main) to display our data, with a GridLayout - Composite main = new Composite(tabs, SWT.NONE); - GridLayout layout = new GridLayout(1, false); - layout.horizontalSpacing = 0; - layout.verticalSpacing = 0; - main.setLayout(layout); - - - // load widgets, the order of loading them determines the appearance in screen - ToolBar widgetToolBar = new ToolBar(main, SWT.HORIZONTAL); - // We fill up our Composite widget, the main table display, etc. - final Table table = new Table(main, SWT.FULL_SELECTION | SWT.MULTI); - final Label label = new Label(main, SWT.NULL); - TableViewToolBar toolBar = new TableViewToolBar(this, widgetToolBar, table, adapter, label); - - - // load table - if (reload) { - adapter.resetOffset(); - adapter.loadData(); - } - // Load the table data from the adapter into the widget - adapter.loadTable(table); - // Experimental, won't make it into 2.2 - // final TableViewer viewer = adapter.addTableViewer(table); - - String tableName = adapter.getTable(); - if (tableName != null) { - tabItem.setText(bookmark.getName() + ":" + tableName); - } else { - tabItem.setText(bookmark.getName() + ": SQL"); - tabItem.setToolTipText(bookmark.getName() + ":\n" + adapter.getQuery()); - } - - toolBar.getPrevious().setEnabled(adapter.hasPreviousPage()); - toolBar.getNext().setEnabled(adapter.hasNextPage()); - label.setText(adapter.getStatusString()); - - GridData gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - table.setLayoutData(gridData); - - gridData = new GridData(); - gridData.horizontalAlignment = GridData.FILL; - label.setLayoutData(gridData); - - - toolBar.setColumns(this, adapter, table); - final TableAdapter ta = adapter; - final Action defaultEncodingAction = new DefaultEncodingAction(ta); - defaultEncodingAction.setText(Messages.getString("tableview.defaultEncoding")); //$NON-NLS-1$ - final Action UTF8EncodingAction = new Action() { - public void run() { - ta.setEncoding(TableAdapter.UTF_8); - } - }; - UTF8EncodingAction.setText(Messages.getString("tableview.UTF8Encoding")); //$NON-NLS-1$ - final Action UTF16EncodingAction = new Action() { - public void run() { - ta.setEncoding(TableAdapter.UTF_16); - } - }; - UTF16EncodingAction.setText(Messages.getString("tableview.UTF16Encoding")); //$NON-NLS-1$ - - IMenuListener menuListener = new TableViewMenuListener(this, table, UTF16EncodingAction, ta, defaultEncodingAction, UTF8EncodingAction, extensionVector); - - // final setup - MenuManager manager = new MenuManager(); - manager.setRemoveAllWhenShown(true); - Menu fTextContextMenu = manager.createContextMenu(table); - table.setMenu(fTextContextMenu); - table.setLinesVisible(true); - manager.addMenuListener(menuListener); - - tabItem.setControl(main); - tabs.setSelection(tabs.indexOf(tabItem)); - - setQualifiedTitle(); - } catch (NotConnectedException e) { - e.printStackTrace(); - handleException(e); - } catch (Exception e) { - e.printStackTrace(); - } + + public void setSelection(ISelection selection) { } - - protected void handleException(Exception e) { - ExceptionDisplayDialog.openError(getSite().getShell(), null, null, e); - } + public void propertyChange(PropertyChangeEvent event) { + if ("resultSets".equals(event.getPropertyName())) { + SQLResultSetResults selection = getSelectedResultSet(); + + Collection additions = getAddedResultSets(); + for (Iterator i = additions.iterator(); i.hasNext();) { + SQLResultSetResults results = (SQLResultSetResults) i.next(); + this.resultSetViewers.add(new ResultSetViewer(this, results)); + } + + Collection deletions = getRemovedResultSets(); + for (Iterator i = deletions.iterator(); i.hasNext();) { + SQLResultSetResults results = (SQLResultSetResults) i.next(); + + ResultSetViewer viewer = findViewerFor(results); + this.resultSetViewers.remove(viewer); + viewer.dispose(); + } + + SQLResultSetResults newSelection = getSelectedResultSet(); + if (selection != null && newSelection == null) { + fireSelectionChangedEvent(); + } else if (selection == null && newSelection != null) { + fireSelectionChangedEvent(); + } else if (selection != null && !selection.equals(newSelection)) { + fireSelectionChangedEvent(); + } + } + } + /** * @return */ - /** - * Sets the title of the window to the text of the selected tab - */ - private void setQualifiedTitle() { - if (tabs.getSelectionIndex() < 0) return; - TabItem item = tabs.getItem(tabs.getSelectionIndex()); - String defTitle = Messages.getString("tableview.QuantumTableViewName"); //$NON-NLS-1$ - String title = item.getText(); - int ind = title.indexOf(Messages.getString("tableview.BookmarkSeparator")); //$NON-NLS-1$ - if (ind > 0) defTitle = title.substring(0,ind) - + Messages.getString("tableview.ViewNameInitialDecoration") //$NON-NLS-1$ - + defTitle - + Messages.getString("tableview.ViewNameFinalDecoration"); //$NON-NLS-1$ - setTitle(defTitle); + private Collection getRemovedResultSets() { + SQLResultSetResults[] results = SQLResultSetCollection.getInstance().getResultSets(); + Collection collection = (results == null) + ? new ArrayList() + : new ArrayList(Arrays.asList(results)); + Collection visible = getResultSets(); + visible.removeAll(collection); + return visible; } - public void createPartControl(Composite parent) { - this.parent = parent; - initActions(); - tabs = new TabFolder(parent, SWT.NONE); + private Collection getAddedResultSets() { + SQLResultSetResults[] results = SQLResultSetCollection.getInstance().getResultSets(); + Collection collection = (results == null) + ? new ArrayList() + : new ArrayList(Arrays.asList(results)); + collection.removeAll(getResultSets()); + return collection; } - public void initActions() { - extensionVector = new Vector(); - try { - ProcessServiceMembers.process(this, extensionVector); - } catch (WorkbenchException e) { - e.printStackTrace(); + private Collection getResultSets() { + List list = new ArrayList(); + for (Iterator i = this.resultSetViewers.iterator(); i.hasNext();) { + ResultSetViewer viewer = (ResultSetViewer) i.next(); + list.add(viewer.getResultSet()); } - + return list; } - - public void selectionChanged(IWorkbenchPart part, ISelection selection) { + + private ResultSetViewer findViewerFor(SQLResultSetResults results) { + ResultSetViewer viewer = null; + for (Iterator i = this.resultSetViewers.iterator(); viewer == null && i.hasNext();) { + ResultSetViewer temp = (ResultSetViewer) i.next(); + if (results != null && results.equals(temp.getResultSet())) { + viewer = temp; + } + } + return viewer; } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableViewActionGroup.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableViewActionGroup.java new file mode 100644 index 0000000..c99c134 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/view/tableview/TableViewActionGroup.java @@ -0,0 +1,417 @@ +package com.quantum.view.tableview; + +import java.util.Iterator; +import java.util.Vector; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.WorkbenchException; +import org.eclipse.ui.actions.ActionGroup; +import org.eclipse.ui.actions.SelectionListenerAction; + +import com.quantum.ImageStore; +import com.quantum.Messages; +import com.quantum.extensions.ExtensionAction; +import com.quantum.extensions.ProcessServiceMembers; +import com.quantum.php.wizards.PHPDeleteRowPage; +import com.quantum.php.wizards.PHPInsertRowPage; +import com.quantum.php.wizards.PHPSelectRowPage; +import com.quantum.php.wizards.PHPUpdateRowPage; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.TableRow; +import com.quantum.util.StringMatrix; +import com.quantum.wizards.DeleteRowPage; +import com.quantum.wizards.InsertRowPage; +import com.quantum.wizards.SQLPage; +import com.quantum.wizards.SQLRowWizard; +import com.quantum.wizards.SortFilterPage; +import com.quantum.wizards.UpdateRowPage; + + +/** + * @author Julen Parra + * @author BC Holmes + */ +public class TableViewActionGroup extends ActionGroup { + + abstract class SQLWizardAction extends SelectionListenerAction { + + /** + * @param text + */ + protected SQLWizardAction(String text, ISelectionProvider selectionProvider) { + super(text); + selectionProvider.addSelectionChangedListener(this); + setEnabled(!selectionProvider.getSelection().isEmpty()); + } + + protected abstract SQLPage createSQLPage(); + + protected abstract String getTitle(); + + public void run() { + SQLPage page = createSQLPage(); + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(getTitle(), page, getSelectedSQLResults(), getSelectedRow()); + WizardDialog dialog = new WizardDialog( + tableView.getSite().getShell(), wizard); + dialog.open(); + } + + protected boolean updateSelection(IStructuredSelection selection) { + return selection != null && !selection.isEmpty(); + } + }; + + class SortFilterAction extends SQLWizardAction { + + public SortFilterAction(ISelectionProvider selectionProvider) { + super(Messages.getString(TableViewActionGroup.class, "filterSort"), + selectionProvider); + setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.FILTER)); + setToolTipText(Messages.getString(TableViewActionGroup.class, "filterSort")); + setEnabled(sortFilterApplies()); + } + + private boolean sortFilterApplies() { + SQLResultSetResults results = getSelectedSQLResults(); + return results != null && !results.isMetaData() && results.getEntity() != null; + } + + protected SQLPage createSQLPage() { + return new SortFilterPage("page1"); + } + + protected String getTitle() { + return Messages.getString(TableViewActionGroup.class, "filterSortTitle"); + } + + protected boolean updateSelection(IStructuredSelection selection) { + return sortFilterApplies(); + } + } + + class PHPInsertAction extends Action { + public PHPInsertAction() { + setText(Messages.getString("tableview.phpinsert")); + } + + public void run() { + PHPInsertRowPage page = new PHPInsertRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.PHPInsertRow"), + page, getSelectedSQLResults(), null); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + + class PHPDeleteAction extends Action { + public PHPDeleteAction() { + setText(Messages.getString("tableview.phpdelete")); + } + + public void run() { + PHPDeleteRowPage page = new PHPDeleteRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.PHPDeleteRow"), + page, getSelectedSQLResults(), getSelectedRow()); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + class PHPSelectAction extends Action { + public PHPSelectAction() { + setText(Messages.getString("tableview.phpselect")); + } + + public void run() { + PHPSelectRowPage page = new PHPSelectRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.PHPSelectRow"), + page, getSelectedSQLResults(), getSelectedRow()); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + class PHPUpdateAction extends Action { + public PHPUpdateAction() { + setText(Messages.getString("tableview.phpupdate")); + } + + public void run() { + PHPUpdateRowPage page = new PHPUpdateRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.PHPUpdateRow"), + page, getSelectedSQLResults(), getSelectedRow()); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + class InsertAction extends Action { + public InsertAction() { + setText(Messages.getString("tableview.insert")); + } + + public void run() { + InsertRowPage page = new InsertRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.InsertRow"), + page, getSelectedSQLResults(), null); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + + class DeleteAction extends Action { + public DeleteAction() { + setText(Messages.getString("tableview.delete")); + } + + public void run() { + DeleteRowPage page = new DeleteRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.DeleteRow"), + page, getSelectedSQLResults(), getSelectedRow()); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + + class UpdateAction extends Action { + public UpdateAction() { + setText(Messages.getString("tableview.update")); + } + + public void run() { + UpdateRowPage page = new UpdateRowPage(""); //$NON-NLS-1$ + SQLRowWizard wizard = new SQLRowWizard(); + wizard.init(Messages.getString("TableView.UpdateRow"), + page, getSelectedSQLResults(), getSelectedRow()); //$NON-NLS-1$ + WizardDialog dialog = + new WizardDialog( + tableView.getSite().getShell(), + wizard); + dialog.open(); + } + }; + + + private final TableView tableView; + private SelectionListenerAction closeAction; + private SelectionListenerAction closeAllAction; + private SelectionListenerAction nextAction; + private SelectionListenerAction previousAction; + private SelectionListenerAction refreshAction; + private SelectionListenerAction fullModeAction; + private SelectionListenerAction defaultEncodingAction; + private SelectionListenerAction utf8EncodingAction; + private SelectionListenerAction utf16EncodingAction; + + private CopyAction copyAction; + private SelectAllAction selectAllAction; + private InsertAction insertRowAction; + private DeleteAction deleteRowAction; + private UpdateAction updateRowAction; + + private PHPInsertAction phpInsertRowAction; + private PHPDeleteAction phpDeleteRowAction; + private PHPSelectAction phpSelectRowAction; + private PHPUpdateAction phpUpdateRowAction; + + private SortFilterAction sortFilterAction; + + private Vector extensionActions = new Vector(); + + public TableViewActionGroup(TableView tableView) { + this.tableView = tableView; + + this.closeAction = new CloseResultSetAction(this.tableView, this.tableView); + this.closeAllAction = new CloseAllResultSetsAction(this.tableView, this.tableView); + this.defaultEncodingAction = new ChangeEncodingAction(this.tableView, this.tableView, "", "default"); + this.utf8EncodingAction = new ChangeEncodingAction(this.tableView, this.tableView, "UTF-8", "utf8"); + this.utf16EncodingAction = new ChangeEncodingAction(this.tableView, this.tableView, "UTF-16", "utf16"); + this.nextAction = new NextPageAction(this.tableView, this.tableView); + this.previousAction = new PreviousPageAction(this.tableView, this.tableView); + this.refreshAction = new RefreshTableAction(this.tableView, this.tableView); + this.fullModeAction = new FullModeAction(this.tableView, this.tableView); + + this.copyAction = new CopyAction(this.tableView); + this.selectAllAction = new SelectAllAction(this.tableView); + + this.insertRowAction = new InsertAction(); + this.deleteRowAction = new DeleteAction(); + this.updateRowAction = new UpdateAction(); + + this.phpInsertRowAction = new PHPInsertAction(); + this.phpDeleteRowAction = new PHPDeleteAction(); + this.phpSelectRowAction = new PHPSelectAction(); + this.phpUpdateRowAction = new PHPUpdateAction(); + + this.sortFilterAction = new SortFilterAction(this.tableView); + + try { + ProcessServiceMembers.process(tableView, this.extensionActions); + } catch (WorkbenchException e) { + e.printStackTrace(); + } + } + + public void fillActionBars(IActionBars actionBars) { + IToolBarManager toolBar = actionBars.getToolBarManager(); + toolBar.add(this.previousAction); + toolBar.add(this.nextAction); + toolBar.add(this.fullModeAction); + toolBar.add(this.closeAction); + toolBar.add(this.closeAllAction); + toolBar.add(this.refreshAction); + toolBar.add(this.sortFilterAction); + + actionBars.setGlobalActionHandler( + IWorkbenchActionConstants.COPY, this.copyAction); + actionBars.setGlobalActionHandler( + IWorkbenchActionConstants.SELECT_ALL, this.selectAllAction); + } + + + public void fillContextMenu(IMenuManager menuManager) { + menuManager.add(this.defaultEncodingAction); + menuManager.add(this.utf8EncodingAction); + menuManager.add(this.utf16EncodingAction); + menuManager.add(new Separator()); + menuManager.add(this.copyAction); + menuManager.add(this.selectAllAction); + menuManager.add(new Separator()); + + SQLResultSetResults resultSet = getSelectedSQLResults(); + + if (resultSet != null && !resultSet.isMetaData() && resultSet.getEntity() != null) { + menuManager.add(this.insertRowAction); + menuManager.add(this.updateRowAction); + menuManager.add(this.deleteRowAction); + + menuManager.add(this.phpSelectRowAction); + menuManager.add(this.phpUpdateRowAction); + menuManager.add(this.phpDeleteRowAction); + menuManager.add(this.phpInsertRowAction); + + menuManager.add(new Separator()); + } + + createExtensionMenu(menuManager); + + createMarkerForActionsProvidedByOtherPlugins(menuManager); + } + + /** + * @return + */ + private SQLResultSetResults getSelectedSQLResults() { + return this.tableView.getSelectedResultSet(); + } + + protected SQLResultSetResults.Row getSelectedRow() { + IStructuredSelection selection = getTableRowSelection(); + + return selection == null || selection.isEmpty() + ? null + : (SQLResultSetResults.Row) selection.getFirstElement(); + } + /** + * @return + */ + private IStructuredSelection getTableRowSelection() { + ResultSetViewer viewer = this.tableView.getSelectedResultSetViewer(); + IStructuredSelection selection = viewer == null ? null : (IStructuredSelection) viewer.getSelection(); + return selection; + } + + /** + * @param menuManager + */ + private void createExtensionMenu(IMenuManager menuManager) { + MenuManager subMenuExtension = new MenuManager("Extensions"); + for (int i = 0; i < this.extensionActions.size(); i++) { + ExtensionAction extensionAction = (ExtensionAction) this.extensionActions.get(i); + extensionAction.addRowData(createTableRow()); + subMenuExtension.add(extensionAction); + } + if (this.extensionActions.size() > 0) { + menuManager.add(subMenuExtension); + } + } + + /** + * This method supports an earlier API for other plug-ins to add functionality to + * QuantumDB. + * + * @return + */ + private TableRow createTableRow() { + + SQLResultSetResults results = this.tableView.getSelectedResultSet(); + IStructuredSelection selection = getTableRowSelection(); + + if (results != null) { + StringMatrix data = new StringMatrix(); + data.addMatrixHeader(results.getColumnNames()); + if (selection != null && !selection.isEmpty()) { + int rowNumber = 0; + for (Iterator i = selection.iterator(); i.hasNext(); ) { + SQLResultSetResults.Row row = (SQLResultSetResults.Row) i.next(); + for (int j = 0, length = results.getColumnCount(); j < length; j++) { + Object object = row.get(j); + data.addAt(results.getColumnName(j+1), + object == null ? null : object.toString(), + rowNumber++); + } + } + } else { + // Create dummy values in case nothing selected + for (int i = 0, length = results.getColumnCount(); i < length; i++) { + data.addAt(results.getColumnName(i+1), "", 0); //$NON-NLS-1$ + } + } + + return new TableRow(results.getEntity(), results.getBookmark(), + results.getEntity() == null + ? null + : results.getEntity().getQualifiedName(), + data); + } else { + return null; + } + } + + private void createMarkerForActionsProvidedByOtherPlugins(IMenuManager menuManager) { + menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); + menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "-end")); //$NON-NLS-1$ + menuManager.add(new Separator()); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/AddDriverWizard.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/AddDriverWizard.java index e3cb426..6525e05 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/AddDriverWizard.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/AddDriverWizard.java @@ -1,5 +1,10 @@ package com.quantum.wizards; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + import com.quantum.ImageStore; import com.quantum.Messages; import com.quantum.QuantumPlugin; @@ -13,9 +18,13 @@ import com.quantum.view.widget.ComboViewer; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardPage; @@ -31,20 +40,45 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; /** * @author BC Holmes + * @author Sirkware */ public class AddDriverWizard extends Wizard { + public class LabelProviderImpl extends LabelProvider { + + public Image getImage(Object element) { + return ImageStore.getImage(ImageStore.EXTERNAL_JAR); + } + } + + public class ContentProviderImpl implements IStructuredContentProvider { + public Object[] getElements(Object inputElement) { + if (inputElement instanceof List) { + return ((List) inputElement).toArray(); + } else if (inputElement instanceof Object[]){ + return (Object[]) inputElement; + } else { + return null; + } + } + public void dispose() { + } + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + } + public class PageImpl extends WizardPage { private FileDialog fileDialog; - private Text driverFileName; private Text driverClassName; private ComboViewer type; + private TableViewer driverFiles; private DatabaseAdapter[] adapters = AdapterFactory.getInstance().getDriverList(); public PageImpl() { @@ -56,16 +90,12 @@ public class AddDriverWizard extends Wizard { setTitle(Messages.getString(getClass(), "title")); setDescription(Messages.getString(getClass(), "description")); - parent.setLayout(new GridLayout()); Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); composite.setLayout(layout); layout.numColumns = 3; - GridData fullHorizontal = new GridData( - GridData.FILL_HORIZONTAL | - GridData.VERTICAL_ALIGN_BEGINNING); - composite.setLayoutData(fullHorizontal); + composite.setLayoutData(new GridData(GridData.FILL_BOTH)); this.fileDialog = new FileDialog(composite.getShell(), SWT.OPEN); @@ -76,41 +106,76 @@ public class AddDriverWizard extends Wizard { Messages.getString("BookmarkWizard.AllFiles") }); Label label = new Label(composite, SWT.NULL); - label.setText(Messages.getString(getClass(), "fileName")); - this.driverFileName = new Text(composite, SWT.BORDER | SWT.SINGLE); - fullHorizontal = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); - this.driverFileName.setLayoutData(fullHorizontal); + label.setText(Messages.getString(AddDriverWizard.class, "jars")); + GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); + gridData.horizontalSpan = 3; + label.setLayoutData(gridData); - this.driverFileName.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent event) { - updateButtons(); - } - - }); - - Button button = new Button(composite, SWT.PUSH); - button.setText(Messages.getString(getClass(), "browse")); + Table table = new Table(composite, SWT.BORDER); + gridData = new GridData(GridData.FILL_BOTH); + gridData.horizontalSpan = 2; + table.setLayoutData(gridData); + this.driverFiles = new TableViewer(table); + this.driverFiles.setLabelProvider(new LabelProviderImpl()); + this.driverFiles.setContentProvider(new ContentProviderImpl()); + this.driverFiles.setInput(AddDriverWizard.this.driverFileNames); + + Composite buttonArea = new Composite(composite, SWT.NONE); + GridLayout gridLayout = new GridLayout(); + gridLayout.marginWidth = 0; + buttonArea.setLayout(gridLayout); + buttonArea.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); + + Button addExternalJar = new Button(buttonArea, SWT.PUSH); + addExternalJar.setText(Messages.getString(AddDriverWizard.class, "addExternalJar")); + addExternalJar.setLayoutData( + new GridData(GridData.FILL_HORIZONTAL + | GridData.VERTICAL_ALIGN_BEGINNING)); - button.addSelectionListener(new SelectionAdapter() { + addExternalJar.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { PageImpl.this.fileDialog.setFilterPath(QuantumPlugin.getDefault() .getPreferenceStore().getString( "quantum.dialogs.bookmarkwizard.path")); String filename = PageImpl.this.fileDialog.open(); if (filename != null) { - PageImpl.this.driverFileName.setText(filename); + driverFileNames.add(filename); + PageImpl.this.driverFiles.refresh(); QuantumPlugin.getDefault().getPreferenceStore().setValue( "quantum.dialogs.bookmarkwizard.path", filename); - AddDriverWizard.this.setDriverFileName(filename); updateButtons(); } } }); - + + final Button removeJar = new Button(buttonArea, SWT.PUSH); + removeJar.setText(Messages.getString(AddDriverWizard.class, "removeJar")); + removeJar.setLayoutData( + new GridData(GridData.HORIZONTAL_ALIGN_FILL + | GridData.VERTICAL_ALIGN_BEGINNING)); + removeJar.setEnabled(false); + + this.driverFiles.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + removeJar.setEnabled(!event.getSelection().isEmpty()); + } + }); + + removeJar.addSelectionListener(new SelectionAdapter(){ + public void widgetSelected(SelectionEvent event) { + IStructuredSelection selection = + (IStructuredSelection) PageImpl.this.driverFiles.getSelection(); + for (Iterator i = selection.iterator(); i.hasNext();) { + driverFileNames.remove(i.next()); + } + PageImpl.this.driverFiles.refresh(); + } + }); + label = new Label(composite, SWT.NULL); - label.setText(Messages.getString(getClass(), "driverClassName")); + label.setText(Messages.getString(AddDriverWizard.class, "driverClassName")); this.driverClassName = new Text(composite, SWT.BORDER | SWT.SINGLE); - fullHorizontal = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); + GridData fullHorizontal = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); this.driverClassName.setLayoutData(fullHorizontal); this.driverClassName.addModifyListener(new ModifyListener() { @@ -118,16 +183,18 @@ public class AddDriverWizard extends Wizard { AddDriverWizard.this.setDriverClassName(((Text) event.getSource()).getText()); updateButtons(); } - }); - button = new Button(composite, SWT.PUSH); - button.setText(Messages.getString(getClass(), "browse")); + + + Button browse = new Button(composite, SWT.PUSH); + browse.setText(Messages.getString(AddDriverWizard.class, "browse")); + browse.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - button.addSelectionListener(new SelectionAdapter() { + browse.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { SimpleSelectionDialog dialog = new SimpleSelectionDialog( getShell(), "Select a Driver", JarUtil.getAllDriverNames( - getDriverFile()), ImageStore.getImage(ImageStore.CLASS)); + getDriverFileNames()), ImageStore.getImage(ImageStore.CLASS)); if (dialog.open() == SimpleSelectionDialog.OK) { IStructuredSelection selection = dialog.getSelection(); if (!selection.isEmpty()) { @@ -137,23 +204,13 @@ public class AddDriverWizard extends Wizard { AddDriverWizard.this.setDriverClassName(className); updateButtons(); } - - } } }); - label = new Label(composite, SWT.NULL); + label = new Label(composite, SWT.NULL); label.setText(Messages.getString("BookmarkWizard.TypeAst")); //$NON-NLS-1$ this.type = new ComboViewer(composite); - this.type.setContentProvider(new IStructuredContentProvider() { - public void dispose() { - } - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - public Object[] getElements(Object inputElement) { - return PageImpl.this.adapters; - } - }); + this.type.setContentProvider(new ContentProviderImpl()); this.type.setLabelProvider(new ILabelProvider() { public Image getImage(Object element) { @@ -177,7 +234,7 @@ public class AddDriverWizard extends Wizard { } }); - type.setInput(this); + type.setInput(this.adapters); fullHorizontal = new GridData(); fullHorizontal.horizontalAlignment = GridData.FILL; type.getControl().setLayoutData(fullHorizontal); @@ -188,7 +245,9 @@ public class AddDriverWizard extends Wizard { setControl(composite); } protected void updateButtons() { - Class driver = JarUtil.loadDriverClass(getDriverFile(), getDriverClassName()); + Class driver = JarUtil.loadDriverClass( + getDriverFileNames(), + getDriverClassName()); setPageComplete(driver != null); String adapterType = AdapterFactory.getInstance().getAdapterType(getDriverClassName()); @@ -197,13 +256,6 @@ public class AddDriverWizard extends Wizard { AdapterFactory.getInstance().getAdapter(adapterType))); } } - protected String getDriverClassName() { - return this.driverClassName == null ? null : this.driverClassName.getText(); - } - protected String getDriverFile() { - return this.driverFileName == null ? null : this.driverFileName.getText(); - } - protected String getDriverType() { DatabaseAdapter driverInfo = (DatabaseAdapter) ((IStructuredSelection) this.type.getSelection()).getFirstElement(); @@ -213,8 +265,8 @@ public class AddDriverWizard extends Wizard { private PageImpl page; private String driverClassName; - private String driverFileName; private String driverType; + private List driverFileNames = Collections.synchronizedList(new ArrayList()); public void addPages() { @@ -230,7 +282,7 @@ public class AddDriverWizard extends Wizard { public boolean performFinish() { JDBCDriver driver = new JDBCDriver( getDriverClassName(), - getDriverFileName(), + getDriverFileNames(), this.page.getDriverType()); BookmarkCollection.getInstance().addDriver(driver); return true; @@ -261,16 +313,8 @@ public class AddDriverWizard extends Wizard { public void setDriverType(String driverType) { this.driverType = driverType; } - /** - * @return Returns the driverFileName. - */ - public String getDriverFileName() { - return this.driverFileName; - } - /** - * @param driverFileName The driverFileName to set. - */ - public void setDriverFileName(String driverFileName) { - this.driverFileName = driverFileName; + + public String[] getDriverFileNames() { + return (String[]) this.driverFileNames.toArray(new String[this.driverFileNames.size()]); } } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java index a7a84fe..3c75b99 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java @@ -5,13 +5,13 @@ import java.sql.SQLException; import com.quantum.adapters.DatabaseAdapter; import com.quantum.model.Bookmark; import com.quantum.model.Column; -import com.quantum.model.ConnectionException; import com.quantum.model.Entity; import com.quantum.model.NotConnectedException; +import com.quantum.sql.MultiSQLServer; +import com.quantum.sql.SQLResultSetResults; import com.quantum.sql.SQLResults; -import com.quantum.sql.TableRow; -import com.quantum.view.ViewHelper; -import com.quantum.view.tableview.TableAdapter; +import com.quantum.ui.dialog.ExceptionDisplayDialog; +import com.quantum.util.connection.ConnectionUtil; import org.eclipse.jface.wizard.WizardPage; @@ -21,21 +21,22 @@ import org.eclipse.jface.wizard.WizardPage; */ public abstract class BaseSQLPage extends WizardPage implements SQLPage { - protected TableRow row; - protected TableAdapter adapter; + protected SQLResultSetResults.Row row; + protected SQLResultSetResults results; + private ConnectionUtil connectionUtil = new ConnectionUtil(); public BaseSQLPage(String pageName) { super(pageName); } public boolean performFinish() { try { - Bookmark bookmark = this.adapter.getBookmark(); + Bookmark bookmark = this.results.getBookmark(); bookmark.addQuery(getQueryText()); - SQLResults sqlResults = ViewHelper.tryGetResults(getShell(), - bookmark.getConnection(), getQueryText()); - return sqlResults.isError() ? false : true; - } catch (ConnectionException e) { - e.printStackTrace(); + SQLResults sqlResults = MultiSQLServer.getInstance().execute(bookmark, + this.connectionUtil.getConnection(bookmark, getShell()), getQueryText()); + return sqlResults == null ? false : true; + } catch (SQLException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); return false; } } @@ -66,8 +67,8 @@ public abstract class BaseSQLPage extends WizardPage implements SQLPage { return null; } } - public void init(TableRow row, TableAdapter adapter) { - this.row = row; - this.adapter = adapter; + public void init(SQLResultSetResults results, SQLResultSetResults.Row row) { + this.results = results; + this.row = row; } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicOnePartURLSetupControl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicOnePartURLSetupControl.java new file mode 100644 index 0000000..f3f6c99 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicOnePartURLSetupControl.java @@ -0,0 +1,57 @@ +package com.quantum.wizards; + +import com.quantum.Messages; +import com.quantum.model.JDBCDriver; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + + +/** + * @author BC + */ +public class BasicOnePartURLSetupControl extends URLSetupControl { + + private final String propertyName; + + public BasicOnePartURLSetupControl(Composite parent, JDBCDriver driver, String propertyName) { + super(parent, driver); + this.propertyName = propertyName; + } + + protected void createPart(Composite parent) { + + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + parent.setLayout(layout); + + Label label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, this.propertyName)); + + Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE); + databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + databaseNameText.setText(getProperty(this.propertyName)); + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "url")); + + final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE); + urlText.setEditable(false); + urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + urlText.setText(getConnectionURL()); + + databaseNameText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty( + BasicOnePartURLSetupControl.this.propertyName, + ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicThreePartURLSetupControl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicThreePartURLSetupControl.java new file mode 100644 index 0000000..7d2d12b --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BasicThreePartURLSetupControl.java @@ -0,0 +1,80 @@ +package com.quantum.wizards; + +import com.quantum.Messages; +import com.quantum.model.JDBCDriver; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + + +/** + * @author BC + */ +public class BasicThreePartURLSetupControl extends URLSetupControl { + + public BasicThreePartURLSetupControl(Composite parent, JDBCDriver driver) { + super(parent, driver); + } + + protected void createPart(Composite parent) { + + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + parent.setLayout(layout); + + Label label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "hostname")); + + Text hostNameText = new Text(parent, SWT.BORDER | SWT.SINGLE); + hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + hostNameText.setText(getProperty("hostname")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "port")); + + Text portText = new Text(parent, SWT.BORDER | SWT.SINGLE); + portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + portText.setText(getProperty("port")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "dbname")); + + Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE); + databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + databaseNameText.setText(getProperty("dbname")); + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "url")); + + final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE); + urlText.setEditable(false); + urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + urlText.setText(getConnectionURL()); + + hostNameText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("hostname", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + + portText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("port", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + + databaseNameText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("dbname", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BookmarkConnectionWizardPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BookmarkConnectionWizardPage.java index 25cbc3c..36a4077 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BookmarkConnectionWizardPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BookmarkConnectionWizardPage.java @@ -1,10 +1,17 @@ package com.quantum.wizards; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import com.quantum.Messages; +import com.quantum.model.JDBCDriver; + import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -12,9 +19,6 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; -import com.quantum.Messages; -import com.quantum.model.JDBCDriver; - class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { @@ -25,6 +29,20 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { private String connectionURL; private boolean prompt; + private Label jdbcLabel; + private Text jdbcUrl; + private URLSetupControl urlSetupControl; + private Composite container; + + private PropertyChangeListener listener = new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent event) { + if ("connectionURL".equals(event.getPropertyName())) { + BookmarkConnectionWizardPage.this.setConnectionURL((String) event.getNewValue()); + BookmarkConnectionWizardPage.this.updateButtonState(); + } + } + }; + /** * Constructor for BookmarkPage. * @param pageName @@ -40,7 +58,7 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); container.setLayout(layout); - layout.numColumns = 3; + layout.numColumns = 2; layout.verticalSpacing = 9; Label label = new Label(container, SWT.NULL); @@ -49,7 +67,6 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { GridData fullHorizontal = new GridData(GridData.FILL_HORIZONTAL); - fullHorizontal.horizontalSpan = 2; username.setLayoutData(fullHorizontal); username.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { @@ -64,7 +81,6 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { final Text password = new Text(container, SWT.BORDER | SWT.SINGLE); password.setEchoChar('*'); fullHorizontal = new GridData(GridData.FILL_HORIZONTAL); - fullHorizontal.horizontalSpan = 2; password.setLayoutData(fullHorizontal); password.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { @@ -77,23 +93,10 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { Button prompt = new Button(container, SWT.CHECK); prompt.setText(Messages.getString(getClass(), "prompt")); //$NON-NLS-1$ fullHorizontal = new GridData(GridData.FILL_HORIZONTAL); - fullHorizontal.horizontalSpan = 3; + fullHorizontal.horizontalSpan = 2; prompt.setLayoutData(fullHorizontal); - label = new Label(container, SWT.NULL); - label.setText(Messages.getString(getClass(), "url")); //$NON-NLS-1$ - - Text connect = new Text(container, SWT.BORDER | SWT.SINGLE); - fullHorizontal = new GridData(GridData.FILL_HORIZONTAL); - fullHorizontal.horizontalSpan = 2; - connect.setLayoutData(fullHorizontal); - connect.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent event) { - String connectionURL = ((Text) event.getSource()).getText(); - setConnectionURL(connectionURL); - updateButtonState(); - } - }); + createStandardJDBCWidgets(container); prompt.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { Button prompt = ((Button) event.getSource()); @@ -103,10 +106,31 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { } }); + this.container = container; setControl(container); } /** + * @param container + */ + private void createStandardJDBCWidgets(Composite container) { + setConnectionURL(""); + + this.jdbcLabel = new Label(container, SWT.NULL); + this.jdbcLabel.setText(Messages.getString(getClass(), "url")); //$NON-NLS-1$ + + this.jdbcUrl = new Text(container, SWT.BORDER | SWT.SINGLE); + this.jdbcUrl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + this.jdbcUrl.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + setConnectionURL(((Text) event.getSource()).getText()); + updateButtonState(); + } + }); + + updateButtonState(); + } + /** * @return Returns the driver. */ public JDBCDriver getDriver() { @@ -116,7 +140,75 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage { * @param driver The driver to set. */ public void setDriver(JDBCDriver driver) { + String oldDriverClassName = this.driver == null ? null : this.driver.getClassName(); this.driver = driver; + + if (oldDriverClassName == null + || !oldDriverClassName.equals(this.driver.getClassName())) { + rebuildJDBCControls(this.driver); + } + } + /** + * + */ + private void rebuildJDBCControls(JDBCDriver driver) { + Point windowSize = getShell().getSize(); + Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); + + if (URLSetupControlFactory.hasControl(driver)) { + disposeOfCurrentJDBCControls(); + + this.urlSetupControl = URLSetupControlFactory.create(driver, this.container); + GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); + data.horizontalSpan = 2; + this.urlSetupControl.setLayoutData(data); + + this.urlSetupControl.addPropertyChangeListener(this.listener); + + setConnectionURL(this.urlSetupControl.getConnectionURL()); + updateButtonState(); + + resizeWindow(windowSize, oldSize); + this.container.layout(); + + } else if (this.jdbcLabel == null || this.jdbcUrl == null) { + + disposeOfCurrentJDBCControls(); + createStandardJDBCWidgets(this.container); + + resizeWindow(windowSize, oldSize); + + this.container.layout(); + } + this.container.setVisible(true); + this.container.redraw(); + } + + /** + * @param windowSize + * @param oldSize + */ + private void resizeWindow(Point windowSize, Point oldSize) { + Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); + if (newSize.y > windowSize.y) { + getShell().setSize( + new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); + } + } + private void disposeOfCurrentJDBCControls() { + if (this.jdbcUrl != null) { + this.jdbcUrl.dispose(); + this.jdbcUrl = null; + } + if (this.jdbcLabel != null) { + this.jdbcLabel.dispose(); + this.jdbcLabel = null; + } + if (this.urlSetupControl != null) { + this.urlSetupControl.removePropertyChangeListener(this.listener); + this.urlSetupControl.dispose(); + this.urlSetupControl = null; + } } /** * diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/DeleteRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/DeleteRowPage.java index e259f76..10d1fda 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/DeleteRowPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/DeleteRowPage.java @@ -30,45 +30,32 @@ public class DeleteRowPage extends BaseSQLPage implements SQLPage { public void createControl(Composite parent) { System.out.println("page create control"); //$NON-NLS-1$ - Composite container = new Composite(parent, SWT.NULL); + Composite container = new Composite(parent, SWT.V_SCROLL); GridLayout layout = new GridLayout(); container.setLayout(layout); layout.numColumns = 3; - if (row == null) { - System.out.println("Row is null"); //$NON-NLS-1$ - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); //$NON-NLS-1$ - } - if (row.getTableData() == null) { - System.out.println("Data is null"); //$NON-NLS-1$ - } - Entity entity = row.getEntity(); - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); //$NON-NLS-1$ //$NON-NLS-2$ - System.out.println("column = " + i + "=" + columnNames[i]); //$NON-NLS-1$ //$NON-NLS-2$ - } - values = new Text[row.getColumnCount()]; - whereValues = new Button[row.getColumnCount()]; + Entity entity = this.results.getEntity(); + columnNames = this.results.getColumnNames(); + + values = new Text[columnNames.length]; + whereValues = new Button[columnNames.length]; new Label(container, SWT.NULL).setText(Messages.getString("DeleteRowPage.ColumnName")); //$NON-NLS-1$ new Label(container, SWT.NULL).setText(Messages.getString("DeleteRowPage.Value")); //$NON-NLS-1$ new Label(container, SWT.NULL).setText(Messages.getString("DeleteRowPage.IncludeIn")); //$NON-NLS-1$ - for (int i = 0; i < row.getColumnCount(); i++) { + for (int i = 0; i < columnNames.length; i++) { Label label = new Label(container, SWT.NULL); label.setText(columnNames[i]); values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData fullHorizontal = new GridData(); - fullHorizontal.horizontalAlignment = GridData.FILL; - values[i].setLayoutData(fullHorizontal); - values[i].setText(data[i]); - + Object object = this.row == null ? null : this.row.get(i+1); + values[i].setText(object == null ? "" : object.toString()); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.widthHint = 150; + values[i].setLayoutData(gridData); values[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { + public void modifyText(ModifyEvent event) { updateQuery(); - } + } }); whereValues[i] = new Button(container, SWT.CHECK); @@ -102,8 +89,8 @@ public class DeleteRowPage extends BaseSQLPage implements SQLPage { public void updateQuery() { System.out.println(Messages.getString("DeleteRowPage.UpdatingQuery")); //$NON-NLS-1$ StringBuffer whereClause = new StringBuffer(); - Bookmark bookmark = row.getBookmark(); - Entity entity = row.getEntity(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); DatabaseAdapter adapter = bookmark.getAdapter(); int numSelected = 0; @@ -118,7 +105,7 @@ public class DeleteRowPage extends BaseSQLPage implements SQLPage { whereClause.append(")"); //$NON-NLS-1$ } } - String query = "DELETE FROM " + row.getTable(); //$NON-NLS-1$ + String query = "DELETE FROM " + this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ if (numSelected > 0) { query += " WHERE " + whereClause.toString(); //$NON-NLS-1$ } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java new file mode 100644 index 0000000..91e8f0b --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InformixURLSetupControl.java @@ -0,0 +1,95 @@ +package com.quantum.wizards; + +import com.quantum.Messages; +import com.quantum.model.JDBCDriver; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + + +/** + * @author BC + */ +public class InformixURLSetupControl extends URLSetupControl { + + public InformixURLSetupControl(Composite parent, JDBCDriver driver) { + super(parent, driver); + } + + protected void createPart(Composite parent) { + + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + parent.setLayout(layout); + + Label label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "hostname")); + + Text hostNameText = new Text(parent, SWT.BORDER | SWT.SINGLE); + hostNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + hostNameText.setText(getProperty("hostname")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "port")); + + Text portText = new Text(parent, SWT.BORDER | SWT.SINGLE); + portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + portText.setText(getProperty("port")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "dbname")); + + Text databaseNameText = new Text(parent, SWT.BORDER | SWT.SINGLE); + databaseNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + databaseNameText.setText(getProperty("dbname")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(InformixURLSetupControl.class, "informixserver")); + + Text serverText = new Text(parent, SWT.BORDER | SWT.SINGLE); + serverText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + serverText.setText(getProperty("informixserver")); + + label = new Label(parent, SWT.NONE); + label.setText(Messages.getString(URLSetupControl.class, "url")); + + final Text urlText = new Text(parent, SWT.BORDER | SWT.SINGLE); + urlText.setEditable(false); + urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + urlText.setText(getConnectionURL()); + + hostNameText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("hostname", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + + portText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("port", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + + databaseNameText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("dbname", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + + serverText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent event) { + putProperty("informixserver", ((Text) event.getSource()).getText()); + urlText.setText(getConnectionURL()); + } + }); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InsertRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InsertRowPage.java index 91c55d0..ecaf832 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InsertRowPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/InsertRowPage.java @@ -26,36 +26,22 @@ public class InsertRowPage extends BaseSQLPage implements SQLPage { public void createControl(Composite parent) { System.out.println("page create control"); //$NON-NLS-1$ - Composite container = new Composite(parent, SWT.NULL); + Composite container = new Composite(parent, SWT.V_SCROLL); GridLayout layout = new GridLayout(); container.setLayout(layout); layout.numColumns = 2; - if (row == null) { - System.out.println("Row is null"); //$NON-NLS-1$ - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); //$NON-NLS-1$ - } - if (row.getTableData() == null) { - System.out.println("Data is null"); //$NON-NLS-1$ - } - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); //$NON-NLS-1$ //$NON-NLS-2$ - System.out.println("column = " + i + "=" + columnNames[i]); //$NON-NLS-1$ //$NON-NLS-2$ - } - values = new Text[row.getColumnCount()]; + columnNames = this.results.getColumnNames(); + values = new Text[columnNames.length]; new Label(container, SWT.NULL).setText(Messages.getString("InsertRowPage.ColumnName")); //$NON-NLS-1$ new Label(container, SWT.NULL).setText(Messages.getString("InsertRowPage.Value")); //$NON-NLS-1$ - for (int i = 0; i < row.getColumnCount(); i++) { + for (int i = 0; i < columnNames.length; i++) { Label label = new Label(container, SWT.NULL); label.setText(columnNames[i]); values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData fullHorizontal = new GridData(); - fullHorizontal.horizontalAlignment = GridData.FILL; - values[i].setLayoutData(fullHorizontal); + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.widthHint = 150; + values[i].setLayoutData(gridData); //values[i].setText(data[i]); values[i].addModifyListener(new ModifyListener() { @@ -82,8 +68,8 @@ public class InsertRowPage extends BaseSQLPage implements SQLPage { System.out.println("Updating query"); //$NON-NLS-1$ StringBuffer valuesClause = new StringBuffer(); StringBuffer namesClause = new StringBuffer(); - Bookmark bookmark = row.getBookmark(); - Entity entity = row.getEntity(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); DatabaseAdapter adapter = bookmark.getAdapter(); numColumns = 0; @@ -101,7 +87,7 @@ public class InsertRowPage extends BaseSQLPage implements SQLPage { } } - String query = "INSERT INTO " + row.getTable(); //$NON-NLS-1$ + String query = "INSERT INTO " + this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ if (numColumns > 0) { query += " (" + namesClause + ")"; query += " VALUES " + "(" + valuesClause; //$NON-NLS-1$ @@ -115,5 +101,4 @@ public class InsertRowPage extends BaseSQLPage implements SQLPage { protected String getQueryText() { return this.query.getText(); } - } \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/JDBCDriverSelectionWizardPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/JDBCDriverSelectionWizardPage.java index 7770614..9eb092f 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/JDBCDriverSelectionWizardPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/JDBCDriverSelectionWizardPage.java @@ -28,7 +28,7 @@ public class JDBCDriverSelectionWizardPage extends PropertyChangeWizardPage impl /** * @param pageName */ - protected JDBCDriverSelectionWizardPage(String pageName) { + public JDBCDriverSelectionWizardPage(String pageName) { super(pageName); setTitle(Messages.getString(getClass(), "title")); diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPDeleteRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPDeleteRowPage.java deleted file mode 100644 index 6dc8db2..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPDeleteRowPage.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.quantum.wizards; - -import java.text.MessageFormat; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import com.quantum.QuantumPlugin; -import com.quantum.sql.TableRow; -//import com.quantum.view.PHPSourceConsole; -import com.quantum.view.tableview.TableAdapter; - -public class PHPDeleteRowPage extends WizardPage implements SQLPage { - TableRow row; - String[] columnNames; - Text[] values; - Button[] whereValues; - Label query; - IPreferenceStore fStore; - private final static boolean DEBUG = false; - - public PHPDeleteRowPage(String pageName) { - super(pageName); - } - - public void init(TableRow row, TableAdapter adapter) { - this.row = row; - } - - public void createControl(Composite parent) { - System.out.println("page create control"); - fStore = QuantumPlugin.getDefault().getPreferenceStore(); - Composite container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - int layoutColumns = 3; - layout.numColumns = layoutColumns; - - if (DEBUG) { - if (row == null) { - System.out.println("Row is null"); - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); - } - if (row.getTableData() == null) { - System.out.println("Data is null"); - } - } - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - if (DEBUG) { - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); - System.out.println("column = " + i + "=" + columnNames[i]); - } - } - values = new Text[row.getColumnCount()]; - whereValues = new Button[row.getColumnCount()]; - Label temp = new Label(container, SWT.NULL); - temp.setText("Column Name"); - temp = new Label(container, SWT.NULL); - temp.setText("Value"); - temp = new Label(container, SWT.NULL); - temp.setText("Include in?"); - for (int i = 0; i < row.getColumnCount(); i++) { - Label label = new Label(container, SWT.NULL); - label.setText(columnNames[i]); - values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData fullHorizontal = new GridData(); - fullHorizontal.horizontalAlignment = GridData.FILL; - values[i].setLayoutData(fullHorizontal); - - if (data[i] == null || data[i].equals("")) { - values[i].setText('$' + columnNames[i]); - } else { - values[i].setText(data[i]); - } - - values[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateQuery(); - } - }); - - whereValues[i] = new Button(container, SWT.CHECK); - whereValues[i].setText("Where clause"); - whereValues[i].addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - updateQuery(); - } - }); - } - query = new Label(container, SWT.WRAP); - GridData gridData = new GridData(); - gridData.horizontalSpan = layoutColumns; - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - query.setLayoutData(gridData); - - setControl(container); - updateQuery(); - - setPageComplete(true); - } - public void updateQuery() { - if (DEBUG) { - System.out.println("Updating delete query"); - } - StringBuffer whereClause = new StringBuffer(); - int numSelected = 0; - boolean first = false; - for (int i = 0; i < columnNames.length; i++) { - if (whereValues[i].getSelection()) { - numSelected++; - if (first) { - whereClause.append(", "); - } - - whereClause.append(columnNames[i]); - whereClause.append(" = "); - whereClause.append("'" + values[i].getText() + "'"); - - first = true; - } - } - // if (whereClause.length() > 1) { - // whereClause.deleteCharAt(whereClause.length() - 1); - // whereClause.deleteCharAt(whereClause.length() - 1); - // } - - String[] arguments = { row.getTable(), whereClause.toString()}; - MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.delete.template")); - - String query = form.format(arguments); - - // String query = "$results = mysql_query(\"DELETE FROM " + row.getTable(); - // if (numSelected > 0) { - // query += " WHERE " + whereClause.toString() + "\");"; - // } else { - // query += "\");"; - // } - - if (numSelected > 0) { - setMessage(""); - } else { - setMessage("Warning: no \"where clause\" columns selected, all rows will be deleted"); - } - - this.getControl().pack(); - this.query.setText(query); - } - public boolean performFinish() { -// PHPSourceConsole console = PHPSourceConsole.getInstance(); -// console.clear(); -// console.print(query.getText()); - QuantumPlugin.getDefault().getSysClip().setContents( - new Object[] { query.getText() }, - new Transfer[] { TextTransfer.getInstance()}); - return true; - } -} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPInsertRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPInsertRowPage.java deleted file mode 100644 index 3436157..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPInsertRowPage.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.quantum.wizards; - -import java.text.MessageFormat; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import com.quantum.QuantumPlugin; -import com.quantum.sql.TableRow; -//import com.quantum.view.PHPSourceConsole; -import com.quantum.view.tableview.TableAdapter; - -public class PHPInsertRowPage extends WizardPage implements SQLPage { - TableRow row; - String[] columnNames; - Text[] values; - Label query; - private final static boolean DEBUG = false; - private IPreferenceStore fStore; - - public PHPInsertRowPage(String pageName) { - super(pageName); - } - - public void init(TableRow row, TableAdapter adapter) { - this.row = row; - } - - public void createControl(Composite parent) { - if (DEBUG) { - System.out.println("page create control"); - } - fStore = QuantumPlugin.getDefault().getPreferenceStore(); - Composite container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - int layoutColumns = 2; - layout.numColumns = layoutColumns; - - if (DEBUG) { - if (row == null) { - System.out.println("Row is null"); - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); - } - if (row.getTableData() == null) { - System.out.println("Data is null"); - } - } - - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - if (DEBUG) { - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); - System.out.println("column = " + i + "=" + columnNames[i]); - } - } - values = new Text[row.getColumnCount()]; - Label temp = new Label(container, SWT.NULL); - temp.setText("Column Name"); - temp = new Label(container, SWT.NULL); - temp.setText("Value"); - for (int i = 0; i < row.getColumnCount(); i++) { - Label label = new Label(container, SWT.NULL); - label.setText(columnNames[i]); - values[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData fullHorizontal = new GridData(); - fullHorizontal.horizontalAlignment = GridData.FILL; - values[i].setLayoutData(fullHorizontal); - - //values[i].setText(data[i]); - values[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateQuery(); - } - }); - } - query = new Label(container, SWT.WRAP); - GridData gridData = new GridData(); - gridData.horizontalSpan = layoutColumns; - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - query.setLayoutData(gridData); - - setControl(container); - updateQuery(); - - setPageComplete(true); - } - public void updateQuery() { - if (DEBUG) { - System.out.println("Updating insert query"); - } - StringBuffer fieldClause = new StringBuffer(); - - StringBuffer valuesClause = new StringBuffer(); - String text; - boolean first = false; - for (int i = 0; i < columnNames.length; i++) { - text = values[i].getText(); - if (!text.equals("")) { - if (first) { - valuesClause.append(", "); - fieldClause.append(", "); - } - valuesClause.append("'" + values[i].getText() + "'"); - fieldClause.append(columnNames[i]); - first = true; - } - } - // if (valuesClause.length() > 1) { - // valuesClause.deleteCharAt(valuesClause.length() - 1); - // valuesClause.deleteCharAt(valuesClause.length() - 1); - // } - String[] arguments = { row.getTable(), fieldClause.toString(), valuesClause.toString()}; - MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.insert.template")); - - String query = form.format(arguments); - - // String query = "$results = mysql_query(\"INSERT INTO " + row.getTable() + " ("; - // query += fieldClause.toString() + ") "; - // query += " VALUES (" + valuesClause.toString(); - // query += ")\");"; - this.query.setText(query); - } - public boolean performFinish() { -// PHPSourceConsole console = PHPSourceConsole.getInstance(); -// console.clear(); -// console.print(query.getText()); - QuantumPlugin.getDefault().getSysClip().setContents( - new Object[] { query.getText() }, - new Transfer[] { TextTransfer.getInstance()}); - return true; - } -} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPSelectRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPSelectRowPage.java deleted file mode 100644 index 2f9e545..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPSelectRowPage.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.quantum.wizards; - -import java.text.MessageFormat; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import com.quantum.QuantumPlugin; -import com.quantum.sql.TableRow; -//import com.quantum.view.PHPSourceConsole; -import com.quantum.view.tableview.TableAdapter; - -public class PHPSelectRowPage extends WizardPage implements SQLPage { - TableRow row; - String[] columnNames; - Text[] whereValues; - // Text[] newValues; - Button[] primaryKeys; - Button[] setValues; - Label query; - IPreferenceStore fStore; - private final static boolean DEBUG = false; - - public PHPSelectRowPage(String pageName) { - super(pageName); - } - - public void init(TableRow row, TableAdapter adapter) { - this.row = row; - } - - public void createControl(Composite parent) { - if (DEBUG) { - System.out.println("page create control"); - } - Composite container = new Composite(parent, SWT.NULL); - fStore = QuantumPlugin.getDefault().getPreferenceStore(); - - GridLayout layout = new GridLayout(); - container.setLayout(layout); - int layoutColumns = 4; - layout.numColumns = layoutColumns; - - if (DEBUG) { - if (row == null) { - System.out.println("Row is null"); - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); - } - if (row.getTableData() == null) { - System.out.println("Data is null"); - } - } - - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); - System.out.println("column = " + i + "=" + columnNames[i]); - } - - whereValues = new Text[row.getColumnCount()]; - // newValues = new Text[row.getColumnCount()]; - primaryKeys = new Button[row.getColumnCount()]; - setValues = new Button[row.getColumnCount()]; - Label temp = new Label(container, SWT.NULL); - temp.setText("Column Name"); - temp = new Label(container, SWT.NULL); - temp.setText("Value"); - temp = new Label(container, SWT.NULL); - temp.setText("Where"); - // temp = new Label(container, SWT.NULL); - // temp.setText("New Value"); - temp = new Label(container, SWT.NULL); - temp.setText("Select"); - for (int i = 0; i < row.getColumnCount(); i++) { - Label label = new Label(container, SWT.NULL); - label.setText(columnNames[i]); - whereValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - if (data[i] == null || data[i].equals("")) { - whereValues[i].setText('$' + columnNames[i]); - } else { - whereValues[i].setText(data[i]); - } - - whereValues[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateQuery(); - } - }); - - primaryKeys[i] = new Button(container, SWT.CHECK); - //primaryKeys[i].setText("Where Clause"); - primaryKeys[i].addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - updateQuery(); - } - }); - // newValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - // newValues[i].setText(data[i]); - // newValues[i].addModifyListener(new ModifyListener() { - // public void modifyText(ModifyEvent e) { - // updateQuery(); - // } - // }); - setValues[i] = new Button(container, SWT.CHECK); - //setValues[i].setText("Select Value"); - setValues[i].addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - updateQuery(); - } - }); - } - query = new Label(container, SWT.WRAP); - GridData gridData = new GridData(); - gridData.horizontalSpan = layoutColumns; - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - query.setLayoutData(gridData); - - setControl(container); - updateQuery(); - - setPageComplete(true); - } - - public void updateQuery() { - if (DEBUG) { - System.out.println("PHP SELECT"); - } - StringBuffer setClause = new StringBuffer(); - StringBuffer whereClause = new StringBuffer(); - String temp; - boolean firstClause = false; - for (int i = 0; i < columnNames.length; i++) { - if (primaryKeys[i].getSelection()) { - if (firstClause) { - whereClause.append(" AND "); - } - firstClause = true; - whereClause.append(columnNames[i]); - whereClause.append(" = "); - temp = whereValues[i].getText(); - // if (temp.charAt(0) == '$') { - // whereClause.append(temp); - // } else { - whereClause.append("'" + temp + "'"); - // } - - } - if (setValues[i].getSelection()) { - setClause.append(columnNames[i]); - // setClause.append(" = "); - // setClause.append(newValues[i].getText()); - setClause.append(", "); - } - } - // if (whereClause.length() > 1) { - // whereClause.deleteCharAt(whereClause.length() - 1); - // whereClause.deleteCharAt(whereClause.length() - 1); - // } - if (setClause.length() > 1) { - setClause.deleteCharAt(setClause.length() - 1); - setClause.deleteCharAt(setClause.length() - 1); - } - - String[] arguments = { setClause.toString(), row.getTable(), whereClause.toString()}; - MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.select.template")); - - String query = form.format(arguments); - // String query = "$results = mysql_query(\"SELECT " + setClause.toString(); - // query += " FROM " + row.getTable(); - // query += " WHERE " + whereClause.toString() + "\");"; - this.query.setText(query); - } - - public boolean performFinish() { -// PHPSourceConsole console = PHPSourceConsole.getInstance(); -// console.clear(); -// console.print(query.getText()); - QuantumPlugin.getDefault().getSysClip().setContents( - new Object[] { query.getText() }, - new Transfer[] { TextTransfer.getInstance()}); - return true; - } -} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPUpdateRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPUpdateRowPage.java deleted file mode 100644 index 0767336..0000000 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/PHPUpdateRowPage.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.quantum.wizards; - -import java.text.MessageFormat; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import com.quantum.QuantumPlugin; -import com.quantum.sql.TableRow; -//import com.quantum.view.PHPSourceConsole; -import com.quantum.view.tableview.TableAdapter; - -public class PHPUpdateRowPage extends WizardPage implements SQLPage { - TableRow row; - String[] columnNames; - Text[] oldValues; - Text[] newValues; - Button[] primaryKeys; - Button[] setValues; - Label query; - IPreferenceStore fStore; - private final static boolean DEBUG = false; - - public PHPUpdateRowPage(String pageName) { - super(pageName); - } - - public void init(TableRow row, TableAdapter adapter) { - this.row = row; - } - - public void createControl(Composite parent) { - if (DEBUG) { - System.out.println("page create control"); - } - fStore = QuantumPlugin.getDefault().getPreferenceStore(); - Composite container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - int layoutColumns = 5; - layout.numColumns = layoutColumns; - - if (DEBUG) { - if (row == null) { - System.out.println("Row is null"); - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); - } - if (row.getTableData() == null) { - System.out.println("Data is null"); - } - } - - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - - if (DEBUG) { - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); - System.out.println("column = " + i + "=" + columnNames[i]); - } - } - - oldValues = new Text[row.getColumnCount()]; - newValues = new Text[row.getColumnCount()]; - primaryKeys = new Button[row.getColumnCount()]; - setValues = new Button[row.getColumnCount()]; - Label temp = new Label(container, SWT.NULL); - temp.setText("Column Name"); - temp = new Label(container, SWT.NULL); - temp.setText("Where Value"); - temp = new Label(container, SWT.NULL); - temp.setText("Where"); - temp = new Label(container, SWT.NULL); - temp.setText("Set Value"); - temp = new Label(container, SWT.NULL); - temp.setText("Set"); - for (int i = 0; i < row.getColumnCount(); i++) { - Label label = new Label(container, SWT.NULL); - label.setText(columnNames[i]); - oldValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - if (data[i] == null || data[i].equals("")) { - oldValues[i].setText('$' + columnNames[i]); - } else { - oldValues[i].setText(data[i]); - } - oldValues[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateQuery(); - } - }); - primaryKeys[i] = new Button(container, SWT.CHECK); - // primaryKeys[i].setText("Where"); - primaryKeys[i].addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - updateQuery(); - } - }); - newValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - - if (data[i] == null || data[i].equals("")) { - newValues[i].setText('$' + columnNames[i]); - } else { - newValues[i].setText(data[i]); - } - newValues[i].addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateQuery(); - } - }); - setValues[i] = new Button(container, SWT.CHECK); - // setValues[i].setText("Set Value"); - setValues[i].addSelectionListener(new SelectionListener() { - public void widgetDefaultSelected(SelectionEvent e) { - } - public void widgetSelected(SelectionEvent e) { - updateQuery(); - } - }); - } - query = new Label(container, SWT.WRAP); - GridData gridData = new GridData(); - gridData.horizontalSpan = layoutColumns; - gridData.horizontalAlignment = GridData.FILL; - gridData.verticalAlignment = GridData.FILL; - gridData.grabExcessHorizontalSpace = true; - gridData.grabExcessVerticalSpace = true; - query.setLayoutData(gridData); - - setControl(container); - updateQuery(); - - setPageComplete(true); - } - - public void updateQuery() { - if (DEBUG) { - System.out.println("Updating update query"); - } - - StringBuffer setClause = new StringBuffer(); - StringBuffer whereClause = new StringBuffer(); - for (int i = 0; i < columnNames.length; i++) { - if (primaryKeys[i].getSelection()) { - whereClause.append(columnNames[i]); - whereClause.append(" = "); - whereClause.append("'" + oldValues[i].getText() + "'"); - whereClause.append(", "); - } - if (setValues[i].getSelection()) { - setClause.append(columnNames[i]); - setClause.append(" = "); - setClause.append("'" + newValues[i].getText() + "'"); - setClause.append(", "); - } - } - if (whereClause.length() > 1) { - whereClause.deleteCharAt(whereClause.length() - 1); - whereClause.deleteCharAt(whereClause.length() - 1); - } - if (setClause.length() > 1) { - setClause.deleteCharAt(setClause.length() - 1); - setClause.deleteCharAt(setClause.length() - 1); - } - String[] arguments = { row.getTable(), setClause.toString(), whereClause.toString()}; - MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.update.template")); - - String query = form.format(arguments); - // - // String query = "$results = mysql_query(\"UPDATE " + row.getTable(); - // query += " SET " + setClause.toString(); - // query += " WHERE " + whereClause.toString() + "\");"; - this.query.setText(query); - } - public boolean performFinish() { -// PHPSourceConsole console = PHPSourceConsole.getInstance(); -// console.clear(); -// console.print(query.getText()); - QuantumPlugin.getDefault().getSysClip().setContents( - new Object[] { query.getText() }, - new Transfer[] { TextTransfer.getInstance()}); - return true; - } -} \ No newline at end of file diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLPage.java index 32b4322..69dc029 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLPage.java @@ -1,11 +1,10 @@ package com.quantum.wizards; -import com.quantum.sql.TableRow; -import com.quantum.view.tableview.TableAdapter; +import com.quantum.sql.SQLResultSetResults; import org.eclipse.jface.wizard.IWizardPage; public interface SQLPage extends IWizardPage { - public void init(TableRow row, TableAdapter adapter); + public void init(SQLResultSetResults results, SQLResultSetResults.Row row); public boolean performFinish(); } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLRowWizard.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLRowWizard.java index bc37001..aa317c4 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLRowWizard.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SQLRowWizard.java @@ -1,19 +1,20 @@ package com.quantum.wizards; -import com.quantum.sql.TableRow; -import com.quantum.view.tableview.TableAdapter; +import com.quantum.sql.SQLResultSetResults; import org.eclipse.jface.wizard.Wizard; public class SQLRowWizard extends Wizard { - SQLPage page; - TableRow row; - TableAdapter adapter; - public void init(String title, SQLPage page, TableRow row, TableAdapter adapter) { + protected SQLPage page; + protected SQLResultSetResults.Row row; + private SQLResultSetResults results; + + public void init(String title, SQLPage page, + SQLResultSetResults results, SQLResultSetResults.Row row) { System.out.println("Init SQL row wizard"); //$NON-NLS-1$ this.row = row; - this.adapter = adapter; this.page = page; + this.results = results; setWindowTitle(title); } public boolean performFinish() { @@ -22,7 +23,7 @@ public class SQLRowWizard extends Wizard { } public void addPages() { System.out.println("QL row wizard adding pages"); //$NON-NLS-1$ - page.init(row, adapter); + page.init(this.results, this.row); addPage(page); } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SortFilterPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SortFilterPage.java index c23d03e..4447e10 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SortFilterPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SortFilterPage.java @@ -1,9 +1,11 @@ package com.quantum.wizards; +import java.sql.SQLException; + import com.quantum.sql.FilterSort; -import com.quantum.sql.TableRow; -import com.quantum.view.tableview.TableAdapter; -import com.quantum.view.tableview.TableView; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.ui.dialog.ExceptionDisplayDialog; +import com.quantum.util.connection.ConnectionUtil; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; @@ -20,25 +22,27 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class SortFilterPage extends WizardPage implements SQLPage { - TableRow row; - TableAdapter adapter; Button[] filter; Combo[] operator; Text[] filterValues; Button[] stringFlags; Button[] sort; Combo[] ascDesc; + private SQLResultSetResults.Row row; + + private ConnectionUtil connectionUtil = new ConnectionUtil(); String columnNames[]; Label query; FilterSort filterSort = new FilterSort(); + private SQLResultSetResults results; public SortFilterPage(String pageName) { super(pageName); } - public void init(TableRow row, TableAdapter adapter) { + public void init(SQLResultSetResults results, SQLResultSetResults.Row row) { + this.results = results; this.row = row; - this.adapter = adapter; } public void createControl(Composite parent) { @@ -50,30 +54,16 @@ public class SortFilterPage extends WizardPage implements SQLPage { int layoutColumns = 6; layout.numColumns = layoutColumns; - if (row == null) { - System.out.println("Row is null"); //$NON-NLS-1$ - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); //$NON-NLS-1$ - } - if (row.getTableData() == null) { - System.out.println("Data is null"); //$NON-NLS-1$ - } + columnNames = this.results.getColumnNames(); - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); //$NON-NLS-1$ //$NON-NLS-2$ - System.out.println("column = " + i + "=" + columnNames[i]); //$NON-NLS-1$ //$NON-NLS-2$ - } - int size = row.getColumnCount(); + int size = this.results.getColumnCount(); filter = new Button[size]; operator = new Combo[size]; filterValues = new Text[size]; stringFlags = new Button[size]; sort = new Button[size]; ascDesc = new Combo[size]; - for (int i = 0; i < row.getColumnCount(); i++) { + for (int i = 0; i < size; i++) { filter[i] = new Button(container, SWT.CHECK); filter[i].setText(columnNames[i]); filter[i].addSelectionListener(new SelectionListener() { @@ -98,7 +88,8 @@ public class SortFilterPage extends WizardPage implements SQLPage { }); filterValues[i] = new Text(container, SWT.BORDER); - filterValues[i].setText(data[i]); + Object data = this.row == null ? null : this.row.get(i+1); + filterValues[i].setText(data == null ? "" : data.toString()); filterValues[i].addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { updateQuery(); @@ -173,8 +164,14 @@ public class SortFilterPage extends WizardPage implements SQLPage { } public boolean performFinish() { - adapter.setFilterSort(filterSort); - TableView.getInstance().refreshCurrent(); - return true; + this.results.setFilterSort(filterSort); + try { + this.results.refresh(this.connectionUtil.connect( + this.results.getBookmark(), getShell())); + return true; + } catch (SQLException e) { + ExceptionDisplayDialog.openError(getShell(), null, null, e); + return false; + } } } diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLBuilder.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLBuilder.java new file mode 100644 index 0000000..a22233a --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLBuilder.java @@ -0,0 +1,67 @@ +package com.quantum.wizards; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + + +/** + *

This class takes a URL pattern and creates a full URL. A URL pattern might look + * like this: jdbc:postgresql://{hostname}:{port}/{dbname}, and the + * properties should include "hostname", "port" and "dbname". + * + * @author BC Holmes + */ +public class URLBuilder { + + public static String createURL(String urlPattern, Map properties) { + StringBuffer buffer = new StringBuffer(); + boolean isVariable = false; + String variableName = null; + for (StringTokenizer tokenizer = new StringTokenizer(urlPattern, "{}", true); + tokenizer.hasMoreTokens(); ) { + String token = tokenizer.nextToken(); + + if ("{".equals(token) && !isVariable) { + isVariable = true; + } else if (isVariable && "}".equals(token) && variableName != null) { + if (!properties.containsKey(variableName)) { + buffer.append("{"); + buffer.append(variableName); + buffer.append("}"); + } else { + buffer.append(properties.get(variableName)); + } + isVariable = false; + } else if (isVariable) { + variableName = token; + } else { + buffer.append(token); + } + } + return buffer.toString(); + } + + public static String[] getVariableNames(String urlPattern) { + List list = new ArrayList(); + if (urlPattern != null) { + boolean isVariable = false; + String variableName = null; + for (StringTokenizer tokenizer = new StringTokenizer(urlPattern, "{}", true); + tokenizer.hasMoreTokens(); ) { + String token = tokenizer.nextToken(); + + if ("{".equals(token) && !isVariable) { + isVariable = true; + } else if (isVariable && "}".equals(token) && variableName != null) { + list.add(variableName); + isVariable = false; + } else if (isVariable) { + variableName = token; + } + } + } + return (String[]) list.toArray(new String[list.size()]); + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControl.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControl.java new file mode 100644 index 0000000..b689441 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControl.java @@ -0,0 +1,112 @@ +package com.quantum.wizards; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import com.quantum.Messages; +import com.quantum.adapters.AdapterFactory; +import com.quantum.adapters.DatabaseAdapter; +import com.quantum.model.JDBCDriver; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; + + +/** + * @author BC + */ +public abstract class URLSetupControl extends Composite { + + private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); + private String urlPattern; + private Map properties = Collections.synchronizedMap(new HashMap()); + private final JDBCDriver driver; + private String connectionURL; + + /** + * @param parent + * @param style + */ + public URLSetupControl(Composite parent, JDBCDriver driver) { + super(parent, SWT.NONE); + this.driver = driver; + GridLayout layout = new GridLayout(); + setLayout(layout); + this.urlPattern = AdapterFactory.getInstance().getURLPattern(driver.getClassName()); + + setPropertyDefaults(); + setConnectionURL(URLBuilder.createURL(this.urlPattern, getProperties())); + } + + /** + * + */ + protected void createPart() { + Group group = new Group(this, SWT.SHADOW_ETCHED_IN); + group.setText(Messages.getString(URLSetupControl.class, "text")); + group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); + + createPart(group); + } + + /** + * + */ + private void setPropertyDefaults() { + DatabaseAdapter adapter = + AdapterFactory.getInstance().getAdapter(getDriver().getType()); + Map properties = (adapter == null) ? new HashMap() : adapter.getDefaultConnectionParameters(); + for (Iterator i = properties.keySet().iterator(); i.hasNext();) { + String key = (String) i.next(); + putProperty(key, (String) properties.get(key)); + + } + } + + protected abstract void createPart(Composite parent); + + private Map getProperties() { + return this.properties; + } + + protected String getProperty(String name) { + String value = (String) this.properties.get(name); + return value == null ? "" : value; + } + + protected void putProperty(String name, String value) { + this.properties.put(name, value); + setConnectionURL(URLBuilder.createURL(this.urlPattern, getProperties())); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.addPropertyChangeListener(listener); + } + public void removePropertyChangeListener(PropertyChangeListener listener) { + this.propertyChangeSupport.removePropertyChangeListener(listener); + } + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + this.propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue); + } + + protected JDBCDriver getDriver() { + return this.driver; + } + public String getConnectionURL() { + return this.connectionURL == null ? "" : this.connectionURL; + } + public void setConnectionURL(String connectionURL) { + if (connectionURL != null && !connectionURL.equals(this.connectionURL)) { + String original = this.connectionURL; + this.connectionURL = connectionURL; + firePropertyChange("connectionURL", original, connectionURL); + } + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControlFactory.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControlFactory.java new file mode 100644 index 0000000..0b204d5 --- /dev/null +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/URLSetupControlFactory.java @@ -0,0 +1,80 @@ +package com.quantum.wizards; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.quantum.adapters.AdapterFactory; +import com.quantum.model.JDBCDriver; + +import org.eclipse.swt.widgets.Composite; + + +/** + * @author BC Holmes + */ +public class URLSetupControlFactory { + + public static boolean hasControl(JDBCDriver driver) { + return null != getControlClass(driver); + } + + public static URLSetupControl create(JDBCDriver driver, Composite composite) { + Class controlClass = getControlClass(driver); + + if (BasicThreePartURLSetupControl.class == controlClass) { + URLSetupControl control = new BasicThreePartURLSetupControl(composite, driver); + control.createPart(); + return control; + } else if (BasicOnePartURLSetupControl.class == controlClass) { + String[] properties = getProperties(driver); + URLSetupControl control = new BasicOnePartURLSetupControl(composite, driver, properties[0]); + control.createPart(); + return control; + } else if (InformixURLSetupControl.class == controlClass) { + URLSetupControl control = new InformixURLSetupControl(composite, driver); + control.createPart(); + return control; + } else { + return null; + } + } + + private static Class getControlClass(JDBCDriver driver) { + String[] parameters = getProperties(driver); + List parametersList = new ArrayList(); + if (parameters != null) { + parametersList.addAll(Arrays.asList(parameters)); + } + + if (parametersList.size() == 3 + && parametersList.contains("dbname") + && parametersList.contains("hostname") + && parametersList.contains("port")) { + return BasicThreePartURLSetupControl.class; + } else if (parametersList.size() == 4 + && parametersList.contains("dbname") + && parametersList.contains("hostname") + && parametersList.contains("informixserver") + && parametersList.contains("port")) { + return InformixURLSetupControl.class; + } else if (parametersList.size() == 1 + && (parametersList.contains("dbname") + || parametersList.contains("datasource"))) { + return BasicOnePartURLSetupControl.class; + } else { + return null; + } + } + + /** + * @param driver + * @return + */ + private static String[] getProperties(JDBCDriver driver) { + String driverClassName = driver.getClassName(); + String urlPattern = AdapterFactory.getInstance().getURLPattern(driverClassName); + String[] parameters = URLBuilder.getVariableNames(urlPattern); + return parameters; + } +} diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/UpdateRowPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/UpdateRowPage.java index e1dd3c5..3753b7c 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/UpdateRowPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/UpdateRowPage.java @@ -15,6 +15,7 @@ import org.eclipse.swt.widgets.Text; import com.quantum.Messages; import com.quantum.adapters.DatabaseAdapter; import com.quantum.model.Bookmark; +import com.quantum.model.Column; import com.quantum.model.Entity; public class UpdateRowPage extends BaseSQLPage implements SQLPage { @@ -33,30 +34,16 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { Composite container = new Composite(parent, SWT.V_SCROLL); GridLayout layout = new GridLayout(); container.setLayout(layout); - Entity entity = row.getEntity(); + Entity entity = this.results.getEntity(); int layoutColumns = 5; layout.numColumns = layoutColumns; - if (row == null) { - System.out.println("Row is null"); //$NON-NLS-1$ - } - if (row.getColumnNames() == null) { - System.out.println("Columns are null"); //$NON-NLS-1$ - } - if (row.getTableData() == null) { - System.out.println("Data is null"); //$NON-NLS-1$ - } - columnNames = row.getColumnNames(); - String[] data = row.getTableData(); - for (int i = 0; i < row.getColumnCount(); i++) { - System.out.println("data = " + i + "=" + data[i]); //$NON-NLS-1$ //$NON-NLS-2$ - System.out.println("column = " + i + "=" + columnNames[i]); //$NON-NLS-1$ //$NON-NLS-2$ - } - oldValues = new Text[row.getColumnCount()]; - newValues = new Text[row.getColumnCount()]; - primaryKeys = new Button[row.getColumnCount()]; - setValues = new Button[row.getColumnCount()]; + columnNames = this.results.getColumnNames(); + oldValues = new Text[columnNames.length]; + newValues = new Text[columnNames.length]; + primaryKeys = new Button[columnNames.length]; + setValues = new Button[columnNames.length]; Label temp = new Label(container, SWT.NULL); temp.setText(Messages.getString("UpdateRowPage.ColumnName")); //$NON-NLS-1$ temp = new Label(container, SWT.NULL); @@ -67,11 +54,15 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { temp.setText(Messages.getString("UpdateRowPage.NewValue")); //$NON-NLS-1$ temp = new Label(container, SWT.NULL); temp.setText(Messages.getString("UpdateRowPage._13")); //$NON-NLS-1$ - for (int i = 0; i < row.getColumnCount(); i++) { + for (int i = 0; i < columnNames.length; i++) { Label label = new Label(container, SWT.NULL); label.setText(columnNames[i]); oldValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - oldValues[i].setText(data[i]); + GridData gridData = new GridData(); + gridData.widthHint = 100; + oldValues[i].setLayoutData(gridData); + Object data = this.row == null ? null : this.row.get(i+1); + oldValues[i].setText(data == null ? "" : data.toString()); oldValues[i].addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { updateQuery(); @@ -79,7 +70,8 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { }); primaryKeys[i] = new Button(container, SWT.CHECK); primaryKeys[i].setText("Where"); //$NON-NLS-1$ - if (entity != null && getColumn(entity, columnNames[i]).isPrimaryKey()) + Column column = (entity == null) ? null : getColumn(entity, columnNames[i]); + if (column != null && column.isPrimaryKey()) primaryKeys[i].setSelection(true); primaryKeys[i].addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { @@ -89,7 +81,10 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { } }); newValues[i] = new Text(container, SWT.BORDER | SWT.SINGLE); - newValues[i].setText(data[i]); + newValues[i].setText(data == null ? "" : data.toString()); + gridData = new GridData(); + gridData.widthHint = 100; + newValues[i].setLayoutData(gridData); newValues[i].addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { updateQuery(); @@ -123,8 +118,8 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { System.out.println("Updating query"); //$NON-NLS-1$ StringBuffer setClause = new StringBuffer(); StringBuffer whereClause = new StringBuffer(); - Bookmark bookmark = row.getBookmark(); - Entity entity = row.getEntity(); + Bookmark bookmark = this.results.getBookmark(); + Entity entity = this.results.getEntity(); DatabaseAdapter adapter = bookmark.getAdapter(); int numValuesSet = 0; @@ -149,7 +144,7 @@ public class UpdateRowPage extends BaseSQLPage implements SQLPage { numValuesSet++; } } - String query = "UPDATE " + row.getTable(); //$NON-NLS-1$ + String query = "UPDATE " + this.results.getEntity().getQuotedTableName(); //$NON-NLS-1$ query += " SET " + setClause.toString(); //$NON-NLS-1$ query += " WHERE " + whereClause.toString(); //$NON-NLS-1$ this.query.setText(query); diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java index 848a1ca..99fbfc5 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenSQLTableEditorAction.java @@ -45,240 +45,279 @@ import org.eclipse.ui.dialogs.ListSelectionDialog; import org.eclipse.ui.internal.dialogs.ListContentProvider; import com.quantum.QuantumPlugin; +import com.quantum.adapters.DatabaseAdapter; import com.quantum.model.Bookmark; import com.quantum.model.BookmarkCollection; import com.quantum.model.Entity; import com.quantum.model.EntityFactory; import com.quantum.model.NotConnectedException; +import com.quantum.sql.MultiSQLServer; +import com.quantum.sql.SQLResultSetCollection; +import com.quantum.sql.SQLResultSetResults; +import com.quantum.sql.SQLResults; +import com.quantum.ui.dialog.ExceptionDisplayDialog; import com.quantum.util.connection.ConnectionUtil; import com.quantum.view.tableview.TableView; -public class PHPOpenSQLTableEditorAction extends ActionDelegate - implements - IEditorActionDelegate { - - private IWorkbenchWindow fWindow; - private PHPEditor fEditor; - private IProject fProject; - - public void dispose() { - } - - public void init(IWorkbenchWindow window) { - this.fWindow = window; - } - - public void selectionChanged(IAction action, ISelection selection) { - if (!selection.isEmpty()) { - if (selection instanceof TextSelection) { - action.setEnabled(true); - } else if (fWindow.getActivePage() != null - && fWindow.getActivePage().getActivePart() != null) { - // - } - } - } - private IWorkbenchPage getActivePage() { - IWorkbenchWindow workbenchWindow = fEditor.getEditorSite() - .getWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - return page; - } - public IContainer getWorkingLocation(IFileEditorInput editorInput) { - if (editorInput == null || editorInput.getFile() == null) { - return null; - } - return editorInput.getFile().getParent(); - } - private IFile getIncludeFile(IProject project, - IFileEditorInput editorInput, String relativeFilename) { - // IContainer container = getWorkingLocation(editorInput); - // String fullPath = project.getLocation().toString(); - Path path = new Path(relativeFilename); - IFile file = project.getFile(path); - return file; - } - - public void run(IAction action) { - if (fEditor == null) { - IEditorPart targetEditor = fWindow.getActivePage() - .getActiveEditor(); - if (targetEditor != null && (targetEditor instanceof PHPEditor)) { - fEditor = (PHPEditor) targetEditor; - } - } - if (fEditor != null) { - // TableView view = TableView.getInstance(); - - // determine the current Project from a (file-based) Editor - IFile f = ((IFileEditorInput) fEditor.getEditorInput()).getFile(); - fProject = f.getProject(); - - ITextSelection selection = (ITextSelection) fEditor - .getSelectionProvider().getSelection(); - IDocument doc = fEditor.getDocumentProvider().getDocument( - fEditor.getEditorInput()); - int pos = selection.getOffset(); - // System.out.println(selection.getText()); - String tableName = getSQLTableName(doc, pos); - - IViewPart viewPart = null; - String view = "com.quantum.view.tableview.TableView"; - try { - IWorkbenchPage page = QuantumPlugin.getDefault() - .getActivePage(); - viewPart = page.findView(view); - if (viewPart == null) { - viewPart = page.showView(view); - } - page.bringToTop(viewPart); - getTables((TableView) viewPart, fProject, tableName); - } catch (PartInitException e) { - e.printStackTrace(); - } - - } - } - - public void setActiveEditor(IAction action, IEditorPart targetEditor) { - if (targetEditor != null && (targetEditor instanceof PHPEditor)) { - fEditor = (PHPEditor) targetEditor; - } - } - - private String getSQLTableName(IDocument doc, int pos) { - Point word = null; - int start = -1; - int end = -1; - - try { - - int position = pos; - char character; - - while (position >= 0) { - character = doc.getChar(position); - if (Character.isWhitespace(character) || (character == '\"') - || (character == '\'') || (character == '\r') - || (character == '\n')) - break; - --position; - } - - start = position; - - position = pos; - int length = doc.getLength(); - - while (position < length) { - character = doc.getChar(position); - if (Character.isWhitespace(character) || (character == '\"') - || (character == '\'') || (character == '\r') - || (character == '\n')) - break; - ++position; - } - - start++; - end = position; - - if (end > start) - word = new Point(start, end - start); - - } catch (BadLocationException x) { - } - - if (word != null) { - try { - return doc.get(word.x, word.y); - } catch (BadLocationException e) { - } - } - return ""; - } - - public void getTables(TableView tableView, IProject project, - String tableName) { - // Get The Database bookmark from the Quantum SQL plugin: - BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); - if (sqlBookMarks != null) { - String bookmarkString = Util.getMiscProjectsPreferenceValue( - project, IPreferenceConstants.PHP_BOOKMARK_DEFAULT); - if (bookmarkString != null && !bookmarkString.equals("")) { - Bookmark bookmark = sqlBookMarks.find(bookmarkString); - ArrayList sqlList = new ArrayList(); - if (bookmark != null && !bookmark.isConnected()) { - new ConnectionUtil().connect(bookmark, null); - } - if (bookmark != null && bookmark.isConnected()) { - try { - Connection connection = bookmark.getConnection(); - DatabaseMetaData metaData = connection.getMetaData(); - - if (metaData != null) { - String columnName; - String prefixWithoutDollar = tableName; - if (prefixWithoutDollar.charAt(0) == '$') { - prefixWithoutDollar = prefixWithoutDollar - .substring(1); - } - ResultSet set; - set = metaData.getTables(null, null, "%" - + prefixWithoutDollar+"%", null); - while (set.next()) { - tableName = set.getString("TABLE_NAME"); - tableName = (tableName == null) - ? "" - : tableName.trim(); - if (tableName != null && tableName.length() > 0) { - sqlList.add(tableName); - } - } - set.close(); - EntityFactory entityFactory = EntityFactory - .getInstance(); - if (sqlList.size() == 1) { - tableView.loadTable(entityFactory.create( - bookmark, null, - (String) sqlList.get(0), - Entity.TABLE_TYPE)); - } else if (sqlList.size() > 1) { - ListSelectionDialog listSelectionDialog = new ListSelectionDialog( - PHPeclipsePlugin.getDefault() - .getWorkbench() - .getActiveWorkbenchWindow() - .getShell(), sqlList, - new ListContentProvider(), - new LabelProvider(), - "Select the SQL to open."); - listSelectionDialog - .setTitle("Multiple tablenames found"); - if (listSelectionDialog.open() == Window.OK) { - Object[] locations = listSelectionDialog - .getResult(); - if (locations != null) { - for (int i = 0; i < locations.length; i++) { - tableView - .loadTable(entityFactory - .create( - bookmark, - null, - (String) locations[i], - Entity.TABLE_TYPE)); - } - - } - } - } - } - } catch (NotConnectedException e) { - // ignore this - not mission critical - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - } - } +public class PHPOpenSQLTableEditorAction extends ActionDelegate implements + IEditorActionDelegate { + + private IWorkbenchWindow fWindow; + + private PHPEditor fEditor; + + private IProject fProject; + + public void dispose() { + } + + public void init(IWorkbenchWindow window) { + this.fWindow = window; + } + + public void selectionChanged(IAction action, ISelection selection) { + if (!selection.isEmpty()) { + if (selection instanceof TextSelection) { + action.setEnabled(true); + } else if (fWindow.getActivePage() != null + && fWindow.getActivePage().getActivePart() != null) { + // + } + } + } + + private IWorkbenchPage getActivePage() { + fWindow = fEditor.getEditorSite() + .getWorkbenchWindow(); + IWorkbenchPage page = fWindow.getActivePage(); + return page; + } + + public IContainer getWorkingLocation(IFileEditorInput editorInput) { + if (editorInput == null || editorInput.getFile() == null) { + return null; + } + return editorInput.getFile().getParent(); + } + + private IFile getIncludeFile(IProject project, IFileEditorInput editorInput, + String relativeFilename) { + // IContainer container = getWorkingLocation(editorInput); + // String fullPath = project.getLocation().toString(); + Path path = new Path(relativeFilename); + IFile file = project.getFile(path); + return file; + } + + public void run(IAction action) { + if (fEditor == null) { + IEditorPart targetEditor = fWindow.getActivePage().getActiveEditor(); + if (targetEditor != null && (targetEditor instanceof PHPEditor)) { + fEditor = (PHPEditor) targetEditor; + } + } + if (fEditor != null) { + // TableView view = TableView.getInstance(); + + // determine the current Project from a (file-based) Editor + fWindow = fEditor.getEditorSite().getWorkbenchWindow(); + IFile f = ((IFileEditorInput) fEditor.getEditorInput()).getFile(); + fProject = f.getProject(); + + ITextSelection selection = (ITextSelection) fEditor + .getSelectionProvider().getSelection(); + IDocument doc = fEditor.getDocumentProvider().getDocument( + fEditor.getEditorInput()); + int pos = selection.getOffset(); + // System.out.println(selection.getText()); + String tableName = getSQLTableName(doc, pos); + + IViewPart viewPart = null; + String view = "com.quantum.view.tableview.TableView"; + try { + IWorkbenchPage page = QuantumPlugin.getDefault().getActivePage(); + viewPart = page.findView(view); + if (viewPart == null) { + viewPart = page.showView(view); + } + page.bringToTop(viewPart); + getTables((TableView) viewPart, fProject, tableName); + } catch (PartInitException e) { + e.printStackTrace(); + } + + } + } + + public void setActiveEditor(IAction action, IEditorPart targetEditor) { + if (targetEditor != null && (targetEditor instanceof PHPEditor)) { + fEditor = (PHPEditor) targetEditor; + } + } + + private String getSQLTableName(IDocument doc, int pos) { + Point word = null; + int start = -1; + int end = -1; + + try { + + int position = pos; + char character; + + while (position >= 0) { + character = doc.getChar(position); + if (Character.isWhitespace(character) || (character == '\"') + || (character == '\'') || (character == '\r') + || (character == '\n')) + break; + --position; + } + + start = position; + + position = pos; + int length = doc.getLength(); + + while (position < length) { + character = doc.getChar(position); + if (Character.isWhitespace(character) || (character == '\"') + || (character == '\'') || (character == '\r') + || (character == '\n')) + break; + ++position; + } + + start++; + end = position; + + if (end > start) + word = new Point(start, end - start); + + } catch (BadLocationException x) { + } + + if (word != null) { + try { + return doc.get(word.x, word.y); + } catch (BadLocationException e) { + } + } + return ""; + } + + public void getTables(TableView tableView, IProject project, String tableName) { + // Get The Database bookmark from the Quantum SQL plugin: + BookmarkCollection sqlBookMarks = BookmarkCollection.getInstance(); + if (sqlBookMarks != null) { + String bookmarkString = Util.getMiscProjectsPreferenceValue(project, + IPreferenceConstants.PHP_BOOKMARK_DEFAULT); + if (bookmarkString != null && !bookmarkString.equals("")) { + Bookmark bookmark = sqlBookMarks.find(bookmarkString); + ArrayList sqlList = new ArrayList(); + if (bookmark != null && !bookmark.isConnected()) { + new ConnectionUtil().connect(bookmark, null); + } + if (bookmark != null && bookmark.isConnected()) { + try { + Connection connection = bookmark.getConnection(); + DatabaseMetaData metaData = connection.getMetaData(); + ConnectionUtil connectionUtil = new ConnectionUtil(); + Entity entity; + DatabaseAdapter adapter; + + if (metaData != null) { + String columnName; + String prefixWithoutDollar = tableName; + if (prefixWithoutDollar.charAt(0) == '$') { + prefixWithoutDollar = prefixWithoutDollar.substring(1); + } + ResultSet set; + set = metaData.getTables(null, null, "%" + prefixWithoutDollar + + "%", null); + while (set.next()) { + tableName = set.getString("TABLE_NAME"); + tableName = (tableName == null) ? "" : tableName.trim(); + if (tableName != null && tableName.length() > 0) { + sqlList.add(tableName); + } + } + set.close(); + EntityFactory entityFactory = EntityFactory.getInstance(); + if (sqlList.size() == 1) { + adapter = bookmark.getAdapter(); + entity = entityFactory.create(bookmark, null, (String) sqlList + .get(0), Entity.TABLE_TYPE); + String query = adapter.getTableQuery(entity.getQualifiedName()); + + try { + SQLResults results = MultiSQLServer.getInstance().execute( + bookmark, connectionUtil.connect(bookmark, fWindow.getShell()), + entity, query); + + if (results != null && results.isResultSet()) { + SQLResultSetCollection.getInstance().addSQLResultSet( + (SQLResultSetResults) results); + } + } catch (SQLException e) { + ExceptionDisplayDialog.openError(fWindow.getShell(), null, null, e); + } + // tableView.loadTable(entityFactory.create( + // bookmark, null, + // (String) sqlList.get(0), + // Entity.TABLE_TYPE)); + } else if (sqlList.size() > 1) { + ListSelectionDialog listSelectionDialog = new ListSelectionDialog( + PHPeclipsePlugin.getDefault().getWorkbench() + .getActiveWorkbenchWindow().getShell(), sqlList, + new ListContentProvider(), new LabelProvider(), + "Select the SQL table to open."); + listSelectionDialog.setTitle("Multiple tablenames found"); + if (listSelectionDialog.open() == Window.OK) { + Object[] locations = listSelectionDialog.getResult(); + if (locations != null) { + for (int i = 0; i < locations.length; i++) { + adapter = bookmark.getAdapter(); + entity = entityFactory.create(bookmark, null, + (String) locations[i], Entity.TABLE_TYPE); + String query = adapter.getTableQuery(entity + .getQualifiedName()); + + try { + SQLResults results = MultiSQLServer.getInstance() + .execute(bookmark, + connectionUtil.connect(bookmark, fWindow.getShell()), + entity, query); + + if (results != null && results.isResultSet()) { + SQLResultSetCollection.getInstance().addSQLResultSet( + (SQLResultSetResults) results); + } + } catch (SQLException e) { + ExceptionDisplayDialog.openError(fWindow.getShell(), null, null, e); + } + + // tableView + // .loadTable(entityFactory + // .create( + // bookmark, + // null, + // (String) locations[i], + // Entity.TABLE_TYPE)); + } + + } + } + } + } + } catch (NotConnectedException e) { + // ignore this - not mission critical + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } + } } \ No newline at end of file -- 1.7.1